[PATCH] v2v: Filter out the transfer iso if it's returned by inspect_os()
by Matthew Booth
inspect_os() shouldn't do this, but ultimately it's heuristic. As we know what
the transfer device is, we can double-check the output.
---
v2v/virt-v2v.pl | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index fe07ae9..6e73102 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -496,11 +496,18 @@ my $g = new Sys::VirtConvert::GuestfsHandle(
$output_method eq 'rhev'
);
+# Get the name of the appliance's transfer device, if it has one
+my $transferdev;
+if (defined($transferiso)) {
+ my @devices = $g->list_devices();
+ $transferdev = pop(@devices);
+}
+
my $guestcaps;
my $desc;
eval {
# Inspect the guest
- $desc = inspect_guest($g);
+ $desc = inspect_guest($g, $transferdev);
# Modify the guest and its metadata
$guestcaps =
@@ -559,9 +566,18 @@ sub signal_exit
sub inspect_guest
{
my $g = shift;
+ my $transferdev = shift;
# Get list of roots, sorted.
my @roots = $g->inspect_os ();
+
+ # Filter out the transfer device from the results of inspect_os
+ # There's a libguestfs bug (fixed upstream) which meant the transfer ISO
+ # could be erroneously detected as an unknown Windows OS. As we know what it
+ # is, we can filter out the transfer device here. Even when the fix is
+ # released this is reasonable belt & braces.
+ @roots = grep(!/^\Q$transferdev\E$/, @roots);
+
@roots = sort @roots;
my $root_dev;
--
1.7.4.4
13 years, 7 months
[PATCH] v2v: More accurately match root choice specified as a specific device
by Matthew Booth
We could potentially have matched a logical volume /dev/ddd/lv_root as a
physical block device, and tried to do fuzzy matching on its interface.
---
v2v/virt-v2v.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/v2v/virt-v2v.pl b/v2v/virt-v2v.pl
index 7c0d7d6..fe07ae9 100755
--- a/v2v/virt-v2v.pl
+++ b/v2v/virt-v2v.pl
@@ -604,7 +604,7 @@ sub inspect_guest
# Choose the first one.
$root_dev = $roots[0];
}
- elsif ($root_choice =~ m|^/dev/[hsv]d(.*)|) {
+ elsif ($root_choice =~ m|^/dev/[hsv]d([a-z]+[0-9]*)$|) {
# Choose the named root.
my $partnum = $1;
foreach (@roots) {
--
1.7.4.4
13 years, 7 months
NOTE: running ./fish/guestfish etc from build dir without installing
by Richard W.M. Jones
In 1.11.1 / git, I have made some changes to the way that you run
guestfish, guestmount and the virt tools from the build directory
without installing.
Firstly you can't just run ./fish/guestfish or ./fuse/guestmount any
more and have those programs magically set LIBGUESTFS_PATH. The
automagic code was always error-prone and I have removed it.
Secondly, all of the run-*-local scripts have gone.
This is all replaced by a single 'run' script in the top level source
directory. Best explained by this quote from the README file:
--<quote>-----------------------------------------------------------
You can run guestfish, guestmount and the virt tools without needing
to install, using the "run" script in the top directory. This script
sets up some environment variables. For example:
./run ./fish/guestfish [usual guestfish args ...]
./run ./inspector/virt-inspector [usual virt-inspector args ...]
If you are already in the fish/ subdirectory, then the following
command will also work:
../run ./guestfish [...]
You can also make a symlink (note: NOT a hard link) from your $PATH to
the run script, eg:
cd ~/bin
ln -s ~/libguestfs/run libguestfs-run
cd ~/libguestfs
libguestfs-run ./inspector/virt-inspector [...]
You can also run the C programs under valgrind like this:
./run valgrind [valgrind opts...] ./cat/virt-cat [virt-cat opts...]
This also works with sudo (eg. if you need root access for libvirt or
to access a block device):
sudo ./run ./cat/virt-cat -d LinuxGuest /etc/passwd
--</quote>----------------------------------------------------------
http://libguestfs.org/README.txt
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
13 years, 7 months
[PATCH hivex] maint: split long lines
by Jim Meyering
Hi Rich,
I find it more readable (and safer to review) to avoid lines
longer than 80 columns. When reviewing changes that wrap,
I've noticed that it is harder to spot certain types of mistakes
in the wrapped portion of a long line.
>From 930118b380b35bb33e7719b0eb2ab6b31fa2d7e4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 13 Apr 2011 16:08:57 +0200
Subject: [PATCH hivex] maint: split long lines
* lib/hivex.c: Split lines longer than 80 columns.
---
lib/hivex.c | 146 ++++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 95 insertions(+), 51 deletions(-)
diff --git a/lib/hivex.c b/lib/hivex.c
index 860c85c..8a49c65 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -1,5 +1,5 @@
/* hivex - Windows Registry "hive" extraction library.
- * Copyright (C) 2009-2010 Red Hat Inc.
+ * Copyright (C) 2009-2011 Red Hat Inc.
* Derived from code by Petter Nordahl-Hagen under a compatible license:
* Copyright (c) 1997-2007 Petter Nordahl-Hagen.
* Derived from code by Markus Stephany under a compatible license:
@@ -415,7 +415,8 @@ hivex_open (const char *filename, int flags)
page->magic[1] != 'b' ||
page->magic[2] != 'i' ||
page->magic[3] != 'n') {
- fprintf (stderr, "hivex: %s: trailing garbage at end of file (at 0x%zx, after %zu pages)\n",
+ fprintf (stderr, "hivex: %s: trailing garbage at end of file "
+ "(at 0x%zx, after %zu pages)\n",
filename, off, pages);
errno = ENOTSUP;
goto error;
@@ -453,7 +454,8 @@ hivex_open (const char *filename, int flags)
int used;
seg_len = block_len (h, blkoff, &used);
if (seg_len <= 4 || (seg_len & 3) != 0) {
- fprintf (stderr, "hivex: %s: block size %" PRIu32 " at 0x%zx, bad registry\n",
+ fprintf (stderr, "hivex: %s: block size %" PRIu32 " at 0x%zx,"
+ " bad registry\n",
filename, le32toh (block->seg_len), blkoff);
errno = ENOTSUP;
goto error;
@@ -586,7 +588,8 @@ hivex_node_name (hive_h *h, hive_node_h node)
size_t seg_len = block_len (h, node, NULL);
if (sizeof (struct ntreg_nk_record) + len - 1 > seg_len) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_name: returning EFAULT because node name is too long (%zu, %zu)\n",
+ fprintf (stderr, "hivex_node_name: returning EFAULT because node name"
+ " is too long (%zu, %zu)\n",
len, seg_len);
errno = EFAULT;
return NULL;
@@ -733,7 +736,8 @@ get_children (hive_h *h, hive_node_h node,
/* Arbitrarily limit the number of subkeys we will ever deal with. */
if (nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex: get_children: returning ERANGE because nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS (%zu > %d)\n",
+ fprintf (stderr, "hivex: get_children: returning ERANGE because "
+ "nr_subkeys_in_nk > HIVEX_MAX_SUBKEYS (%zu > %d)\n",
nr_subkeys_in_nk, HIVEX_MAX_SUBKEYS);
errno = ERANGE;
goto error;
@@ -751,7 +755,8 @@ get_children (hive_h *h, hive_node_h node,
subkey_lf += 0x1000;
if (!IS_VALID_BLOCK (h, subkey_lf)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: returning EFAULT because subkey_lf is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_children: returning EFAULT"
+ " because subkey_lf is not a valid block (0x%zx)\n",
subkey_lf);
errno = EFAULT;
goto error;
@@ -775,7 +780,8 @@ get_children (hive_h *h, hive_node_h node,
size_t nr_subkeys_in_lf = le16toh (lf->nr_keys);
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: nr_subkeys_in_nk = %zu, nr_subkeys_in_lf = %zu\n",
+ fprintf (stderr, "hivex_node_children: nr_subkeys_in_nk = %zu,"
+ " nr_subkeys_in_lf = %zu\n",
nr_subkeys_in_nk, nr_subkeys_in_lf);
if (nr_subkeys_in_nk != nr_subkeys_in_lf) {
@@ -786,7 +792,8 @@ get_children (hive_h *h, hive_node_h node,
size_t len = block_len (h, subkey_lf, NULL);
if (8 + nr_subkeys_in_lf * 8 > len) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: returning EFAULT because too many subkeys (%zu, %zu)\n",
+ fprintf (stderr, "hivex_node_children: returning EFAULT"
+ " because too many subkeys (%zu, %zu)\n",
nr_subkeys_in_lf, len);
errno = EFAULT;
goto error;
@@ -799,7 +806,8 @@ get_children (hive_h *h, hive_node_h node,
if (!(flags & GET_CHILDREN_NO_CHECK_NK)) {
if (!IS_VALID_BLOCK (h, subkey)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: returning EFAULT because subkey is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_children: returning EFAULT"
+ " because subkey is not a valid block (0x%zx)\n",
subkey);
errno = EFAULT;
goto error;
@@ -823,14 +831,16 @@ get_children (hive_h *h, hive_node_h node,
offset += 0x1000;
if (!IS_VALID_BLOCK (h, offset)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: returning EFAULT because ri-offset is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_children: returning EFAULT"
+ " because ri-offset is not a valid block (0x%zx)\n",
offset);
errno = EFAULT;
goto error;
}
if (!BLOCK_ID_EQ (h, offset, "lf") && !BLOCK_ID_EQ (h, offset, "lh")) {
if (h->msglvl >= 2)
- fprintf (stderr, "get_children: returning ENOTSUP because ri-record offset does not point to lf/lh (0x%zx)\n",
+ fprintf (stderr, "get_children: returning ENOTSUP"
+ " because ri-record offset does not point to lf/lh (0x%zx)\n",
offset);
errno = ENOTSUP;
goto error;
@@ -846,7 +856,8 @@ get_children (hive_h *h, hive_node_h node,
}
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: nr_subkeys_in_nk = %zu, counted = %zu\n",
+ fprintf (stderr, "hivex_node_children: nr_subkeys_in_nk = %zu,"
+ " counted = %zu\n",
nr_subkeys_in_nk, count);
if (nr_subkeys_in_nk != count) {
@@ -862,14 +873,16 @@ get_children (hive_h *h, hive_node_h node,
offset += 0x1000;
if (!IS_VALID_BLOCK (h, offset)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: returning EFAULT because ri-offset is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_children: returning EFAULT"
+ " because ri-offset is not a valid block (0x%zx)\n",
offset);
errno = EFAULT;
goto error;
}
if (!BLOCK_ID_EQ (h, offset, "lf") && !BLOCK_ID_EQ (h, offset, "lh")) {
if (h->msglvl >= 2)
- fprintf (stderr, "get_children: returning ENOTSUP because ri-record offset does not point to lf/lh (0x%zx)\n",
+ fprintf (stderr, "get_children: returning ENOTSUP"
+ " because ri-record offset does not point to lf/lh (0x%zx)\n",
offset);
errno = ENOTSUP;
goto error;
@@ -885,7 +898,8 @@ get_children (hive_h *h, hive_node_h node,
if (!(flags & GET_CHILDREN_NO_CHECK_NK)) {
if (!IS_VALID_BLOCK (h, subkey)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_children: returning EFAULT because indirect subkey is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_children: returning EFAULT"
+ " because indirect subkey is not a valid block (0x%zx)\n",
subkey);
errno = EFAULT;
goto error;
@@ -899,7 +913,8 @@ get_children (hive_h *h, hive_node_h node,
}
/* else not supported, set errno and fall through */
if (h->msglvl >= 2)
- fprintf (stderr, "get_children: returning ENOTSUP because subkey block is not lf/lh/ri (0x%zx, %d, %d)\n",
+ fprintf (stderr, "get_children: returning ENOTSUP"
+ " because subkey block is not lf/lh/ri (0x%zx, %d, %d)\n",
subkey_lf, block->id[0], block->id[1]);
errno = ENOTSUP;
error:
@@ -972,7 +987,8 @@ hivex_node_parent (hive_h *h, hive_node_h node)
ret += 0x1000;
if (!IS_VALID_BLOCK (h, ret)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_parent: returning EFAULT because parent is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_parent: returning EFAULT"
+ " because parent is not a valid block (0x%zx)\n",
ret);
errno = EFAULT;
return 0;
@@ -1006,7 +1022,8 @@ get_values (hive_h *h, hive_node_h node,
/* Arbitrarily limit the number of values we will ever deal with. */
if (nr_values > HIVEX_MAX_VALUES) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex: get_values: returning ERANGE because nr_values > HIVEX_MAX_VALUES (%zu > %d)\n",
+ fprintf (stderr, "hivex: get_values: returning ERANGE"
+ " because nr_values > HIVEX_MAX_VALUES (%zu > %d)\n",
nr_values, HIVEX_MAX_VALUES);
errno = ERANGE;
goto error;
@@ -1021,7 +1038,8 @@ get_values (hive_h *h, hive_node_h node,
vlist_offset += 0x1000;
if (!IS_VALID_BLOCK (h, vlist_offset)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_values: returning EFAULT because value list is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_values: returning EFAULT"
+ " because value list is not a valid block (0x%zx)\n",
vlist_offset);
errno = EFAULT;
goto error;
@@ -1036,7 +1054,8 @@ get_values (hive_h *h, hive_node_h node,
size_t len = block_len (h, vlist_offset, NULL);
if (4 + nr_values * 4 > len) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_values: returning EFAULT because value list is too long (%zu, %zu)\n",
+ fprintf (stderr, "hivex_node_values: returning EFAULT"
+ " because value list is too long (%zu, %zu)\n",
nr_values, len);
errno = EFAULT;
goto error;
@@ -1048,7 +1067,8 @@ get_values (hive_h *h, hive_node_h node,
value += 0x1000;
if (!IS_VALID_BLOCK (h, value)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_values: returning EFAULT because value is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_node_values: returning EFAULT"
+ " because value is not a valid block (0x%zx)\n",
value);
errno = EFAULT;
goto error;
@@ -1134,7 +1154,8 @@ hivex_value_key (hive_h *h, hive_value_h value)
size_t seg_len = block_len (h, value, NULL);
if (sizeof (struct ntreg_vk_record) + len - 1 > seg_len) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_value_key: returning EFAULT because key length is too long (%zu, %zu)\n",
+ fprintf (stderr, "hivex_value_key: returning EFAULT"
+ " because key length is too long (%zu, %zu)\n",
len, seg_len);
errno = EFAULT;
return NULL;
@@ -1207,7 +1228,8 @@ hivex_value_value (hive_h *h, hive_value_h value,
/* Arbitrarily limit the length that we will read. */
if (len > HIVEX_MAX_VALUE_LEN) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_value_value: returning ERANGE because data length > HIVEX_MAX_VALUE_LEN (%zu > %d)\n",
+ fprintf (stderr, "hivex_value_value: returning ERANGE because data "
+ "length > HIVEX_MAX_VALUE_LEN (%zu > %d)\n",
len, HIVEX_MAX_SUBKEYS);
errno = ERANGE;
return NULL;
@@ -1226,7 +1248,8 @@ hivex_value_value (hive_h *h, hive_value_h value,
data_offset += 0x1000;
if (!IS_VALID_BLOCK (h, data_offset)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_value_value: returning EFAULT because data offset is not a valid block (0x%zx)\n",
+ fprintf (stderr, "hivex_value_value: returning EFAULT because data "
+ "offset is not a valid block (0x%zx)\n",
data_offset);
errno = EFAULT;
free (ret);
@@ -1242,7 +1265,9 @@ hivex_value_value (hive_h *h, hive_value_h value,
size_t blen = block_len (h, data_offset, NULL);
if (len > blen - 4 /* subtract 4 for block header */) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_value_value: warning: declared data length is longer than the block it is in (data 0x%zx, data len %zu, block len %zu)\n",
+ fprintf (stderr, "hivex_value_value: warning: declared data length "
+ "is longer than the block it is in "
+ "(data 0x%zx, data len %zu, block len %zu)\n",
data_offset, len, blen);
len = blen - 4;
}
@@ -1502,7 +1527,9 @@ hivex_visit (hive_h *h, const struct hivex_visitor *visitor, size_t len,
return hivex_visit_node (h, hivex_root (h), visitor, len, opaque, flags);
}
-static int hivex__visit_node (hive_h *h, hive_node_h node, const struct hivex_visitor *vtor, char *unvisited, void *opaque, int flags);
+static int hivex__visit_node (hive_h *h, hive_node_h node,
+ const struct hivex_visitor *vtor,
+ char *unvisited, void *opaque, int flags);
int
hivex_visit_node (hive_h *h, hive_node_h node,
@@ -1550,7 +1577,8 @@ hivex__visit_node (hive_h *h, hive_node_h node,
if (!BITMAP_TST (unvisited, node)) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex__visit_node: contains cycle: visited node 0x%zx already\n",
+ fprintf (stderr, "hivex__visit_node: contains cycle:"
+ " visited node 0x%zx already\n",
node);
errno = ELOOP;
@@ -1623,14 +1651,16 @@ hivex__visit_node (hive_h *h, hive_node_h node,
}
if (vtor->value_string_invalid_utf16) {
str = hivex_value_value (h, values[i], &t, &len);
- if (vtor->value_string_invalid_utf16 (h, opaque, node, values[i], t, len, key, str) == -1)
+ if (vtor->value_string_invalid_utf16 (h, opaque, node, values[i],
+ t, len, key, str) == -1)
goto error;
free (str); str = NULL;
}
break;
}
if (vtor->value_string &&
- vtor->value_string (h, opaque, node, values[i], t, len, key, str) == -1)
+ vtor->value_string (h, opaque, node, values[i],
+ t, len, key, str) == -1)
goto error;
free (str); str = NULL;
break;
@@ -1639,7 +1669,8 @@ hivex__visit_node (hive_h *h, hive_node_h node,
case hive_t_dword_be: {
int32_t i32 = hivex_value_dword (h, values[i]);
if (vtor->value_dword &&
- vtor->value_dword (h, opaque, node, values[i], t, len, key, i32) == -1)
+ vtor->value_dword (h, opaque, node, values[i],
+ t, len, key, i32) == -1)
goto error;
break;
}
@@ -1647,7 +1678,8 @@ hivex__visit_node (hive_h *h, hive_node_h node,
case hive_t_qword: {
int64_t i64 = hivex_value_qword (h, values[i]);
if (vtor->value_qword &&
- vtor->value_qword (h, opaque, node, values[i], t, len, key, i64) == -1)
+ vtor->value_qword (h, opaque, node, values[i],
+ t, len, key, i64) == -1)
goto error;
break;
}
@@ -1663,7 +1695,8 @@ hivex__visit_node (hive_h *h, hive_node_h node,
goto error;
}
if (vtor->value_binary &&
- vtor->value_binary (h, opaque, node, values[i], t, len, key, str) == -1)
+ vtor->value_binary (h, opaque, node, values[i],
+ t, len, key, str) == -1)
goto error;
free (str); str = NULL;
break;
@@ -1677,14 +1710,16 @@ hivex__visit_node (hive_h *h, hive_node_h node,
}
if (vtor->value_string_invalid_utf16) {
str = hivex_value_value (h, values[i], &t, &len);
- if (vtor->value_string_invalid_utf16 (h, opaque, node, values[i], t, len, key, str) == -1)
+ if (vtor->value_string_invalid_utf16 (h, opaque, node, values[i],
+ t, len, key, str) == -1)
goto error;
free (str); str = NULL;
}
break;
}
if (vtor->value_multiple_strings &&
- vtor->value_multiple_strings (h, opaque, node, values[i], t, len, key, strs) == -1)
+ vtor->value_multiple_strings (h, opaque, node, values[i],
+ t, len, key, strs) == -1)
goto error;
free_strings (strs); strs = NULL;
break;
@@ -1699,7 +1734,8 @@ hivex__visit_node (hive_h *h, hive_node_h node,
goto error;
}
if (vtor->value_other &&
- vtor->value_other (h, opaque, node, values[i], t, len, key, str) == -1)
+ vtor->value_other (h, opaque, node, values[i],
+ t, len, key, str) == -1)
goto error;
free (str); str = NULL;
break;
@@ -1774,9 +1810,11 @@ allocate_page (hive_h *h, size_t allocation_hint)
ssize_t extend = h->endpages + nr_4k_pages * 4096 - h->size;
if (h->msglvl >= 2) {
- fprintf (stderr, "allocate_page: current endpages = 0x%zx, current size = 0x%zx\n",
+ fprintf (stderr, "allocate_page: current endpages = 0x%zx,"
+ " current size = 0x%zx\n",
h->endpages, h->size);
- fprintf (stderr, "allocate_page: extending file by %zd bytes (<= 0 if no extension)\n",
+ fprintf (stderr, "allocate_page: extending file by %zd bytes"
+ " (<= 0 if no extension)\n",
extend);
}
@@ -1861,8 +1899,8 @@ allocate_block (hive_h *h, size_t seg_len, const char id[2])
* for them, albeit unusual.
*/
if (h->msglvl >= 2)
- fprintf (stderr, "allocate_block: refusing too small allocation (%zu), returning ERANGE\n",
- seg_len);
+ fprintf (stderr, "allocate_block: refusing too small allocation (%zu),"
+ " returning ERANGE\n", seg_len);
errno = ERANGE;
return 0;
}
@@ -1870,8 +1908,8 @@ allocate_block (hive_h *h, size_t seg_len, const char id[2])
/* Refuse really large allocations. */
if (seg_len > HIVEX_MAX_ALLOCATION) {
if (h->msglvl >= 2)
- fprintf (stderr, "allocate_block: refusing large allocation (%zu), returning ERANGE\n",
- seg_len);
+ fprintf (stderr, "allocate_block: refusing large allocation (%zu),"
+ " returning ERANGE\n", seg_len);
errno = ERANGE;
return 0;
}
@@ -1917,8 +1955,8 @@ allocate_block (hive_h *h, size_t seg_len, const char id[2])
ssize_t rem = h->endpages - h->endblocks;
if (rem > 0) {
if (h->msglvl >= 2)
- fprintf (stderr, "allocate_block: marking remainder of page free starting at 0x%zx, size %zd\n",
- h->endblocks, rem);
+ fprintf (stderr, "allocate_block: marking remainder of page free"
+ " starting at 0x%zx, size %zd\n", h->endblocks, rem);
assert (rem >= 4);
@@ -2196,7 +2234,8 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
return 0;
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_add_child: allocated new nk-record for child at 0x%zx\n", node);
+ fprintf (stderr, "hivex_node_add_child: allocated new nk-record"
+ " for child at 0x%zx\n", node);
struct ntreg_nk_record *nk = (struct ntreg_nk_record *) (h->addr + node);
nk->flags = htole16 (0x0020); /* key is ASCII. */
@@ -2216,7 +2255,8 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
if (!IS_VALID_BLOCK (h, parent_sk_offset) ||
!BLOCK_ID_EQ (h, parent_sk_offset, "sk")) {
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_add_child: returning EFAULT because parent sk is not a valid block (%zu)\n",
+ fprintf (stderr, "hivex_node_add_child: returning EFAULT"
+ " because parent sk is not a valid block (%zu)\n",
parent_sk_offset);
errno = EFAULT;
return 0;
@@ -2270,7 +2310,8 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
parent_nk = (struct ntreg_nk_record *) (h->addr + parent);
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_add_child: no keys, allocated new lh-record at 0x%zx\n", lh_offs);
+ fprintf (stderr, "hivex_node_add_child: no keys, allocated new"
+ " lh-record at 0x%zx\n", lh_offs);
parent_nk->subkey_lf = htole32 (lh_offs - 0x1000);
}
@@ -2302,7 +2343,8 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
/* Insert it. */
insert_it:
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_add_child: insert key in existing lh-record at 0x%zx, posn %zu\n", old_offs, j);
+ fprintf (stderr, "hivex_node_add_child: insert key in existing"
+ " lh-record at 0x%zx, posn %zu\n", old_offs, j);
new_offs = insert_lf_record (h, old_offs, j, name, node);
if (new_offs == 0) {
@@ -2343,7 +2385,8 @@ hivex_node_add_child (hive_h *h, hive_node_h parent, const char *name)
/* Not found .. This is an internal error. */
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_add_child: returning ENOTSUP because could not find ri->lf link\n");
+ fprintf (stderr, "hivex_node_add_child: returning ENOTSUP"
+ " because could not find ri->lf link\n");
errno = ENOTSUP;
free (blocks);
return 0;
@@ -2536,7 +2579,8 @@ hivex_node_delete_child (hive_h *h, hive_node_h node)
}
}
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_delete_child: could not find parent to child link\n");
+ fprintf (stderr, "hivex_node_delete_child: could not find parent"
+ " to child link\n");
errno = ENOTSUP;
return -1;
@@ -2546,8 +2590,8 @@ hivex_node_delete_child (hive_h *h, hive_node_h node)
nk->nr_subkeys = htole32 (nr_subkeys_in_nk - 1);
if (h->msglvl >= 2)
- fprintf (stderr, "hivex_node_delete_child: updating nr_subkeys in parent 0x%zx to %zu\n",
- parent, nr_subkeys_in_nk);
+ fprintf (stderr, "hivex_node_delete_child: updating nr_subkeys"
+ " in parent 0x%zx to %zu\n", parent, nr_subkeys_in_nk);
return 0;
}
--
1.7.5.rc1.228.g86d60b
13 years, 7 months
[PATCH libguestfs] include string.h and libintl.h, as needed
by Jim Meyering
This appears to fix the last of the missing includes:
>From 4e8c86d43a330ac79624a78d7ef40aa17f8fb4db Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Wed, 13 Apr 2011 14:34:38 +0200
Subject: [PATCH libguestfs] include string.h and libintl.h, as needed
* df/df.c: As above.
* df/main.c: As above.
* df/output.c: As above.
* fuse/guestmount.c: As above.
* inspector/virt-inspector.c: As above.
* rescue/virt-rescue.c: As above.
---
df/df.c | 3 ++-
df/main.c | 4 +++-
df/output.c | 3 ++-
fuse/guestmount.c | 1 +
inspector/virt-inspector.c | 2 ++
rescue/virt-rescue.c | 4 +++-
6 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/df/df.c b/df/df.c
index c2db970..8821d68 100644
--- a/df/df.c
+++ b/df/df.c
@@ -1,5 +1,5 @@
/* virt-df
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include <inttypes.h>
#ifdef HAVE_LIBVIRT
diff --git a/df/main.c b/df/main.c
index 3421d90..17aa283 100644
--- a/df/main.c
+++ b/df/main.c
@@ -1,5 +1,5 @@
/* virt-df
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,11 +21,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include <inttypes.h>
#include <unistd.h>
#include <getopt.h>
#include <locale.h>
#include <assert.h>
+#include <libintl.h>
#ifdef HAVE_LIBVIRT
#include <libvirt/libvirt.h>
diff --git a/df/output.c b/df/output.c
index b60d285..7852daa 100644
--- a/df/output.c
+++ b/df/output.c
@@ -1,5 +1,5 @@
/* virt-df
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include <inttypes.h>
#include <xvasprintf.h>
#include <math.h>
diff --git a/fuse/guestmount.c b/fuse/guestmount.c
index 5a89fcb..8d483b3 100644
--- a/fuse/guestmount.c
+++ b/fuse/guestmount.c
@@ -42,6 +42,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <locale.h>
+#include <libintl.h>
#include <fuse.h>
#include <guestfs.h>
diff --git a/inspector/virt-inspector.c b/inspector/virt-inspector.c
index 7724be6..69c4ea9 100644
--- a/inspector/virt-inspector.c
+++ b/inspector/virt-inspector.c
@@ -20,11 +20,13 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <inttypes.h>
#include <unistd.h>
#include <getopt.h>
#include <locale.h>
#include <assert.h>
+#include <libintl.h>
#include <libxml/xmlIO.h>
#include <libxml/xmlwriter.h>
diff --git a/rescue/virt-rescue.c b/rescue/virt-rescue.c
index f129b1c..911b80a 100644
--- a/rescue/virt-rescue.c
+++ b/rescue/virt-rescue.c
@@ -1,5 +1,5 @@
/* virt-rescue
- * Copyright (C) 2010 Red Hat Inc.
+ * Copyright (C) 2010-2011 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,12 +20,14 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <inttypes.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>
#include <locale.h>
#include <assert.h>
+#include <libintl.h>
#include "progname.h"
#include "xvasprintf.h"
--
1.7.5.rc1.228.g86d60b
13 years, 7 months
No rule to make target `guestfs.pod', needed by `guestfs.3' in po-docs/ja
by Jim Meyering
FYI, I hit this failure:
make[3]: Entering directory `/h/j/w/co/libguestfs/po-docs/ja'
make[3]: *** No rule to make target `guestfs.pod', needed by `guestfs.3'. Stop.
make[3]: Leaving directory `/h/j/w/co/libguestfs/po-docs/ja'
guestfs.pod is in src/.
I'll investigate later, if needed.
13 years, 7 months