virt-v2v should add kernel console= to Xen->KVM converted guest's grub.conf
by Chuck Anderson
I'm using virt-v2v (0.8.3 currently) on EL6 to convert Xen guests to
KVM. I see how virt-v2v converts any existing references to xvc0 and
hvc0 serial console devices in /etc/inittab, /etc/securetty, and
grub.conf. However, my Xen DomU grub.conf's don't have any mention of
console= on the kernel lines, because the Xen DomU kernel defaults to
using the correct xvc0 console. As a result, after conversion console
messages don't go to the virsh console, although a getty does get
started and securetty is updated correctly.
I'd like to propose that the converter add such kernel console=
arguments if it doesn't find any to replace. Here is the current
code:
# Update any kernel console lines
foreach my $augpath
($g->aug_match("/files$grub_conf/title/kernel/console"))
{
my $console = $g->aug_get($augpath);
if ($console =~ /\b(x|h)vc0\b/) {
$console =~ s/\b(x|h)vc0\b/ttyS0/g;
$g->aug_set($augpath, $console);
}
}
I'd imagine that if no matches are found, it should use augeas to set
console=ttyS0,115200 on all matching kernel lines, but I'm not
familiar enough with augeas nor the perl bindings to attempt this. I
don't see where the augeas bindings are being imported into virt-v2v,
so I'm not sure where to find the documentation for whatever bindings
are being used (the regular perl bindings as mentioned on upstream
augeas website don't appear anywhere on my system).
I'd appreciate any pointers to documentation so I can attempt this
myself, or even better, a quick patch to try out if this seems like a
good idea.
Thanks!
(A different, but related problem, is that EL5.7 anaconda apparently
isn't smart enough to add console= to grub.conf even though anaconda
itself was booted with a console= parameter via virt-install. So after
the install completes, virsh console becomes silent, and the new
install doesn't get a getty or updated securetty on it. I'm
investigating kickstart workarounds to manually add console= in this
case.)
12 years, 11 months
[PATCH] fish: Do not emit error message if history file cannot be open for writing.
by Hilko Bengen
The error message generated by perror() is not particularly useful to
the user. Many other command line programs that can keep history
around cope silently if they can't create or write to their history
file.
---
fish/fish.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/fish/fish.c b/fish/fish.c
index b782b7c..bf976ea 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -1433,10 +1433,8 @@ cleanup_readline (void)
if (histfile[0] != '\0') {
fd = open (histfile, O_WRONLY|O_CREAT, 0644);
- if (fd == -1) {
- perror (histfile);
+ if (fd == -1)
return;
- }
close (fd);
#ifdef HAVE_APPEND_HISTORY
--
1.7.8.3
12 years, 11 months
[PATCH] Prepend local library path to LD_LIBRARY_PATH for tests, instead of replacing it
by Hilko Bengen
Overwriting LD_LIBRARY_PATH broke some tests when running with fakeroot.
---
align/Makefile.am | 2 +-
cat/Makefile.am | 2 +-
clone/Makefile.am | 2 +-
df/Makefile.am | 2 +-
edit/Makefile.am | 2 +-
fish/Makefile.am | 2 +-
haskell/Makefile.am | 2 +-
ocaml/Makefile.am | 2 +-
perl/Makefile.am | 2 +-
resize/Makefile.am | 2 +-
ruby/Makefile.am | 2 +-
sparsify/Makefile.am | 2 +-
tests/luks/Makefile.am | 2 +-
tests/lvm/Makefile.am | 2 +-
tests/md/Makefile.am | 2 +-
tests/protocol/Makefile.am | 2 +-
tests/qemu/Makefile.am | 2 +-
tests/regressions/Makefile.am | 2 +-
tools/Makefile.am | 2 +-
19 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/align/Makefile.am b/align/Makefile.am
index 1dc9221..4afb2e4 100644
--- a/align/Makefile.am
+++ b/align/Makefile.am
@@ -72,7 +72,7 @@ stamp-virt-alignment-scan.pod: virt-alignment-scan.pod
# TESTS_ENVIRONMENT = \
# MALLOC_PERTURB_=$(random_val) \
-# LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+# LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
# LIBGUESTFS_PATH=$(top_builddir)/appliance \
# TMPDIR=$(top_builddir)
diff --git a/cat/Makefile.am b/cat/Makefile.am
index 3180b26..2a42954 100644
--- a/cat/Makefile.am
+++ b/cat/Makefile.am
@@ -132,7 +132,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/clone/Makefile.am b/clone/Makefile.am
index 11a2e9b..5eb542c 100644
--- a/clone/Makefile.am
+++ b/clone/Makefile.am
@@ -44,7 +44,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/df/Makefile.am b/df/Makefile.am
index 2b2c47e..2c0d249 100644
--- a/df/Makefile.am
+++ b/df/Makefile.am
@@ -78,7 +78,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/edit/Makefile.am b/edit/Makefile.am
index d94e42e..8336e78 100644
--- a/edit/Makefile.am
+++ b/edit/Makefile.am
@@ -70,7 +70,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/fish/Makefile.am b/fish/Makefile.am
index 2624a7d..2eb2e11 100644
--- a/fish/Makefile.am
+++ b/fish/Makefile.am
@@ -234,7 +234,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/haskell/Makefile.am b/haskell/Makefile.am
index 5c1ff98..58bb30c 100644
--- a/haskell/Makefile.am
+++ b/haskell/Makefile.am
@@ -28,7 +28,7 @@ EXTRA_DIST = $(generator_built) *.hs run-bindtests
if HAVE_HASKELL
TESTS_ENVIRONMENT = \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir) \
$(VG)
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 95185ef..1d7a5c6 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -71,7 +71,7 @@ html/index.html: $(srcdir)/guestfs*.mli $(srcdir)/guestfs*.ml
endif
TESTS_ENVIRONMENT = \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir) \
$(VG)
diff --git a/perl/Makefile.am b/perl/Makefile.am
index 4c78f87..4f86de1 100644
--- a/perl/Makefile.am
+++ b/perl/Makefile.am
@@ -51,7 +51,7 @@ TESTS = run-bindtests run-perl-tests
$(TESTS): src_deps all appliance test_images
TESTS_ENVIRONMENT = \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/resize/Makefile.am b/resize/Makefile.am
index 3f33118..d8ce376 100644
--- a/resize/Makefile.am
+++ b/resize/Makefile.am
@@ -103,7 +103,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 8139140..cf8a072 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -47,7 +47,7 @@ if HAVE_RUBY
TESTS = run-bindtests run-ruby-tests
TESTS_ENVIRONMENT = \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir) \
RUBY=$(RUBY)
diff --git a/sparsify/Makefile.am b/sparsify/Makefile.am
index 9d5e076..5c88d2d 100644
--- a/sparsify/Makefile.am
+++ b/sparsify/Makefile.am
@@ -96,7 +96,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/tests/luks/Makefile.am b/tests/luks/Makefile.am
index 2bc21ed..7d6b91a 100644
--- a/tests/luks/Makefile.am
+++ b/tests/luks/Makefile.am
@@ -25,7 +25,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/tests/lvm/Makefile.am b/tests/lvm/Makefile.am
index 9c4c137..ec20f72 100644
--- a/tests/lvm/Makefile.am
+++ b/tests/lvm/Makefile.am
@@ -25,7 +25,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir) \
PERL5LIB=$(top_builddir)/perl/blib/lib:$(top_builddir)/perl/blib/arch
diff --git a/tests/md/Makefile.am b/tests/md/Makefile.am
index c778956..dc6b5ef 100644
--- a/tests/md/Makefile.am
+++ b/tests/md/Makefile.am
@@ -28,7 +28,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/tests/protocol/Makefile.am b/tests/protocol/Makefile.am
index ce9282e..1c1d918 100644
--- a/tests/protocol/Makefile.am
+++ b/tests/protocol/Makefile.am
@@ -30,7 +30,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir) \
PERL5LIB=$(top_builddir)/perl/blib/lib:$(top_builddir)/perl/blib/arch
diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am
index f2bdeb2..0285b81 100644
--- a/tests/qemu/Makefile.am
+++ b/tests/qemu/Makefile.am
@@ -29,7 +29,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir)
diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
index e43d9e9..0af53cb 100644
--- a/tests/regressions/Makefile.am
+++ b/tests/regressions/Makefile.am
@@ -32,7 +32,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir) \
PERL5LIB=$(top_builddir)/perl/blib/lib:$(top_builddir)/perl/blib/arch \
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 2ecd0ee..29ce4f3 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -59,7 +59,7 @@ random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
TESTS_ENVIRONMENT = \
MALLOC_PERTURB_=$(random_val) \
- LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
+ LD_LIBRARY_PATH=$(top_builddir)/src/.libs${if ${LD_LIBRARY_PATH},:${LD_LIBRARY_PATH},} \
LIBGUESTFS_PATH=$(top_builddir)/appliance \
TMPDIR=$(top_builddir) \
PERL5LIB=$(top_builddir)/perl/blib/lib:$(top_builddir)/perl/blib/arch
--
1.7.8.3
12 years, 11 months
[PATCH 1/3] launch: move the filename checking to a wrapper
by Wanlong Gao
Move the filename's comma character checking to a wrapper.
Signed-off-by: Wanlong Gao <gaowanlong(a)cn.fujitsu.com>
---
src/launch.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/launch.c b/src/launch.c
index ca89b63..8eaaac8 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -277,6 +277,16 @@ valid_format_iface (const char *str)
return 1;
}
+static int
+check_path (guestfs_h *g, const char *filename)
+{
+ if (strchr (filename, ',') != NULL) {
+ error (g, _("filename cannot contain ',' (comma) character"));
+ return 1;
+ }
+ return 0;
+}
+
int
guestfs__add_drive_opts (guestfs_h *g, const char *filename,
const struct guestfs_add_drive_opts_argv *optargs)
@@ -287,10 +297,8 @@ guestfs__add_drive_opts (guestfs_h *g, const char *filename,
char *name;
int use_cache_off;
- if (strchr (filename, ',') != NULL) {
- error (g, _("filename cannot contain ',' (comma) character"));
+ if (check_path(g, filename))
return -1;
- }
readonly = optargs->bitmask & GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK
? optargs->readonly : 0;
@@ -405,10 +413,8 @@ guestfs__add_drive_ro_with_if (guestfs_h *g, const char *filename,
int
guestfs__add_cdrom (guestfs_h *g, const char *filename)
{
- if (strchr (filename, ',') != NULL) {
- error (g, _("filename cannot contain ',' (comma) character"));
+ if (check_path(g, filename))
return -1;
- }
if (access (filename, F_OK) == -1) {
perrorf (g, "%s", filename);
--
1.7.8
12 years, 11 months
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
by Matthew Booth
This map was originally included just for the java bindings, but is generally
useful to any binding which uses camel case by requirement or convention.
---
generator/generator_haskell.ml | 4 ++--
generator/generator_java.ml | 10 +++++-----
generator/generator_main.ml | 2 +-
generator/generator_structs.ml | 12 +++++-------
generator/generator_structs.mli | 8 ++++----
5 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/generator/generator_haskell.ml b/generator/generator_haskell.ml
index 29b260f..a57cfd8 100644
--- a/generator/generator_haskell.ml
+++ b/generator/generator_haskell.ml
@@ -239,10 +239,10 @@ and generate_haskell_prototype ~handle ?(hs = false) (ret, args, optargs) =
| RString _ -> pr "%s" string
| RStringList _ -> pr "[%s]" string
| RStruct (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "%s" name
| RStructList (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "[%s]" name
| RHashtable _ -> pr "Hashtable"
| RBufferOut _ -> pr "%s" string
diff --git a/generator/generator_java.ml b/generator/generator_java.ml
index 68972bc..69d5e24 100644
--- a/generator/generator_java.ml
+++ b/generator/generator_java.ml
@@ -219,10 +219,10 @@ and generate_java_prototype ?(public=false) ?(privat=false) ?(native=false)
| RBufferOut _ -> pr "String ";
| RStringList _ -> pr "String[] ";
| RStruct (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "%s " name;
| RStructList (_, typ) ->
- let name = java_name_of_struct typ in
+ let name = camel_name_of_struct typ in
pr "%s[] " name;
| RHashtable _ ->
if not native then
@@ -657,11 +657,11 @@ Java_com_redhat_et_libguestfs_GuestFS__1close
pr " free (r);\n";
pr " return jr;\n"
| RStruct (_, typ) ->
- let jtyp = java_name_of_struct typ in
+ let jtyp = camel_name_of_struct typ in
let cols = cols_of_struct typ in
generate_java_struct_return typ jtyp cols
| RStructList (_, typ) ->
- let jtyp = java_name_of_struct typ in
+ let jtyp = camel_name_of_struct typ in
let cols = cols_of_struct typ in
generate_java_struct_list_return typ jtyp cols
| RBufferOut _ ->
@@ -767,5 +767,5 @@ and generate_java_makefile_inc () =
List.iter (
fun (typ, jtyp) ->
pr "\tcom/redhat/et/libguestfs/%s.java \\\n" jtyp;
- ) java_structs;
+ ) camel_structs;
pr "\tcom/redhat/et/libguestfs/GuestFS.java\n"
diff --git a/generator/generator_main.ml b/generator/generator_main.ml
index 7e4e4ed..53a0f29 100644
--- a/generator/generator_main.ml
+++ b/generator/generator_main.ml
@@ -124,7 +124,7 @@ Run it from the top source directory using the command
let cols = cols_of_struct typ in
let filename = sprintf "java/com/redhat/et/libguestfs/%s.java" jtyp in
output_to filename (generate_java_struct jtyp cols);
- ) java_structs;
+ ) camel_structs;
output_to "java/Makefile.inc" generate_java_makefile_inc;
output_to "java/com_redhat_et_libguestfs_GuestFS.c" generate_java_c;
diff --git a/generator/generator_structs.ml b/generator/generator_structs.ml
index 8fd12e4..83442d1 100644
--- a/generator/generator_structs.ml
+++ b/generator/generator_structs.ml
@@ -193,10 +193,8 @@ let structs = [
];
] (* end of structs *)
-(* Ugh, Java has to be different ..
- * These names are also used by the Haskell bindings.
- *)
-let java_structs = [
+(* For bindings which want camel case *)
+let camel_structs = [
"int_bool", "IntBool";
"lvm_pv", "PV";
"lvm_vg", "VG";
@@ -211,11 +209,11 @@ let java_structs = [
"application", "Application";
]
-let java_name_of_struct typ =
- try List.assoc typ java_structs
+let camel_name_of_struct typ =
+ try List.assoc typ camel_structs
with Not_found ->
failwithf
- "java_name_of_struct: no java_structs entry corresponding to %s" typ
+ "camel_name_of_struct: no camel_structs entry corresponding to %s" typ
let cols_of_struct typ =
try List.assoc typ structs
diff --git a/generator/generator_structs.mli b/generator/generator_structs.mli
index 66ae2ea..f47a9ad 100644
--- a/generator/generator_structs.mli
+++ b/generator/generator_structs.mli
@@ -26,8 +26,8 @@ type cols = (string * Generator_types.field) list
val structs : (string * cols) list
(** List of structures. *)
-val java_structs : (string * string) list
-(** Of course, Java has to be different from everyone else. *)
+val camel_structs : (string * string) list
+(** For bindings which want camel case struct names *)
val lvm_pv_cols : cols
val lvm_vg_cols : cols
@@ -36,8 +36,8 @@ val lvm_lv_cols : cols
used to generate code for parsing the output of commands like
[lvs]. One day replace this with liblvm API calls. *)
-val java_name_of_struct : string -> string
-(** Extract Java name of struct. *)
+val camel_name_of_struct : string -> string
+(** Camel case name of struct. *)
val cols_of_struct : string -> cols
(** Extract columns of a struct. *)
--
1.7.7.5
12 years, 11 months
Another virt-p2v blew up
by Greg Scott
One day I'm going to run a virt-p2v that works to completion. But evidently not today.
The source physical machine is Windows 2003. This one copied the whole system drive and then died at the end and deleted the virtual disk it made. Here is the top and bottom of the trace log file on the conversion server. If the email garbles what I'm pasting in below, I can email the log as an attachment.
[root@Fedora16-64P2V log]#
[root@Fedora16-64P2V log]# more virt-p2v-server.1324939070.log
libguestfs: new guestfs handle 0x2e7b760
libguestfs: trace: add_drive_opts "/tmp/IlYDJL6AnS/20f9ecae-9c8a-4316-9154-db868
e02b4b8/v2v.i7n4vOKJ/1f1f3b28-ebf7-453e-8dbf-f1c5ad18a28e/415ca08c-e69d-449b-b9b
e-7b64715f376d" "format:raw" "iface:ide" "name:cciss/c0d0"
libguestfs: trace: add_drive_opts = 0
libguestfs: trace: add_drive_opts "/tmp/mU2Uk2VTkP" "readonly:true" "format:raw"
"iface:ide"
libguestfs: trace: add_drive_opts = 0
libguestfs: trace: set_network true
libguestfs: trace: set_network = 0
libguestfs: trace: launch
libguestfs: [00028ms] febootstrap-supermin-helper --verbose -u 36 -g 36 -f check
sum '/usr/lib64/guestfs/supermin.d' x86_64
supermin helper [00000ms] whitelist = (not specified), host_cpu = x86_64, kernel
= (null), initrd = (null), appliance = (null)
supermin helper [00001ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/3.1.0-7.fc16.x86_64 is a directory
picked vmlinuz-3.1.0-7.fc16.x86_64 because modpath /lib/modules/3.1.0-7.fc16.x86
_64 exists
checking modpath /lib/modules/3.1.1-2.fc16.x86_64 is a directory
picked vmlinuz-3.1.1-2.fc16.x86_64 because modpath /lib/modules/3.1.1-2.fc16.x86
_64 exists
checking modpath /lib/modules/3.1.2-1.fc16.x86_64 is a directory
picked vmlinuz-3.1.2-1.fc16.x86_64 because modpath /lib/modules/3.1.2-1.fc16.x86
_64 exists
supermin helper [00036ms] finished creating kernel
supermin helper [00036ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00045ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [00108ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [00109ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [01348ms] visiting /usr/lib64/guestfs/supermin.d/init.img
supermin helper [02596ms] finished creating appliance
libguestfs: [02728ms] begin building supermin appliance
libguestfs: [02734ms] run febootstrap-supermin-helper
libguestfs: [02734ms] febootstrap-supermin-helper --verbose -u 36 -g 36 -f ext2
/usr/lib64/guestfs/supermin.d x86_64 /var/tmp/guestfs.Q8Z0Mp/kernel /var/tmp/gue
stfs.Q8Z0Mp/initrd /var/tmp/guestfs.Q8Z0Mp/root
supermin helper [00001ms] whitelist = (not specified), host_cpu = x86_64, kernel
= /var/tmp/guestfs.Q8Z0Mp/kernel, initrd = /var/tmp/guestfs.Q8Z0Mp/initrd, appl
iance = /var/tmp/guestfs.Q8Z0Mp/root
supermin helper [00001ms] inputs[0] = /usr/lib64/guestfs/supermin.d
checking modpath /lib/modules/3.1.0-7.fc16.x86_64 is a directory
picked vmlinuz-3.1.0-7.fc16.x86_64 because modpath /lib/modules/3.1.0-7.fc16.x86
_64 exists
checking modpath /lib/modules/3.1.1-2.fc16.x86_64 is a directory
picked vmlinuz-3.1.1-2.fc16.x86_64 because modpath /lib/modules/3.1.1-2.fc16.x86
_64 exists
checking modpath /lib/modules/3.1.2-1.fc16.x86_64 is a directory
picked vmlinuz-3.1.2-1.fc16.x86_64 because modpath /lib/modules/3.1.2-1.fc16.x86
_64 exists
supermin helper [00001ms] finished creating kernel
supermin helper [01516ms] finished mke2fs
supermin helper [01516ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [01516ms] visiting /usr/lib64/guestfs/supermin.d/base.img
supermin helper [04258ms] visiting /usr/lib64/guestfs/supermin.d/daemon.img
supermin helper [04315ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
supermin helper [16809ms] visiting /usr/lib64/guestfs/supermin.d/init.img
supermin helper [33056ms] finished creating appliance
libguestfs: [35797ms] finished building supermin appliance
libguestfs: [35878ms] begin testing qemu features
libguestfs: [36361ms] finished testing qemu features
libguestfs: accept_from_daemon: 0x2e7b760 g->state = 1
[36363ms] /usr/bin/qemu-kvm \
-drive file=/tmp/IlYDJL6AnS/20f9ecae-9c8a-4316-9154-db868e02b4b8/v2v.i7n4vOK
J/1f1f3b28-ebf7-453e-8dbf-f1c5ad18a28e/415ca08c-e69d-449b-b9be-7b64715f376d,cach
e=off,format=raw,if=ide \
-drive file=/tmp/mU2Uk2VTkP,snapshot=on,format=raw,if=ide \
-nodefconfig \
-machine accel=kvm:tcg \
-nodefaults \
-nographic \
-m 500 \
-no-reboot \
-no-hpet \
-device virtio-serial \
-serial stdio \
-chardev socket,path=/tmp/libguestfsp3fCOS/guestfsd.sock,id=channel0 \
-device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
-netdev user,id=usernet,net=169.254.0.0/16 \
-device virtio-net-pci,netdev=usernet \
-kernel /var/tmp/.guestfs-36/kernel.1299 \
-initrd /var/tmp/.guestfs-36/initrd.1299 \
-append 'panic=1 console=ttyS0 udevtimeout=300 no_timer_check acpi=off print
k.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 TERM=linux ' \
-drive file=/var/tmp/.guestfs-36/root.1299,snapshot=on,if=virtio,cache=unsaf
eCould not access KVM kernel module: No such file or directory
failed to initialize KVM: No such file or directory
Back to tcg accelerator.
Could not open option rom 'sgabios.bin': No such file or directory
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 3.1.2-1.fc16.x86_64 (mockbuild(a)x86-04.phx2.fedorapr
oject.org) (gcc version 4.6.2 20111027 (Red Hat 4.6.2-1) (GCC) ) #1 SMP Tue Nov
22 09:00:57 UTC 2011
[ 0.000000] Command line: panic=1 console=ttyS0 udevtimeout=300 no_timer_chec
k acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 TERM=
linux
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: 0000000000000000 - 000000000009dc00 (usable)
[ 0.000000] BIOS-e820: 000000000009dc00 - 00000000000a0000 (reserved)
[ 0.000000] BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
[ 0.000000] BIOS-e820: 0000000000100000 - 000000001f3fd000 (usable)
[ 0.000000] BIOS-e820: 000000001f3fd000 - 000000001f400000 (reserved)
[ 0.000000] BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
[ 0.000000] NX (Execute Disable) protection: active
[ 0.000000] DMI 2.4 present.
[ 0.000000] No AGP bridge found
[ 0.000000] last_pfn = 0x1f3fd max_arch_pfn = 0x400000000
[ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106
[ 0.000000] found SMP MP-table at [ffff8800000fdaf0] fdaf0
[ 0.000000] init_memory_mapping: 0000000000000000-000000001f3fd000
[ 0.000000] RAMDISK: 1f2ec000 - 1f3f0000
[ 0.000000] No NUMA configuration found
[ 0.000000] Faking a node at 0000000000000000-000000001f3fd000
[ 0.000000] Initmem setup node 0 0000000000000000-000000001f3fd000
[ 0.000000] NODE_DATA [000000001f2d8000 - 000000001f2ebfff]
[ 0.000000] Zone PFN ranges:
[ 0.000000] DMA 0x00000010 -> 0x00001000
[ 0.000000] DMA32 0x00001000 -> 0x00100000
[ 0.000000] Normal empty
[ 0.000000] Movable zone start PFN for each node
[ 0.000000] early_node_map[2] active PFN ranges
[ 0.000000] 0: 0x00000010 -> 0x0000009d
[ 0.000000] 0: 0x00000100 -> 0x0001f3fd
[ 0.000000] SFI: Simple Firmware Interface v0.81 http://simplefirmware.org
[ 0.000000] Intel MultiProcessor Specification v1.4
[ 0.000000] MPTABLE: OEM ID: BOCHSCPU
[ 0.000000] MPTABLE: Product ID: 0.1
[ 0.000000] MPTABLE: APIC at: 0xFEE00000
[ 0.000000] Processor #0 (Bootup-CPU)
[ 0.000000] IOAPIC[0]: apic_id 1, version 17, address 0xfec00000, GSI 0-23
[ 0.000000] Processors: 1
[ 0.000000] SMP: Allowing 1 CPUs, 0 hotplug CPUs
[ 0.000000] PM: Registered nosave memory: 000000000009d000 - 000000000009e000
[ 0.000000] PM: Registered nosave memory: 000000000009e000 - 00000000000a0000
[ 0.000000] PM: Registered nosave memory: 00000000000a0000 - 00000000000f0000
[ 0.000000] PM: Registered nosave memory: 00000000000f0000 - 0000000000100000
[ 0.000000] Allocating PCI resources starting at 1f400000 (gap: 1f400000:e0bc
0000)
[ 0.000000] Booting paravirtualized kernel on bare hardware
[ 0.000000] setup_percpu: NR_CPUS:256 nr_cpumask_bits:256 nr_cpu_ids:1 nr_nod
e_ids:1
[ 0.000000] PERCPU: Embedded 27 pages/cpu @ffff88001f000000 s81024 r8192 d213
76 u2097152
[ 0.000000] Built 1 zonelists in Node order, mobility grouping on. Total pag
es: 125877
[ 0.000000] Policy zone: DMA32
[ 0.000000] Kernel command line: panic=1 console=ttyS0 udevtimeout=300 no_tim
er_check acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=
1 TERM=linux
[ 0.000000] Disabling memory control group subsystem
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Checking aperture...
[ 0.000000] No AGP bridge found
[ 0.000000] Memory: 487824k/511988k available (4873k kernel code, 460k absent
, 23704k reserved, 6776k data, 944k init)
[ 0.000000] SLUB: Genslabs=15, HWalign=64, Order=0-3, MinObjects=0, CPUs=1, N
--More--(2%)
.
.
.
libguestfs: recv_from_daemon: 8200 bytes: 00 00 00 00 | 00 00 20 00 | 00 00 00 0
0 | 00 00 00 00 | 00 00 00 00 | ...
libguestfs: recv_from_daemon: 8 bytes: 00 00 00 00 | 00 00 00 00 |
libguestfs: trace: download = 0
hivex_open: successfully read Windows Registry hive file:
pages: 1179 [sml: 4096, lge: 20480]
blocks: 80149 [sml: 8, avg: 65, lge: 16352]
blocks used: 77155
bytes used: 4254352
libguestfs: trace: list_devices
libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 07 | 00 00 00 00 | ...
guestfsd: main_loop: proc 67 (download) took 0.71 seconds
guestfsd: main_loop: new request, len 0x28
libguestfs: recv_from_daemon: 68 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 07
| 00 00 00 01 | 00 12 34 3e | ...
libguestfs: trace: list_devices = ["/dev/sda", "/dev/sdb"]
libguestfs: trace: pread_device "/dev/sda" 4 440
libguestfs: send_to_daemon: 68 bytes: 00 00 00 40 | 20 00 f5 f5 | 00 00 00 04 |
00 00 01 14 | 00 00 00 00 | ...
guestfsd: main_loop: proc 7 (list_devices) took 0.00 seconds
guestfsd: main_loop: new request, len 0x40
libguestfs: recv_from_daemon: 48 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 14
| 00 00 00 01 | 00 12 34 3f | ...
libguestfs: trace: pread_device = "c\xc0c\xc0"
libguestfs: trace: part_list "/dev/sda"
libguestfs: send_to_daemon: 56 bytes: 00 00 00 34 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 d5 | 00 00 00 00 | ...
guestfsd: main_loop: proc 276 (pread_device) took 0.00 seconds
guestfsd: main_loop: new request, len 0x34
parted -s -m /dev/null
parted -m -- /dev/sda unit b print
libguestfs: recv_from_daemon: 72 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 d5
| 00 00 00 01 | 00 12 34 40 | ...
libguestfs: trace: part_list = <struct guestfs_partition_list *>
libguestfs: trace: list_devices
libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 07 | 00 00 00 00 | ...
guestfsd: main_loop: proc 213 (part_list) took 0.12 seconds
guestfsd: main_loop: new request, len 0x28
libguestfs: recv_from_daemon: 68 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 07
| 00 00 00 01 | 00 12 34 41 | ...
libguestfs: trace: list_devices = ["/dev/sda", "/dev/sdb"]
libguestfs: trace: pread_device "/dev/sda" 4 440
libguestfs: send_to_daemon: 68 bytes: 00 00 00 40 | 20 00 f5 f5 | 00 00 00 04 |
00 00 01 14 | 00 00 00 00 | ...
guestfsd: main_loop: proc 7 (list_devices) took 0.00 seconds
guestfsd: main_loop: new request, len 0x40
libguestfs: recv_from_daemon: 48 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 14
| 00 00 00 01 | 00 12 34 42 | ...
libguestfs: trace: pread_device = "c\xc0c\xc0"
libguestfs: trace: pread_device "/dev/sdb" 4 440
libguestfs: send_to_daemon: 68 bytes: 00 00 00 40 | 20 00 f5 f5 | 00 00 00 04 |
00 00 01 14 | 00 00 00 00 | ...
guestfsd: main_loop: proc 276 (pread_device) took 0.00 seconds
guestfsd: main_loop: new request, len 0x40
libguestfs: recv_from_daemon: 48 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 14
| 00 00 00 01 | 00 12 34 43 | ...
libguestfs: trace: pread_device = "\x00\x00\x00\x00"
hivex_close
libguestfs: trace: umount_all
libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 2f | 00 00 00 00 | ...
guestfsd: main_loop: proc 276 (pread_device) took 0.00 seconds
guestfsd: main_loop: new request, len 0x28
umount /sysroot
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 2f
| 00 00 00 01 | 00 12 34 44 | ...
libguestfs: trace: umount_all = 0
libguestfs: trace: available "lvm2"
libguestfs: send_to_daemon: 56 bytes: 00 00 00 34 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 d8 | 00 00 00 00 | ...
guestfsd: main_loop: proc 47 (umount_all) took 0.35 seconds
guestfsd: main_loop: new request, len 0x34
guestfsd: main_loop: proc 216 (available) took 0.00 seconds
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 d8
| 00 00 00 01 | 00 12 34 45 | ...
libguestfs: trace: available = 0
libguestfs: trace: lvs
libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 0b | 00 00 00 00 | ...
guestfsd: main_loop: new request, len 0x28
lvm lvs -o vg_name,lv_name --noheadings --separator /
No volume groups found
libguestfs: recv_from_daemon: 44 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 0b
| 00 00 00 01 | 00 12 34 46 | ...
libguestfs: trace: lvs = []
libguestfs: trace: inspect_os = ["/dev/sda1"]
libguestfs: trace: inspect_get_mountpoints "/dev/sda1"
libguestfs: trace: inspect_get_mountpoints = ["/", "/dev/sda1"]
libguestfs: trace: mount_options "" "/dev/sda1" "/"
libguestfs: send_to_daemon: 72 bytes: 00 00 00 44 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 4a | 00 00 00 00 | ...
guestfsd: main_loop: proc 11 (lvs) took 0.05 seconds
guestfsd: main_loop: new request, len 0x44
mount -o /dev/sda1 /sysroot/
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 4a
| 00 00 00 01 | 00 12 34 47 | ...
libguestfs: trace: mount_options = 0
libguestfs: trace: mkdtemp "/transferXXXXXX"
libguestfs: send_to_daemon: 64 bytes: 00 00 00 3c | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 75 | 00 00 00 00 | ...
guestfsd: main_loop: proc 74 (mount_options) took 0.51 seconds
guestfsd: main_loop: new request, len 0x3c
libguestfs: recv_from_daemon: 60 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 75
| 00 00 00 01 | 00 12 34 48 | ...
libguestfs: trace: mkdtemp = "/transferZcKAPK"
libguestfs: trace: list_devices
libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 07 | 00 00 00 00 | ...
guestfsd: main_loop: proc 117 (mkdtemp) took 0.01 seconds
guestfsd: main_loop: new request, len 0x28
libguestfs: recv_from_daemon: 68 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 07
| 00 00 00 01 | 00 12 34 49 | ...
libguestfs: trace: list_devices = ["/dev/sda", "/dev/sdb"]
libguestfs: trace: mount_ro "/dev/sdb" "/transferZcKAPK"
libguestfs: send_to_daemon: 76 bytes: 00 00 00 48 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 49 | 00 00 00 00 | ...
guestfsd: main_loop: proc 7 (list_devices) took 0.00 seconds
guestfsd: main_loop: new request, len 0x48
mount -o ro /dev/sdb /sysroot/transferZcKAPK
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 49
| 00 00 00 01 | 00 12 34 4a | ...
libguestfs: trace: mount_ro = 0
libguestfs: trace: inspect_get_type "/dev/sda1"
libguestfs: trace: inspect_get_type = "windows"
libguestfs: trace: inspect_get_product_name "/dev/sda1"
libguestfs: trace: inspect_get_product_name = "Microsoft Windows Server 2003"
libguestfs: trace: inspect_get_major_version "/dev/sda1"
libguestfs: trace: inspect_get_major_version = 5
libguestfs: trace: inspect_get_minor_version "/dev/sda1"
libguestfs: trace: inspect_get_minor_version = 2
libguestfs: trace: inspect_get_arch "/dev/sda1"
libguestfs: trace: inspect_get_arch = "i386"
libguestfs: trace: exists "/transferZcKAPK//usr/share/virtio-win/drivers/i386/Wi
n2003"
libguestfs: send_to_daemon: 108 bytes: 00 00 00 68 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 24 | 00 00 00 00 | ...
guestfsd: main_loop: proc 73 (mount_ro) took 0.08 seconds
guestfsd: main_loop: new request, len 0x68
libguestfs: recv_from_daemon: 44 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 24
| 00 00 00 01 | 00 12 34 4b | ...
libguestfs: trace: exists = 1
libguestfs: trace: case_sensitive_path "/windows/system32/drivers"
libguestfs: send_to_daemon: 76 bytes: 00 00 00 48 | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 c5 | 00 00 00 00 | ...
guestfsd: main_loop: proc 36 (exists) took 0.00 seconds
guestfsd: main_loop: new request, len 0x48
guestfsd: error: windows: no file or directory found with this name
libguestfs: recv_from_daemon: 100 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 c5
| 00 00 00 01 | 00 12 34 4c | ...
libguestfs: trace: case_sensitive_path = NULL (error)
libguestfs: trace: umount "/transferZcKAPK"
libguestfs: send_to_daemon: 64 bytes: 00 00 00 3c | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 2d | 00 00 00 00 | ...
guestfsd: main_loop: proc 197 (case_sensitive_path) took 0.00 seconds
guestfsd: main_loop: new request, len 0x3c
umount /sysroot/transferZcKAPK
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 2d
| 00 00 00 01 | 00 12 34 4d | ...
libguestfs: trace: umount = 0
libguestfs: trace: rmdir "/transferZcKAPK"
libguestfs: send_to_daemon: 64 bytes: 00 00 00 3c | 20 00 f5 f5 | 00 00 00 04 |
00 00 00 1e | 00 00 00 00 | ...
guestfsd: main_loop: proc 45 (umount) took 0.07 seconds
guestfsd: main_loop: new request, len 0x3c
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 00 1e
| 00 00 00 01 | 00 12 34 4e | ...
libguestfs: trace: rmdir = 0
libguestfs: trace: close
libguestfs: closing guestfs handle 0x2e7b760 (state 2)
libguestfs: trace: internal_autosync
libguestfs: send_to_daemon: 44 bytes: 00 00 00 28 | 20 00 f5 f5 | 00 00 00 04 |
00 00 01 1a | 00 00 00 00 | ...
guestfsd: main_loop: proc 30 (rmdir) took 0.00 seconds
guestfsd: main_loop: new request, len 0x28
umount /sysroot
libguestfs: recv_from_daemon: 40 bytes: 20 00 f5 f5 | 00 00 00 04 | 00 00 01 1a
| 00 00 00 01 | 00 12 34 4f | ...
libguestfs: trace: internal_autosync = 0
libguestfs: trace: kill_subprocess
libguestfs: sending SIGTERM to process 1386
libguestfs: trace: kill_subprocess = 0
virt-v2v: Died at /usr/bin/virt-p2v-server line 390, <> line 7.
[root@Fedora16-64P2V log]#
12 years, 11 months
[hivex] [PATCH 1/1] hivexml: Change value type output to standard names
by Alex Nelson
Signed-off-by: Alex Nelson <ajnelson(a)cs.ucsc.edu>
---
xml/hivexml.c | 42 ++++++++++++++++++++++++++++++++++--------
1 files changed, 34 insertions(+), 8 deletions(-)
diff --git a/xml/hivexml.c b/xml/hivexml.c
index d38e9d4..1a75593 100644
--- a/xml/hivexml.c
+++ b/xml/hivexml.c
@@ -247,6 +247,32 @@ node_end (hive_h *h, void *writer_v, hive_node_h node, const char *name)
return 0;
}
+/*
+ * Hive type names retrieved from:
+ * https://secure.wikimedia.org/wikipedia/en/wiki/Windows_Registry#Keys_and_...
+ * (Retrieved 2011-10-09)
+ * Caller should not free return value.
+ */
+static char *
+value_type_windows_string (hive_type t)
+{
+ switch (t) {
+ case 0: return "REG_NONE"; break;
+ case 1: return "REG_SZ"; break;
+ case 2: return "REG_EXPAND_SZ"; break;
+ case 3: return "REG_BINARY"; break;
+ case 4: return "REG_DWORD_LITTLE_ENDIAN"; break;
+ case 5: return "REG_DWORD_BIG_ENDIAN"; break;
+ case 6: return "REG_LINK"; break;
+ case 7: return "REG_MULTI_SZ"; break;
+ case 8: return "REG_RESOURCE_LIST"; break;
+ case 9: return "REG_FULL_RESOURCE_DESCRIPTOR"; break;
+ case 10: return "REG_RESOURCE_REQUIREMENTS_LIST"; break;
+ case 11: return "REG_QWORD"; break;
+ default: return "unknown"; break;
+ }
+}
+
static void
start_value (xmlTextWriterPtr writer,
const char *key, const char *type, const char *encoding)
@@ -294,7 +320,7 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value,
type = "unknown";
}
- start_value (writer, key, type, NULL);
+ start_value (writer, key, value_type_windows_string (t), NULL);
XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value"));
XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str));
XML_CHECK (xmlTextWriterEndAttribute, (writer));
@@ -308,7 +334,7 @@ value_multiple_strings (hive_h *h, void *writer_v, hive_node_h node,
const char *key, char **argv)
{
xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v;
- start_value (writer, key, "string-list", NULL);
+ start_value (writer, key, value_type_windows_string (t), NULL);
size_t i;
for (i = 0; argv[i] != NULL; ++i) {
@@ -350,7 +376,7 @@ value_string_invalid_utf16 (hive_h *h, void *writer_v, hive_node_h node,
type = "unknown";
}
- start_value (writer, key, type, "base64");
+ start_value (writer, key, value_type_windows_string (t), "base64");
XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value"));
XML_CHECK (xmlTextWriterWriteBase64, (writer, str, 0, len));
XML_CHECK (xmlTextWriterEndAttribute, (writer));
@@ -364,7 +390,7 @@ value_dword (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value,
hive_type t, size_t len, const char *key, int32_t v)
{
xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v;
- start_value (writer, key, "int32", NULL);
+ start_value (writer, key, value_type_windows_string (t), NULL);
XML_CHECK (xmlTextWriterWriteFormatAttribute, (writer, BAD_CAST "value", "%" PRIi32, v));
end_value (writer);
return 0;
@@ -375,7 +401,7 @@ value_qword (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value,
hive_type t, size_t len, const char *key, int64_t v)
{
xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v;
- start_value (writer, key, "int64", NULL);
+ start_value (writer, key, value_type_windows_string (t), NULL);
XML_CHECK (xmlTextWriterWriteFormatAttribute, (writer, BAD_CAST "value", "%" PRIi64, v));
end_value (writer);
return 0;
@@ -386,7 +412,7 @@ value_binary (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value,
hive_type t, size_t len, const char *key, const char *v)
{
xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v;
- start_value (writer, key, "binary", "base64");
+ start_value (writer, key, value_type_windows_string (t), "base64");
XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value"));
XML_CHECK (xmlTextWriterWriteBase64, (writer, v, 0, len));
XML_CHECK (xmlTextWriterEndAttribute, (writer));
@@ -399,7 +425,7 @@ value_none (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value,
hive_type t, size_t len, const char *key, const char *v)
{
xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v;
- start_value (writer, key, "none", "base64");
+ start_value (writer, key, value_type_windows_string (t), "base64");
if (len > 0) {
XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value"));
XML_CHECK (xmlTextWriterWriteBase64, (writer, v, 0, len));
@@ -436,7 +462,7 @@ value_other (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value,
type = "unknown";
}
- start_value (writer, key, type, "base64");
+ start_value (writer, key, value_type_windows_string (t), "base64");
if (len > 0) {
XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value"));
XML_CHECK (xmlTextWriterWriteBase64, (writer, v, 0, len));
--
1.7.6.4
12 years, 11 months
[hivex] [PATCH 0/1] hivexml: Revise type names in output
by Alex Nelson
This patch revises the value type information printed. It is also
somewhat a test of how open to revision the output of a program is
according to RedHat's policies, of which I am not very aware beyond
strongly guaranteeing ABI compatability.
Alex Nelson (1):
Change value type output to standard names
xml/hivexml.c | 42 ++++++++++++++++++++++++++++++++++--------
1 files changed, 34 insertions(+), 8 deletions(-)
--
1.7.6.4
12 years, 11 months
[hivex] [PATCH 2/2] hivex: Expose embedded hive file name
by Alex Nelson
Signed-off-by: Alex Nelson <ajnelson(a)cs.ucsc.edu>
---
generator/generator.ml | 6 ++++++
lib/hivex.c | 6 ++++++
xml/hivexml.c | 9 +++++++++
3 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/generator/generator.ml b/generator/generator.ml
index fc7b483..9e53f4e 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -159,6 +159,12 @@ but instead are lost. See L<hivex(3)/WRITING TO HIVE FILES>.";
"\
Return root node of the hive. All valid hives must contain a root node.";
+ "name", (RString, [AHive]),
+ "return the name stored in the hive header",
+ "\
+Return hive file name stored in the hive header, null on error. Caller
+is responsible for freeing returned string.";
+
"major_version", (RInt32, [AHive]),
"return the major version of the hive",
"\
diff --git a/lib/hivex.c b/lib/hivex.c
index 455202f..11468f9 100644
--- a/lib/hivex.c
+++ b/lib/hivex.c
@@ -634,6 +634,12 @@ hivex_last_modified (hive_h *h)
return timestamp_check (h, 0, h->last_modified);
}
+char *
+hivex_name (hive_h *h)
+{
+ return (h && h->hdr) ? windows_utf16_to_utf8 (h->hdr->name, 64) : NULL;
+}
+
int32_t
hivex_major_version (hive_h *h)
{
diff --git a/xml/hivexml.c b/xml/hivexml.c
index 3a4d9b7..059da56 100644
--- a/xml/hivexml.c
+++ b/xml/hivexml.c
@@ -160,6 +160,15 @@ main (int argc, char *argv[])
}
}
+ char *hive_name = hivex_name (h);
+ if (hive_name) {
+ XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "name"));
+ XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST hive_name));
+ XML_CHECK (xmlTextWriterEndAttribute, (writer));
+ free (hive_name);
+ hive_name = NULL;
+ }
+
int64_t hive_mtime = hivex_last_modified (h);
if (hive_mtime >= 0) {
char *timebuf = filetime_to_8601 (hive_mtime);
--
1.7.6.4
12 years, 11 months