Re: [Libguestfs] libguestfs powerpc package
by Richard W.M. Jones
[Please keep message on the list]
On Mon, Sep 30, 2013 at 12:58:38AM +0200, Roberto Innocenti wrote:
> [libguestfs on ppc]
You should be able to compile from the latest source on ppc64, since I
spent some time a few weeks ago getting it to work:
http://comments.gmane.org/gmane.linux.redhat.fedora.virtualization/2268
Start with git (not 1.22), read the README file, and let us know on
the mailing list what precise errors you get when you try to compile it.
Note you'll require the latest supermin (from git) first, and qemu
from git, and IIRC there was an endianness bug in hivex too which is
fixed in git. The latest hivex isn't required unless you're doing
Widows guest inspection.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW
10 years, 7 months
enable build for ocaml bytecode
by Olaf Hering
This is a first attempt to build libguestfs with just a ocaml bytecode
compiler. The three tools written in ocaml will be build only when an
ocamlopt compiler is available.
Olaf
---
Makefile.am | 5 ++++-
configure.ac | 2 ++
ocaml/Makefile.am | 20 +++++++++++++++++---
resize/Makefile.am | 2 +-
sparsify/Makefile.am | 2 +-
sysprep/Makefile.am | 2 +-
6 files changed, 26 insertions(+), 7 deletions(-)
Index: libguestfs-1.20.1/Makefile.am
===================================================================
--- libguestfs-1.20.1.orig/Makefile.am
+++ libguestfs-1.20.1/Makefile.am
@@ -74,7 +74,10 @@ if HAVE_PERL
SUBDIRS += perl perl/examples
endif
if HAVE_OCAML
-SUBDIRS += ocaml ocaml/examples
+SUBDIRS += ocaml
+endif
+if HAVE_OCAMLOPT
+SUBDIRS += ocaml/examples
endif
if HAVE_PYTHON
SUBDIRS += python python/examples
Index: libguestfs-1.20.1/configure.ac
===================================================================
--- libguestfs-1.20.1.orig/configure.ac
+++ libguestfs-1.20.1/configure.ac
@@ -865,6 +865,8 @@ AS_IF([test "x$enable_ocaml" != "xno"],
])
AM_CONDITIONAL([HAVE_OCAML],
[test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno"])
+AM_CONDITIONAL([HAVE_OCAMLOPT],
+ [test "x$OCAMLOPT" != "xno" && test "x$OCAMLC" != "xno" && test "x$OCAMLFIND" != "xno"])
AM_CONDITIONAL([HAVE_OCAMLDOC],
[test "x$OCAMLDOC" != "xno"])
Index: libguestfs-1.20.1/ocaml/Makefile.am
===================================================================
--- libguestfs-1.20.1.orig/ocaml/Makefile.am
+++ libguestfs-1.20.1/ocaml/Makefile.am
@@ -43,10 +43,20 @@ CLEANFILES += t/*.cmi t/*.cmo t/*.cmx t/
if HAVE_OCAML
+DATA_HOOK_FILES = META *.so *.a *.cma \
+ *.cmi $(srcdir)/*.mli
+if HAVE_OCAMLOPT
+DATA_HOOK_FILES += *.cmx *.cmxa
+endif
+
OCAMLCFLAGS = -g -warn-error CDEFLMPSUVYZX
OCAMLOPTFLAGS = $(OCAMLCFLAGS)
-noinst_DATA = mlguestfs.cma mlguestfs.cmxa META
+noinst_DATA = mlguestfs.cma
+if HAVE_OCAMLOPT
+noinst_DATA += mlguestfs.cmxa
+endif
+noinst_DATA += META
# Build the C part into a library, so that automake handles the C
# compilation step for us. Note that we don't directly use this
@@ -101,9 +111,13 @@ TESTS = run-bindtests \
$(patsubst %,%.opt,$(test_progs)))
noinst_DATA += \
- bindtests.bc bindtests.opt \
+ bindtests.bc
+if HAVE_OCAMLOPT
+noinst_DATA += \
+ bindtests.opt \
$(test_progs:%=%.bc) \
$(test_progs:%=%.opt)
+endif
bindtests.bc: bindtests.cmo mlguestfs.cma
mkdir -p t
@@ -217,7 +231,7 @@ install-data-hook:
$(OCAMLFIND) install \
-ldconf ignore -destdir $(DESTDIR)$(OCAMLLIB) \
guestfs \
- META *.so *.a *.cma *.cmx *.cmxa *.cmi $(srcdir)/*.mli
+ $(DATA_HOOK_FILES)
rm $(DESTDIR)$(OCAMLLIB)/guestfs/bindtests.*
rm $(DESTDIR)$(OCAMLLIB)/guestfs/libguestfsocaml.a
Index: libguestfs-1.20.1/resize/Makefile.am
===================================================================
--- libguestfs-1.20.1.orig/resize/Makefile.am
+++ libguestfs-1.20.1/resize/Makefile.am
@@ -40,7 +40,7 @@ SOURCES = \
resize_utils.ml \
resize_utils_tests.ml
-if HAVE_OCAML
+if HAVE_OCAMLOPT
# Note this list must be in dependency order.
OBJECTS = \
Index: libguestfs-1.20.1/sparsify/Makefile.am
===================================================================
--- libguestfs-1.20.1.orig/sparsify/Makefile.am
+++ libguestfs-1.20.1/sparsify/Makefile.am
@@ -36,7 +36,7 @@ SOURCES = \
sparsify_gettext.ml \
sparsify_utils.ml
-if HAVE_OCAML
+if HAVE_OCAMLOPT
# Note this list must be in dependency order.
OBJECTS = \
Index: libguestfs-1.20.1/sysprep/Makefile.am
===================================================================
--- libguestfs-1.20.1.orig/sysprep/Makefile.am
+++ libguestfs-1.20.1/sysprep/Makefile.am
@@ -86,7 +86,7 @@ SOURCES = \
utils.ml \
utils.mli
-if HAVE_OCAML
+if HAVE_OCAMLOPT
# Note this list must be in dependency order.
OBJECTS = \
10 years, 9 months
[PATCH] sysprep: handle distro specific sysv scripts
by Olaf Hering
Currently firstboot would only work on redhat-based images.
Handle redhat-based, suse-based and debian guests, error out in case of an
unknown distro.
Update firstboot.sh:
- make sure scripts exists and can be executed
- add LSB header to avoid insserv warnings later on
- run script only if called with "start"
Update functions, pass only required options.
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
diff --git a/sysprep/firstboot.ml b/sysprep/firstboot.ml
index 97cd8a9..c5296a1 100644
--- a/sysprep/firstboot.ml
+++ b/sysprep/firstboot.ml
@@ -28,14 +28,35 @@ let firstboot_dir = "/usr/lib/virt-sysprep"
let firstboot_sh = sprintf "\
#!/bin/sh -
+### BEGIN INIT INFO
+# Provides: virt-sysprep
+# Required-Start: $null
+# Should-Start: $all
+# Required-Stop: $null
+# Should-Stop: $all
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 6
+# Short-Description: Start scripts to run once at next boot
+# Description: Start scripts to run once at next boot
+# These scripts run the first time the guest boots,
+# and then are deleted. Output or errors from the scripts
+# are written to ~root/virt-sysprep-firstboot.log.
+### END INIT INFO
+
d=%s/scripts
logfile=~root/virt-sysprep-firstboot.log
-for f in $d/* ; do
- echo '=== Running' $f '===' >>$logfile
- $f >>$logfile 2>&1
- rm $f
-done
+if test \"$1\" = \"start\"
+then
+ for f in $d/* ; do
+ if test -x \"$f\"
+ then
+ echo '=== Running' $f '===' >>$logfile
+ $f >>$logfile 2>&1
+ rm -f $f
+ fi
+ done
+fi
" firstboot_dir
let firstboot_service = sprintf "\
@@ -56,7 +77,7 @@ WantedBy=default.target
let failed fs =
ksprintf (fun msg -> failwith (s_"firstboot: failed: " ^ msg)) fs
-let rec install_service g root =
+let rec install_service g distro =
g#mkdir_p firstboot_dir;
g#mkdir_p (sprintf "%s/scripts" firstboot_dir);
g#write (sprintf "%s/firstboot.sh" firstboot_dir) firstboot_sh;
@@ -64,18 +85,18 @@ let rec install_service g root =
(* systemd, else assume sysvinit *)
if g#is_dir "/etc/systemd" then
- install_systemd_service g root
+ install_systemd_service g
else
- install_sysvinit_service g root
+ install_sysvinit_service g distro
(* Install the systemd firstboot service, if not installed already. *)
-and install_systemd_service g root =
+and install_systemd_service g =
g#write (sprintf "%s/firstboot.service" firstboot_dir) firstboot_service;
g#mkdir_p "/etc/systemd/system/default.target.wants";
g#ln_sf (sprintf "%s/firstboot.service" firstboot_dir)
"/etc/systemd/system/default.target.wants"
-and install_sysvinit_service g root =
+and install_sysvinit_redhat g =
g#mkdir_p "/etc/rc.d/rc2.d";
g#mkdir_p "/etc/rc.d/rc3.d";
g#mkdir_p "/etc/rc.d/rc5.d";
@@ -86,12 +107,51 @@ and install_sysvinit_service g root =
g#ln_sf (sprintf "%s/firstboot.sh" firstboot_dir)
"/etc/rc.d/rc5.d/99virt-sysprep-firstboot"
+(* Make firstboot.sh look like a runlevel script to avoid insserv warnings. *)
+and install_sysvinit_suse g =
+ g#mkdir_p "/etc/init.d/rc2.d";
+ g#mkdir_p "/etc/init.d/rc3.d";
+ g#mkdir_p "/etc/init.d/rc5.d";
+ g#ln_sf (sprintf "%s/firstboot.sh" firstboot_dir)
+ "/etc/init.d/virt-sysprep-firstboot";
+ g#ln_sf "../virt-sysprep-firstboot"
+ "/etc/init.d/rc2.d/S99virt-sysprep-firstboot";
+ g#ln_sf "../virt-sysprep-firstboot"
+ "/etc/init.d/rc3.d/S99virt-sysprep-firstboot";
+ g#ln_sf "../virt-sysprep-firstboot"
+ "/etc/init.d/rc5.d/S99virt-sysprep-firstboot"
+
+and install_sysvinit_debian g =
+ g#mkdir_p "/etc/init.d";
+ g#mkdir_p "/etc/rc2.d";
+ g#mkdir_p "/etc/rc3.d";
+ g#mkdir_p "/etc/rc5.d";
+ g#ln_sf (sprintf "%s/firstboot.sh" firstboot_dir)
+ "/etc/init.d/virt-sysprep-firstboot";
+ g#ln_sf "/etc/init.d/virt-sysprep-firstboot"
+ "/etc/rc2.d/S99virt-sysprep-firstboot";
+ g#ln_sf "/etc/init.d/virt-sysprep-firstboot"
+ "/etc/rc3.d/S99virt-sysprep-firstboot";
+ g#ln_sf "/etc/init.d/virt-sysprep-firstboot"
+ "/etc/rc5.d/S99virt-sysprep-firstboot"
+
+and install_sysvinit_service g distro =
+ match distro with
+ | ("fedora"|"rhel"|"centos"|"scientificlinux"|"redhat-based") ->
+ install_sysvinit_redhat g
+ | ("opensuse"|"sles"|"suse-based") ->
+ install_sysvinit_suse g
+ | "debian" ->
+ install_sysvinit_debian g
+ | _ ->
+ failed "guest type %s is not supported" distro
+
let add_firstboot_script g root id content =
let typ = g#inspect_get_type root in
let distro = g#inspect_get_distro root in
match typ, distro with
| "linux", _ ->
- install_service g root;
+ install_service g distro;
let t = Int64.of_float (Unix.time ()) in
let r = string_random8 () in
let filename = sprintf "%s/scripts/%Ld-%s-%s" firstboot_dir t r id in
--
1.7.12
10 years, 11 months
[PATCH 1/3] inspect: recognise Debian live images as such
by Pino Toscano
Check for filesystem.squashfs also in /live, since it is where
live-build places it.
---
src/inspect-fs-cd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/inspect-fs-cd.c b/src/inspect-fs-cd.c
index 407e4f8..eaeaa6f 100644
--- a/src/inspect-fs-cd.c
+++ b/src/inspect-fs-cd.c
@@ -429,7 +429,8 @@ guestfs___check_installer_root (guestfs_h *g, struct inspect_fs *fs)
* Fedora live CDs which contain the same, but larger file). We
* need to unpack this and look inside to tell the difference.
*/
- if (guestfs_is_file (g, "/casper/filesystem.squashfs") > 0)
+ if (guestfs_is_file (g, "/casper/filesystem.squashfs") > 0 ||
+ guestfs_is_file (g, "/live/filesystem.squashfs") > 0)
fs->is_live_disk = 1;
/* Debian/Ubuntu. */
--
1.8.3.1
10 years, 12 months
libguestfs >= 1.24 EL6 RPM?
by Keith Chambers
Before I start trying to build my own over the holiday I figured I asked ...
Anyone have a >= 1.24 RPM/SRPM/SPEC+Patches for EL6?
Thank you!
Keith
P.S. Big fan of libguestfs. Awesome tool! :-)
10 years, 12 months
supermin-helper: ext2: parent directory not found: /mnt/bigdata/var: File not found by ext2_lookup
by Gonzalo Aguilar Delgado
Hello,
I've found a problem running libguestfs on my system.
The system has /var mounted with a symbolic link to /mnt/bigdata/var
root@red1:/var/log/nova# ls -ld /mnt/bigdata/var
drwxrwxr-x 15 root users 4096 jul 7 17:55 /mnt/bigdata/var
root@red1:/var/log/nova# ls -ld /var
lrwxrwxrwx 1 root root 16 oct 30 2012 /var -> /mnt/bigdata/var
Any help here?
this is test tool output:
libguestfs-test-tool
************************************************************
* IMPORTANT NOTICE
*
* When reporting bugs, include the COMPLETE, UNEDITED
* output below in your bug report.
*
************************************************************
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
LD_LIBRARY_PATH=:/opt/cuda/lib:/opt/cuda/lib64:/usr/lib/nvidia-current/:/usr/lib32/nvidia-current/
LIBGUESTFS_DEBUG=1
LIBGUESTFS_TRACE=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/android-sdk/tools:/opt/android-sdk/platform-tools:/opt/cuda/bin
SELinux: sh: 1: getenforce: not found
libguestfs: trace: add_drive "/tmp/libguestfs-test-tool-sda-D0tuUa"
"format:raw"
libguestfs: trace: add_drive = 0
libguestfs: trace: version
libguestfs: trace: version = <struct guestfs_version *>
library version: 1.22.4
libguestfs: trace: get_append
libguestfs: trace: get_append = "NULL"
guestfs_get_append: (null)
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "direct"
guestfs_get_backend: direct
libguestfs: trace: get_autosync
libguestfs: trace: get_autosync = 1
guestfs_get_autosync: 1
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
guestfs_get_cachedir: /var/tmp
libguestfs: trace: get_direct
libguestfs: trace: get_direct = 0
guestfs_get_direct: 0
libguestfs: trace: get_memsize
libguestfs: trace: get_memsize = 500
guestfs_get_memsize: 500
libguestfs: trace: get_network
libguestfs: trace: get_network = 0
guestfs_get_network: 0
libguestfs: trace: get_path
libguestfs: trace: get_path = "/usr/lib/guestfs"
guestfs_get_path: /usr/lib/guestfs
libguestfs: trace: get_pgroup
libguestfs: trace: get_pgroup = 0
guestfs_get_pgroup: 0
libguestfs: trace: get_program
libguestfs: trace: get_program = "libguestfs-test-tool"
guestfs_get_program: libguestfs-test-tool
libguestfs: trace: get_qemu
libguestfs: trace: get_qemu = "/usr/bin/qemu-system-x86_64"
guestfs_get_qemu: /usr/bin/qemu-system-x86_64
libguestfs: trace: get_recovery_proc
libguestfs: trace: get_recovery_proc = 1
guestfs_get_recovery_proc: 1
libguestfs: trace: get_selinux
libguestfs: trace: get_selinux = 0
guestfs_get_selinux: 0
libguestfs: trace: get_smp
libguestfs: trace: get_smp = 1
guestfs_get_smp: 1
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
guestfs_get_tmpdir: /tmp
libguestfs: trace: get_trace
libguestfs: trace: get_trace = 1
guestfs_get_trace: 1
libguestfs: trace: get_verbose
libguestfs: trace: get_verbose = 1
guestfs_get_verbose: 1
host_cpu: x86_64
Launching appliance, timeout set to 600 seconds.
libguestfs: trace: launch
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "direct"
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfsO8mvcd
libguestfs: launch: umask=0022
libguestfs: launch: euid=0
libguestfs: command: run: supermin-helper
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ -f checksum
libguestfs: command: run: \ /usr/lib/guestfs/supermin.d
libguestfs: command: run: \ x86_64
supermin helper [00000ms] whitelist = (not specified), host_cpu =
x86_64, kernel = (null), initrd = (null), appliance = (null)
supermin helper [00000ms] inputs[0] = /usr/lib/guestfs/supermin.d
checking modpath /lib/modules/3.11.0-13-generic is a directory
picked vmlinuz-3.11.0-13-generic because modpath
/lib/modules/3.11.0-13-generic exists
checking modpath /lib/modules/2.6.35-9-generic is a directory
picked vmlinuz-2.6.35-9-generic because modpath
/lib/modules/2.6.35-9-generic exists
checking modpath /lib/modules/3.11.0-2-generic is a directory
picked vmlinuz-3.11.0-2-generic because modpath
/lib/modules/3.11.0-2-generic exists
checking modpath /lib/modules/3.11.0-7-generic is a directory
picked vmlinuz-3.11.0-7-generic because modpath
/lib/modules/3.11.0-7-generic exists
checking modpath /lib/modules/2.6.35-10-generic is a directory
picked vmlinuz-2.6.35-10-generic because modpath
/lib/modules/2.6.35-10-generic exists
checking modpath /lib/modules/3.11.0-12-generic is a directory
picked vmlinuz-3.11.0-12-generic because modpath
/lib/modules/3.11.0-12-generic exists
checking modpath /lib/modules/3.11.0-14-generic is a directory
picked vmlinuz-3.11.0-14-generic because modpath
/lib/modules/3.11.0-14-generic exists
checking modpath /lib/modules/3.11.0-3-generic is a directory
picked vmlinuz-3.11.0-3-generic because modpath
/lib/modules/3.11.0-3-generic exists
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/lib/guestfs/supermin.d
supermin helper [00001ms] visiting /usr/lib/guestfs/supermin.d/base.img
supermin helper [00001ms] visiting /usr/lib/guestfs/supermin.d/daemon.img
supermin helper [00001ms] visiting /usr/lib/guestfs/supermin.d/hostfiles
supermin helper [00032ms] visiting /usr/lib/guestfs/supermin.d/init.img
supermin helper [00032ms] visiting
/usr/lib/guestfs/supermin.d/udev-rules.img
supermin helper [00032ms] adding kernel modules
supermin helper [00092ms] finished creating appliance
libguestfs: checksum of existing appliance:
b7f7d1f8a9dc038b8f7e0ff1d745f0047efef49a0a001b87b8a253db07b192e6
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: [00097ms] begin building supermin appliance
libguestfs: [00097ms] run supermin-helper
libguestfs: command: run: supermin-helper
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ --copy-kernel
libguestfs: command: run: \ -f ext2
libguestfs: command: run: \ /usr/lib/guestfs/supermin.d
libguestfs: command: run: \ x86_64
libguestfs: command: run: \ /var/tmp/guestfs.NfWDLf/kernel
libguestfs: command: run: \ /var/tmp/guestfs.NfWDLf/initrd
libguestfs: command: run: \ /var/tmp/guestfs.NfWDLf/root
supermin helper [00000ms] whitelist = (not specified), host_cpu =
x86_64, kernel = /var/tmp/guestfs.NfWDLf/kernel, initrd =
/var/tmp/guestfs.NfWDLf/initrd, appliance = /var/tmp/guestfs.NfWDLf/root
supermin helper [00000ms] inputs[0] = /usr/lib/guestfs/supermin.d
checking modpath /lib/modules/3.11.0-13-generic is a directory
picked vmlinuz-3.11.0-13-generic because modpath
/lib/modules/3.11.0-13-generic exists
checking modpath /lib/modules/2.6.35-9-generic is a directory
picked vmlinuz-2.6.35-9-generic because modpath
/lib/modules/2.6.35-9-generic exists
checking modpath /lib/modules/3.11.0-2-generic is a directory
picked vmlinuz-3.11.0-2-generic because modpath
/lib/modules/3.11.0-2-generic exists
checking modpath /lib/modules/3.11.0-7-generic is a directory
picked vmlinuz-3.11.0-7-generic because modpath
/lib/modules/3.11.0-7-generic exists
checking modpath /lib/modules/2.6.35-10-generic is a directory
picked vmlinuz-2.6.35-10-generic because modpath
/lib/modules/2.6.35-10-generic exists
checking modpath /lib/modules/3.11.0-12-generic is a directory
picked vmlinuz-3.11.0-12-generic because modpath
/lib/modules/3.11.0-12-generic exists
checking modpath /lib/modules/3.11.0-14-generic is a directory
picked vmlinuz-3.11.0-14-generic because modpath
/lib/modules/3.11.0-14-generic exists
checking modpath /lib/modules/3.11.0-3-generic is a directory
picked vmlinuz-3.11.0-3-generic because modpath
/lib/modules/3.11.0-3-generic exists
supermin helper [00010ms] finished creating kernel
supermin helper [00349ms] finished mke2fs
supermin helper [00350ms] visiting /usr/lib/guestfs/supermin.d
supermin helper [00350ms] visiting /usr/lib/guestfs/supermin.d/base.img
supermin helper [00423ms] visiting /usr/lib/guestfs/supermin.d/daemon.img
supermin helper [00430ms] visiting /usr/lib/guestfs/supermin.d/hostfiles
supermin-helper: ext2: parent directory not found: /mnt/bigdata/var:
File not found by ext2_lookup
libguestfs: error: supermin-helper exited with error status 1, see debug
messages above
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /var/tmp/guestfs.NfWDLf
libguestfs: trace: launch = -1 (error)
libguestfs-test-tool: falló al intentar lanzar dispositivo
libguestfs: trace: close
libguestfs: closing guestfs handle 0xb99990 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsO8mvcd
10 years, 12 months
[PATCH 0/4] virt-v2v: Add support for SUSE guest conversions
by Mike Latimer
The following series of patches adds support for converting SUSE guests
through virt-v2v. These changes should not impact non-SUSE guest conversions.
Mike Latimer (4):
Add perl-Bootloader support to grub packages
Add conversion support for SUSE guests
Add SUSE to capabilities db and conf
Add SUSE support documentation
lib/Sys/VirtConvert/Converter/Linux.pm | 480 ++++++++++++++++++++++++++++-----
v2v/virt-v2v.conf | 8 +
v2v/virt-v2v.db | 73 +++++
v2v/virt-v2v.pl | 18 +-
4 files changed, 512 insertions(+), 67 deletions(-)
--
1.8.1.4
11 years
[libguestfs] Problem Connecting to RBD images using Sys::Guestfs Perl Module
by Jon
Hello,
I'm having trouble connecting to rbd images. It seems like somewhere the
name is getting chewed up. I wonder if this is related to my previous
troubles [1] [2] with rbd images.
I'm trying to add an rbd image, but when I launch the guestfs object I get
an error:
>> libguestfs: trace: launch = -1 (error)
I'm adding a single RBD
>> libguestfs: trace: add_drive "libvirt-pool/build_vm_test-os"
"format:raw" "protocol:rbd" "server:192.168.0.35:6789 192.168.0.2:6789
192.168.0.40:6789"
But it seems like the name is getting chewed up in the call to kvm:
>> -drive
file=rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none,cache=writeback,format=raw,id=hd0,if=none
>> disk image
rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none:
Invalid argument
I am able to add non rbd images without an issue.
Any thoughts?
Thanks,
Jon A
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1026688
[2] https://www.redhat.com/archives/libguestfs/2013-November/msg00003.html
Full Debug Output:
libguestfs: trace: set_verbose true
libguestfs: trace: set_verbose = 0
libguestfs: create: flags = 0, handle = 0x2e74d90, program = perl
libguestfs: trace: set_trace true
libguestfs: trace: set_trace = 0
libguestfs: trace: add_drive "libvirt-pool/build_vm_test-os" "format:raw"
"protocol:rbd" "server:192.168.0.35:6789 192.168.0.2:6789 192.168.0.40:6789"
libguestfs: trace: add_drive = 0
libguestfs: trace: launch
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: get_backend
libguestfs: trace: get_backend = "direct"
libguestfs: launch: backend registered: unix
libguestfs: launch: backend registered: uml
libguestfs: launch: backend registered: libvirt
libguestfs: launch: backend registered: direct
libguestfs: launch: backend=direct
libguestfs: launch: tmpdir=/tmp/libguestfshHZEx5
libguestfs: launch: umask=0022
libguestfs: launch: euid=0
libguestfs: command: run: /usr/local/bin/supermin-helper
libguestfs: command: run: \ --verbose
libguestfs: command: run: \ -f checksum
libguestfs: command: run: \ --host-cpu x86_64
libguestfs: command: run: \ /usr/local/lib/guestfs/supermin.d
supermin helper [00000ms] whitelist = (not specified)
supermin helper [00000ms] host_cpu = x86_64
supermin helper [00000ms] dtb_wildcard = (not specified)
supermin helper [00000ms] inputs:
supermin helper [00000ms] inputs[0] = /usr/local/lib/guestfs/supermin.d
supermin helper [00000ms] outputs:
supermin helper [00000ms] kernel = (none)
supermin helper [00000ms] dtb = (none)
supermin helper [00000ms] initrd = (none)
supermin helper [00000ms] appliance = (none)
checking modpath /lib/modules/3.11.0-12-generic is a directory
checking modpath /lib/modules/3.8.0-32-generic is a directory
checking modpath /lib/modules/3.11.0-13-generic is a directory
picked kernel vmlinuz-3.11.0-13-generic
supermin helper [00000ms] finished creating kernel
supermin helper [00000ms] visiting /usr/local/lib/guestfs/supermin.d
supermin helper [00000ms] visiting
/usr/local/lib/guestfs/supermin.d/base.img.gz
supermin helper [00000ms] visiting
/usr/local/lib/guestfs/supermin.d/daemon.img.gz
supermin helper [00000ms] visiting
/usr/local/lib/guestfs/supermin.d/hostfiles
supermin helper [00015ms] visiting
/usr/local/lib/guestfs/supermin.d/init.img
supermin helper [00015ms] visiting
/usr/local/lib/guestfs/supermin.d/udev-rules.img
supermin helper [00015ms] adding kernel modules
supermin helper [00050ms] finished creating appliance
libguestfs: checksum of existing appliance:
399c008d1c7f2ca97e64a5c37f3111a9f07c694475e5566e7e7d3b615f8bb079
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
libguestfs: [00054ms] begin testing qemu features
libguestfs: command: run: /usr/bin/kvm
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -help
W: kvm binary is deprecated, please use qemu-system-x86_64 instead
libguestfs: command: run: /usr/bin/kvm
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -version
W: kvm binary is deprecated, please use qemu-system-x86_64 instead
libguestfs: qemu version 1.5
libguestfs: command: run: /usr/bin/kvm
libguestfs: command: run: \ -nographic
libguestfs: command: run: \ -machine accel=kvm:tcg
libguestfs: command: run: \ -device ?
libguestfs: [00145ms] finished testing qemu features
[00147ms] /usr/bin/kvm \
-global virtio-blk-pci.scsi=off \
-nodefconfig \
-nodefaults \
-nographic \
-machine accel=kvm:tcg \
-cpu host,+kvmclock \
-m 500 \
-no-reboot \
-no-hpet \
-kernel /var/tmp/.guestfs-0/kernel.19756 \
-initrd /var/tmp/.guestfs-0/initrd.19756 \
-device virtio-scsi-pci,id=scsi \
-drive
file=rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none,cache=writeback,format=raw,id=hd0,if=none
\
-device scsi-hd,drive=hd0 \
-drive
file=/var/tmp/.guestfs-0/root.19756,snapshot=on,id=appliance,cache=unsafe,if=none
\
-device scsi-hd,drive=appliance \
-device virtio-serial-pci \
-serial stdio \
-device sga \
-chardev socket,path=/tmp/libguestfshHZEx5/guestfsd.sock,id=channel0 \
-device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 \
-append 'panic=1 console=ttyS0 udevtimeout=600 no_timer_check acpi=off
printk.time=1 cgroup_disable=memory root=/dev/sdb selinux=0
guestfs_verbose=1 TERM=xterm'
W: kvm binary is deprecated, please use qemu-system-x86_64 instead
qemu-system-x86_64: -drive
file=rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none,cache=writeback,format=raw,id=hd0,if=none:
could not open disk image
rbd:libvirt:mon_host=192.168.0.35\:6789\;192.168.0.2\:6789\;192.168.0.40\:6789:auth_supported=none:
Invalid argument
libguestfs: child_cleanup: 0x2e74d90: child process died
libguestfs: sending SIGTERM to process 19861
libguestfs: trace: launch = -1 (error)
guestfs_launch failed, see earlier error messages at guestfs_test.pl line
62.
libguestfs: trace: close
libguestfs: closing guestfs handle 0x2e74d90 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfshHZEx5
11 years
[PATCH 1/3] lib: Further generalize iconv wrapper function.
by Hilko Bengen
---
lib/hivex-internal.h | 8 +++++---
lib/utf16.c | 11 +++++++----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/lib/hivex-internal.h b/lib/hivex-internal.h
index 4135f58..64fd49a 100644
--- a/lib/hivex-internal.h
+++ b/lib/hivex-internal.h
@@ -268,11 +268,13 @@ extern size_t * _hivex_return_offset_list (offset_list *list);
extern void _hivex_print_offset_list (offset_list *list, FILE *fp);
/* utf16.c */
-extern char* _hivex_to_utf8 (/* const */ char *input, size_t len, char* input_encoding);
+extern char* _hivex_recode (char *input_encoding,
+ const char *input, size_t input_len,
+ char *output_encoding, size_t *output_len);
#define _hivex_windows_utf16_to_utf8(_input, _len) \
- _hivex_to_utf8 (_input, _len, "UTF-16LE")
+ _hivex_recode ("UTF-16LE", _input, _len, "UTF-8", NULL)
#define _hivex_windows_latin1_to_utf8(_input, _len) \
- _hivex_to_utf8 (_input, _len, "LATIN1")
+ _hivex_recode ("LATIN1", _input, _len, "UTF-8", NULL)
extern size_t _hivex_utf16_string_len_in_bytes_max (const char *str, size_t len);
/* util.c */
diff --git a/lib/utf16.c b/lib/utf16.c
index eca2343..6b8bf9a 100644
--- a/lib/utf16.c
+++ b/lib/utf16.c
@@ -29,18 +29,19 @@
#include "hivex-internal.h"
char *
-_hivex_to_utf8 (/* const */ char *input, size_t len, char* input_encoding)
+_hivex_recode (char *input_encoding, const char *input, size_t input_len,
+ char *output_encoding, size_t *output_len)
{
- iconv_t ic = iconv_open ("UTF-8", input_encoding);
+ iconv_t ic = iconv_open (output_encoding, input_encoding);
if (ic == (iconv_t) -1)
return NULL;
/* iconv(3) has an insane interface ... */
- size_t outalloc = len;
+ size_t outalloc = input_len;
again:;
- size_t inlen = len;
+ size_t inlen = input_len;
size_t outlen = outalloc;
char *out = malloc (outlen + 1);
if (out == NULL) {
@@ -79,6 +80,8 @@ _hivex_to_utf8 (/* const */ char *input, size_t len, char* input_encoding)
*outp = '\0';
iconv_close (ic);
+ if (output_len != NULL)
+ *output_len = outp - out;
return out;
}
--
1.8.4.4
11 years