[PATCH] inspection: Fix fstab device mapping for >26 disks
by Matthew Booth
The regular expression matching disk name assumed that there was only a single
letter suffix. This change handles a naming scheme for any number of disks.
---
src/inspect_fs_unix.c | 51 +++++++++++++++++++++++++++++-------------------
1 files changed, 31 insertions(+), 20 deletions(-)
12 years, 12 months
Libguestfs & ubuntu 11.10 problems
by KoDer
HI, All.
I face problems when try to use libguestfs in new ubuntu 11.10.
1) My current version of libguest (1.12.0, binaries taken from
libguestfs site) can't boot vm with new kernel.
You can find log of libguest-test-tool in attachment. I try force
it to boot 2.6.38-11 kernel instead of
3.0.0-12 (which is default), but get the same result (error)
2) I can't compile libguestfs from sources:
make libguestfs-1.12.7 leads to:
.........
CC libguestfs_la-virt.lo
In file included from virt.c:38:0:
guestfs.h:1737:51: error: unknown type name 'virDomainPtr'
make[3]: *** [libguestfs_la-virt.lo] Error 1
make[3]: Leaving directory `/home/koder/tmp/libguestfs-1.12.7/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/koder/tmp/libguestfs-1.12.7/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/koder/tmp/libguestfs-1.12.7'
make: *** [all] Error 2
make libguestfs-1.13.21 leads to:
....
CCLD create_disk
../src/.libs/libguestfs.so: undefined reference to
`guestfs___case_sensitive_path_silently'
../src/.libs/libguestfs.so: undefined reference to `guestfs___search_for_root'
../src/.libs/libguestfs.so: undefined reference to `guestfs___download_to_tmp'
collect2: ld returned 1 exit status
make[2]: *** [create_disk] Error 1
make[2]: Leaving directory `/home/koder/tmp/libguestfs-1.13.21/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/koder/tmp/libguestfs-1.13.21'
make: *** [all] Error 2
System info:
koder@koder-laptop:~/tmp/libguestfs-1.13.21$ virsh --version
0.9.2
koder@koder-laptop:~/tmp/libguestfs-1.13.21$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.1-9ubuntu3'
--with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
koder@koder-laptop:~/tmp/libguestfs-1.13.21$ uname -a
Linux koder-laptop 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25
UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
Both versions of libguestfs configured with:
./configure --disable-ocaml --disable-perl --disable-ruby
--disable-haskell --disable-php --with-java-home=no
Thanks
--
K.Danilov aka koder
ICQ:214286120
Skype:koder.ua
Tel:+38-050-4030512
12 years, 12 months
[PATCH 1/5] launch: Store drive information in guestfs_h
by Matthew Booth
This is a NFC on its own, but provides a place-holder for drive metadata which
can be used after launch.
---
src/guestfs-internal.h | 17 +++++++-
src/guestfs.c | 20 +++++++++
src/launch.c | 104 +++++++++++++++++++++++++++---------------------
src/virt.c | 4 +-
4 files changed, 96 insertions(+), 49 deletions(-)
12 years, 12 months
[PATCH 1/9] Partially fix --disable-erlang
by misc@zarb.org
From: Michael Scherer <misc(a)zarb.org>
Without this, configure will always enable erlang, no matter what
argument are passed. Now, we can disable it, even if configure still
need the erlang compiler for some obscure reason.
---
configure.ac | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/configure.ac b/configure.ac
index 337a3ed..e0bed2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -892,12 +892,14 @@ AS_IF([test "x$enable_php" != "xno"],
AM_CONDITIONAL([HAVE_PHP], [test "x$PHP" != "xno" && test "x$PHPIZE" != "xno"])
dnl Erlang
+ERLANG=no
AC_ARG_ENABLE([erlang],
- AS_HELP_STRING([--disable-erlang], [Disable Erlang language bindings]),
- [],
- [enable_erlang=yes])
+ AS_HELP_STRING([--disable-erlang], [Disable Erlang language bindings]),
+ [],
+ [enable_erlang=yes])
AS_IF([test "x$enable_erlang" != "xno"],
[
+ ERLANG=
AC_ERLANG_PATH_ERLC([no])
if test "x$ERLC" != "xno"; then
@@ -906,7 +908,7 @@ AS_IF([test "x$enable_erlang" != "xno"],
AC_ERLANG_SUBST_LIB_DIR
fi
])
-AM_CONDITIONAL([HAVE_ERLANG], [test "x$ERLC" != "xno"])
+AM_CONDITIONAL([HAVE_ERLANG], [test "x$ERLANG" != "xno" && test "x$ERLC" != "xno"])
dnl Check for Perl modules needed by Perl virt tools (virt-df, etc.)
AS_IF([test "x$PERL" != "xno"],
--
1.7.1
12 years, 12 months
[PATCH 3/7] generator: Add new return types to ABI: RLenNode and RLenValue
by Alex Nelson
RLenNode and RLenValue are similar to RLenType, though with one less
argument. This required adding one processing function for OCaml and
Python.
Signed-off-by: Alex Nelson <ajnelson(a)cs.ucsc.edu>
---
generator/generator.ml | 114 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 114 insertions(+), 0 deletions(-)
diff --git a/generator/generator.ml b/generator/generator.ml
index 48b6e3a..15ebc44 100755
--- a/generator/generator.ml
+++ b/generator/generator.ml
@@ -49,8 +49,10 @@ and ret =
| RNode (* Returns hive_node_h or 0. *)
| RNodeNotFound (* See hivex_node_get_child. *)
| RNodeList (* Returns hive_node_h* or NULL. *)
+ | RLenNode (* See node_struct_length. *)
| RValue (* Returns hive_value_h or 0. *)
| RValueList (* Returns hive_value_h* or NULL. *)
+ | RLenValue (* See value_struct_length. *)
| RString (* Returns char* or NULL. *)
| RStringList (* Returns char** or NULL. *)
| RLenType (* See hivex_value_type. *)
@@ -878,6 +880,8 @@ and generate_c_prototype ?(extern = false) name style =
| RValueList -> pr "hive_value_h *"
| RString -> pr "char *"
| RStringList -> pr "char **"
+ | RLenNode -> pr "hive_node_h "
+ | RLenValue -> pr "hive_value_h "
| RLenType -> pr "int "
| RLenTypeVal -> pr "char *"
| RInt32 -> pr "int32_t "
@@ -899,6 +903,8 @@ and generate_c_prototype ?(extern = false) name style =
) (snd style);
(match fst style with
| RLenType | RLenTypeVal -> pr ", hive_type *t, size_t *len"
+ | RLenNode -> pr ", size_t *len"
+ | RLenValue -> pr ", size_t *len"
| _ -> ()
);
pr ");\n"
@@ -1101,6 +1107,14 @@ On error this returns NULL and sets errno.\n\n"
pr "\
Returns 0 on success.
On error this returns -1 and sets errno.\n\n"
+ | RLenNode ->
+ pr "\
+Returns a positive number on success.
+On error this returns 0 and sets errno.\n\n"
+ | RLenValue ->
+ pr "\
+Returns a positive number on success.
+On error this returns 0 and sets errno.\n\n"
| RLenTypeVal ->
pr "\
The value is returned as an array of bytes (of length C<len>).
@@ -1612,6 +1626,8 @@ and generate_ocaml_prototype ?(is_external = false) name style =
| RString -> pr "string"
| RStringList -> pr "string array"
| RLenType -> pr "hive_type * int"
+ | RLenNode -> pr "node"
+ | RLenValue -> pr "value"
| RLenTypeVal -> pr "hive_type * string"
| RInt32 -> pr "int32"
| RInt64 -> pr "int64"
@@ -1697,6 +1713,8 @@ static void raise_closed (const char *) Noreturn;
let c_params =
match fst style with
| RLenType | RLenTypeVal -> c_params @ [["&t"; "&len"]]
+ | RLenNode -> c_params @ [["&len"]]
+ | RLenValue -> c_params @ [["&len"]]
| _ -> c_params in
let c_params = List.concat c_params in
@@ -1769,6 +1787,14 @@ static void raise_closed (const char *) Noreturn;
pr " size_t len;\n";
pr " hive_type t;\n";
"-1"
+ | RLenNode ->
+ pr " int r;\n";
+ pr " size_t len;\n";
+ "0"
+ | RLenValue ->
+ pr " int r;\n";
+ pr " size_t len;\n";
+ "0"
| RLenTypeVal ->
pr " char *r;\n";
pr " size_t len;\n";
@@ -1849,6 +1875,8 @@ static void raise_closed (const char *) Noreturn;
pr " for (int i = 0; r[i] != NULL; ++i) free (r[i]);\n";
pr " free (r);\n"
| RLenType -> pr " rv = copy_type_len (len, t);\n"
+ | RLenNode -> pr " rv = copy_len (len);\n"
+ | RLenValue -> pr " rv = copy_len (len);\n"
| RLenTypeVal ->
pr " rv = copy_type_value (r, len, t);\n";
pr " free (r);\n"
@@ -1971,6 +1999,18 @@ copy_type_len (size_t len, hive_type t)
}
static value
+copy_type (size_t len, hive_type t)
+{
+ CAMLparam0 ();
+ CAMLlocal2 (v, rv);
+
+ rv = caml_alloc (1, 0);
+ v = Val_int (len);
+ Store_field (rv, 0, v);
+ CAMLreturn (rv);
+}
+
+static value
copy_type_value (const char *r, size_t len, hive_type t)
{
CAMLparam0 ();
@@ -2160,6 +2200,8 @@ sub open {
| RString
| RStringList
| RLenType
+ | RLenNode
+ | RLenValue
| RLenTypeVal
| RInt32
| RInt64 -> ()
@@ -2234,6 +2276,8 @@ and generate_perl_prototype name style =
| RString -> pr "$string = "
| RStringList -> pr "@strings = "
| RLenType -> pr "($type, $len) = "
+ | RLenNode -> pr "($len) = "
+ | RLenValue -> pr "($len) = "
| RLenTypeVal -> pr "($type, $data) = "
| RInt32 -> pr "$int32 = "
| RInt64 -> pr "$int64 = "
@@ -2457,6 +2501,8 @@ DESTROY (h)
| RValueList
| RStringList
| RLenType
+ | RLenNode
+ | RLenValue
| RLenTypeVal -> pr "void\n"
| RInt32 -> pr "SV *\n"
| RInt64 -> pr "SV *\n"
@@ -2629,6 +2675,34 @@ DESTROY (h)
pr " PUSHs (sv_2mortal (newSViv (type)));\n";
pr " PUSHs (sv_2mortal (newSViv (len)));\n";
+ | RLenNode ->
+ pr "PREINIT:\n";
+ pr " int r;\n";
+ pr " size_t len;\n";
+ pr " PPCODE:\n";
+ pr " r = hivex_%s (%s, &len);\n"
+ name (String.concat ", " c_params);
+ free_args ();
+ pr " if (r == 0)\n";
+ pr " croak (\"%%s: \", \"%s\", strerror (errno));\n"
+ name;
+ pr " EXTEND (SP, 2);\n";
+ pr " PUSHs (sv_2mortal (newSViv (len)));\n";
+
+ | RLenValue ->
+ pr "PREINIT:\n";
+ pr " int r;\n";
+ pr " size_t len;\n";
+ pr " PPCODE:\n";
+ pr " r = hivex_%s (%s, &len);\n"
+ name (String.concat ", " c_params);
+ free_args ();
+ pr " if (r == 0)\n";
+ pr " croak (\"%%s: \", \"%s\", strerror (errno));\n"
+ name;
+ pr " EXTEND (SP, 2);\n";
+ pr " PUSHs (sv_2mortal (newSViv (len)));\n";
+
| RLenTypeVal ->
pr "PREINIT:\n";
pr " char *r;\n";
@@ -2867,6 +2941,14 @@ put_len_type (size_t len, hive_type t)
}
static PyObject *
+put_len (size_t len)
+{
+ PyObject *r = PyTuple_New (1);
+ PyTuple_SetItem (r, 0, PyLong_FromLongLong ((long) len));
+ return r;
+}
+
+static PyObject *
put_val_type (char *val, size_t len, hive_type t)
{
PyObject *r = PyTuple_New (2);
@@ -2906,6 +2988,14 @@ put_val_type (char *val, size_t len, hive_type t)
pr " size_t len;\n";
pr " hive_type t;\n";
"-1"
+ | RLenNode ->
+ pr " int r;\n";
+ pr " size_t len;\n";
+ "0"
+ | RLenValue ->
+ pr " int r;\n";
+ pr " size_t len;\n";
+ "0"
| RLenTypeVal ->
pr " char *r;\n";
pr " size_t len;\n";
@@ -2930,6 +3020,7 @@ put_val_type (char *val, size_t len, hive_type t)
let c_params =
match fst style with
| RLenType | RLenTypeVal -> c_params @ ["&t"; "&len"]
+ | RLenNode | RLenValue -> c_params @ ["&len"]
| _ -> c_params in
List.iter (
@@ -3074,6 +3165,10 @@ put_val_type (char *val, size_t len, hive_type t)
pr " free_strings (r);\n"
| RLenType ->
pr " py_r = put_len_type (len, t);\n"
+ | RLenNode ->
+ pr " py_r = put_len (len);\n"
+ | RLenValue ->
+ pr " py_r = put_len (len);\n"
| RLenTypeVal ->
pr " py_r = put_val_type (r, len, t);\n";
pr " free (r);\n"
@@ -3284,6 +3379,8 @@ get_values (VALUE valuesv, size_t *nr_values)
| RString -> "string"
| RStringList -> "list"
| RLenType -> "hash"
+ | RLenNode -> "integer"
+ | RLenValue -> "integer"
| RLenTypeVal -> "hash"
| RInt32 -> "integer"
| RInt64 -> "integer" in
@@ -3382,6 +3479,14 @@ get_values (VALUE valuesv, size_t *nr_values)
pr " size_t len;\n";
pr " hive_type t;\n";
"-1"
+ | RLenNode ->
+ pr " int r;\n";
+ pr " size_t len;\n";
+ "0"
+ | RLenValue ->
+ pr " int r;\n";
+ pr " size_t len;\n";
+ "0"
| RLenTypeVal ->
pr " char *r;\n";
pr " size_t len;\n";
@@ -3406,6 +3511,7 @@ get_values (VALUE valuesv, size_t *nr_values)
let c_params =
match ret with
| RLenType | RLenTypeVal -> c_params @ [["&t"; "&len"]]
+ | RLenNode | RLenValue -> c_params @ [["&len"]]
| _ -> c_params in
let c_params = List.concat c_params in
@@ -3487,6 +3593,14 @@ get_values (VALUE valuesv, size_t *nr_values)
pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n";
pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"type\")), INT2NUM (t));\n";
pr " return rv;\n"
+ | RLenNode ->
+ pr " VALUE rv = rb_hash_new ();\n";
+ pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n";
+ pr " return rv;\n"
+ | RLenValue ->
+ pr " VALUE rv = rb_hash_new ();\n";
+ pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n";
+ pr " return rv;\n"
| RLenTypeVal ->
pr " VALUE rv = rb_hash_new ();\n";
pr " rb_hash_aset (rv, ID2SYM (rb_intern (\"len\")), INT2NUM (len));\n";
--
1.7.6
13 years
Child process died
by vipul borikar
Hello,
I have installed libguestfs on RHEL 5.5 64 bit. 3 packages i
have installed.
libguestfs-tools-c-1.9.10-1.1
libguestfs-tools-1.9.10-1.1
libguestfs-1.9.10-1.1
When i am trying to run virt-resize it gives me error:
virt-resize -expand /dev/sda1 vm01.scilab vm01.scilab-15GB -d
libguestfs: trace: add_drive_opts "vm01.scilab" "readonly:true"
libguestfs: trace: add_drive_opts = 0
libguestfs: trace: add_drive_opts "vm01.scilab-15GB"
libguestfs: trace: add_drive_opts = 0
libguestfs: trace: launch
sh: /home/rjones/d/qemu/qemu-wrapper: No such file or directory
/home/rjones/d/qemu/qemu-wrapper: No such file or directory
libguestfs: trace: launch = -1 (error)
child process died unexpectedly at /usr/bin/virt-resize line 602.
Same is happening for virt-list-partions
virt-list-partitions vm01.scilab
sh: /home/rjones/d/qemu/qemu-wrapper: No such file or directory
/home/rjones/d/qemu/qemu-wrapper: No such file or directory
child process died unexpectedly at /usr/bin/virt-list-partitions line 162.*
*
Any Cluess???
--
Thanks
Vipul Borikar
"Our task must be to free ourselves...by widening our circle of compassion
to embrace all living creatures and the whole of nature and its beauty."
13 years
guestmount issues with --live, but guestfish works just fine
by Adam Miller
Hello all,
I am having an issue with guestmount in respect to live instances
and I was hoping someone might have an idea where I've gone wrong. The
following output is from my shell session, if there's any more
information needed please let me know and I'll happily provide it.
[root@longitude ~]# virt-filesystems -d F16-rawhide/dev/sda2
/dev/sda3
[root@longitude ~]# guestmount --live -d F16-rawhide -m /dev/sda3:/
/mnt/guestfs/
libguestfs: error: mount_options: /dev/vda3 on /: mount: /dev/vda3
already mounted or / busy
mount: according to mtab, /dev/vda3 is already mounted on /
libguestfs: error: part_to_dev: part_to_dev_stub: /dev/vda3: device not
found
libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x34 from
daemon, expected 0xffffeeee
guestmount: '/dev/sda3' could not be mounted. Did you mean one of
these?
/dev/vda1 (unknown)
/dev/vda2 (unknown)
/dev/vda3 (unknown)
/dev/vda4 (unknown)
libguestfs: error: check_for_daemon_cancellation_or_eof: read 0x0 from
daemon, expected 0xffffeeee
[root@longitude ~]# guestmount --live -d F16-rawhide -m /dev/vda3:/
/mnt/guestfs/
libguestfs: error: mount_options: mount_options_stub: /dev/vda3: device
not found
libguestfs: error: unexpected procedure number (74/7)
libguestfs: error: unexpected procedure number (7/282)
[root@longitude ~]# guestmount --live -d F16-rawhide -m /dev/vda3:/ -v
/mnt/guestfs/
libguestfs: [00000ms] connecting to
/var/lib/libvirt/qemu/F16-rawhide.libguestfs
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 02 | ...
libguestfs: error: guestfs_launch failed, unexpected initial message
from guestfsd
libguestfs: closing guestfs handle 0x1191760 (state 1)
libguestfs: sending SIGTERM to process 0
[root@longitude ~]# guestmount --live -d F16-rawhide -m /dev/vda3:/ -v
-x /mnt/guestfs/
libguestfs: trace: set_recovery_proc true
libguestfs: trace: set_recovery_proc = 0
libguestfs: trace: add_domain "F16-rawhide" "live:true"
libguestfs: trace: set_attach_method
"unix:/var/lib/libvirt/qemu/F16-rawhide.libguestfs"
libguestfs: trace: set_attach_method = 0
libguestfs: trace: add_domain = 0
libguestfs: trace: launch
libguestfs: [00000ms] connecting to
/var/lib/libvirt/qemu/F16-rawhide.libguestfs
libguestfs: recv_from_daemon: received GUESTFS_LAUNCH_FLAG
libguestfs: [00000ms] connected
libguestfs: trace: launch = 0
libguestfs: trace: mount_options "" "/dev/vda3" "/"
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 | ...
libguestfs: recv_from_daemon: 96 bytes: 20 00 f5 f5 | 00 00 00 04 | 00
00 00 4a | 00 00 00 01 | 00 12 34 00 | ...
libguestfs: trace: mount_options = -1 (error)
libguestfs: error: mount_options: mount_options_stub: /dev/vda3: device
not found
libguestfs: trace: list_filesystems
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 | ...
libguestfs: recv_from_daemon: 168 bytes: 20 00 f5 f5 | 00 00 00 04 | 00
00 00 4a | 00 00 00 01 | 00 12 34 00 | ...
libguestfs: error: unexpected procedure number (74/7)
libguestfs: trace: list_devices = NULL (error)
libguestfs: trace: list_filesystems = NULL (error)
libguestfs: closing guestfs handle 0x6e8760 (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 | ...
libguestfs: recv_from_daemon: 56 bytes: 20 00 f5 f5 | 00 00 00 04 | 00
00 00 07 | 00 00 00 01 | 00 12 34 01 | ...
libguestfs: error: unexpected procedure number (7/282)
libguestfs: trace: internal_autosync = -1 (error)
libguestfs: trace: kill_subprocess
libguestfs: sending SIGTERM to process 0
libguestfs: trace: kill_subprocess = 0
[root@longitude ~]# guestfish --live -d F16-rawhide
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.
Type: 'help' for help on commands
'man' to read the manual
'quit' to quit the shell
><fs> run
><fs> ls /
bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
><fs>
Many thanks!
-AdamM
13 years
Man pages for virt-p2v-server?
by Greg Scott
I just installed virt-v2v 0.8.3.1 on a Fedora 14 VM and was getting
ready to set up a P2V migration. But the virt-p2v-server man pages only
tell me about the GPL and that's it. Is the documentation for that
.conf file someplace else now? Or don't I need it anymore?
Thanks
- Greg Scott
13 years