Pino Toscano | 25 Jul 17:36 2014
Picon

[PATCH] p2v: properly call va_end

---
 p2v/miniexpect.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/p2v/miniexpect.c b/p2v/miniexpect.c
index ec81030..1baab5f 100644
--- a/p2v/miniexpect.c
+++ b/p2v/miniexpect.c
 <at>  <at>  -114,6 +114,7  <at>  <at>  mexp_spawnl (const char *file, const char *arg, ...)
     new_argv = realloc (argv, sizeof (char *) * (i+1));
     if (new_argv == NULL) {
       free (argv);
+      va_end (args);
       return NULL;
     }
     argv = new_argv;
 <at>  <at>  -122,6 +123,7  <at>  <at>  mexp_spawnl (const char *file, const char *arg, ...)

   h = mexp_spawnv (file, argv);
   free (argv);
+  va_end (args);
   return h;
 }

--

-- 
1.9.3
Richard W.M. Jones | 25 Jul 15:07 2014
Picon

[PATCH] launch: Close file descriptors after fork (RHBZ#1123007).

This refactors existing code to close file descriptors in the recovery
process, and also adds code to close file descriptors between the
fork() and exec() of QEMU or User-Mode Linux.

The reason is to avoid leaking main process file descriptors where the
main process (or other libraries in the main process) are not setting
O_CLOEXEC at all or not setting it atomically.  Python is a particular
culprit.

See also this OpenStack Nova bug report:
https://bugs.launchpad.net/nova/+bug/1313477

Thanks: Qin Zhao for identifying and characterizing the problem in Nova.
---
 src/guestfs-internal-frontend.h | 16 +++++++++++++++-
 src/launch-direct.c             | 17 +++++++++--------
 src/launch-uml.c                | 13 +++++--------
 3 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h
index 6bf0a94..3129018 100644
--- a/src/guestfs-internal-frontend.h
+++ b/src/guestfs-internal-frontend.h
 <at>  <at>  -1,5 +1,5  <at>  <at> 
 /* libguestfs
- * Copyright (C) 2013 Red Hat Inc.
+ * Copyright (C) 2013-2014 Red Hat Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
(Continue reading)

Richard W.M. Jones | 23 Jul 16:06 2014
Picon

[PATCH] sparsify: Relax requirement that output device cannot be block device.

To fix RHBZ#1056290, I prevented virt-sparsify being used if the
output device is a block device.

I have now retested this scenario and it does work (in both copying
and in-place mode), and does not delete the output device, and
therefore we can relax this restriction so only char devices are
banned.

This is useful for oVirt which uses a qcow2 formatted block device to
store virtual machines.
---
 sparsify/cmdline.ml | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sparsify/cmdline.ml b/sparsify/cmdline.ml
index a99c851..b1fb83f 100644
--- a/sparsify/cmdline.ml
+++ b/sparsify/cmdline.ml
 <at>  <at>  -167,11 +167,7  <at>  <at>  read the man page virt-sparsify(1).
         else
           Sys.getcwd () // indisk in

-      (* Check the output is not a block or char special (RHBZ#1056290). *)
-      if is_block_device outdisk then
-        error (f_"output '%s' cannot be a block device, it must be a regular file")
-          outdisk;
-
+      (* Check the output is not a char special (RHBZ#1056290). *)
       if is_char_device outdisk then
         error (f_"output '%s' cannot be a character device, it must be a regular file")
(Continue reading)

Richard W.M. Jones | 22 Jul 16:30 2014
Picon

Reminder: libguestfs preview for RHEL 7.1 is available


Just a reminder that if you're using RHEL 7.0 or CentOS 7.0, you
might be interested in using the RHEL 7.1 libguestfs preview
packages.

The general plan is to rebase to libguestfs 1.28 when it is available.
I have just updated them to:

 - libguestfs 1.27.22
 - hivex 1.3.10
 - supermin 5.1.9

To install these packages, follow the simple instructions here:

  https://www.redhat.com/archives/libguestfs/2014-May/msg00090.html

Rich.

--

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
Richard W.M. Jones | 20 Jul 20:02 2014
Picon

IRC question: Ruby gems


  18:24 < cknapp> rwmjones: is the RPM the best way to grab the guestfs gem?

[Please stay in the channel after asking a question!]

We currently ship the Ruby bindings as an extension in the ruby/
subdirectory of the source tarball.  (Note that because the extension
is mostly generated during the build, you will have to download the
tarball from http://libguestfs.org/download/ which contains the
generated bits; or, much less conveniently, you will have to do a full
build from git).

So there is no gem as such.  In particular there is nothing on
rubygems.org.

However it should be possible to take the ruby/ subdirectory and turn
it into a gem with minimal effort, since it is already in mostly the
right format.  In particular, see the Gem::Specification section in
ruby/Rakefile.

I don't know how the gem relates to the Fedora RPM.  Possibly not at
all.

Rich.

--

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html
(Continue reading)

Pino Toscano | 17 Jul 16:28 2014
Picon

[PATCH] configure: look for "default-java" as directory for Java

In Debian-based systems, /usr/lib/jvm/default-java is a symlink
pointing to the location of the default Java version.
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index ec98e4b..932bad1 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -1250,6 +1250,7  <at>  <at>  if test "x$with_java" != "xno"; then
         # Look for Java in some likely locations.
         for d in \
             /usr/lib/jvm/java \
+            /usr/lib/jvm/default-java \
             /usr/lib/jvm/java-6-openjdk
         do
             if test -d $d && test -f $d/bin/java; then
--

-- 
1.9.3
Vasiliy Tolstov | 15 Jul 13:33 2014
Picon

working with mount-local

Hi. I'm try to use guestfish inside golang (extract some files from
image and create squashfs from root).
Now i can't understand how can i work with mount-local/mount-local-run.
Where i can specify what partition i'm export to local? Does i need
firstly mount /dev/sda1 to / for example and after that run
mount-local /tmp/xxx ?
Second - i'm work with guestfish via writing to stdin and getting
result from stdout. In case of mount-local-run does i need fully fork
new binary or i can only dup stdin descriptor and work with it?

--

-- 
Vasiliy Tolstov,
e-mail: v.tolstov <at> selfip.ru
jabber: vase <at> selfip.ru
Pino Toscano | 14 Jul 11:29 2014
Picon

[PATCH] appliance: init: run ldconfig

Run ldconfig early in the init script, so libraries outside standard
library paths but with a proper ld.so configuration file pointing at
them can be found.
---
 appliance/init | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/appliance/init b/appliance/init
index b407bf9..94e77cf 100755
--- a/appliance/init
+++ b/appliance/init
 <at>  <at>  -10,6 +10,10  <at>  <at>  RUNLEVEL=S
 PREVLEVEL=N
 export RUNLEVEL PREVLEVEL

+# Make sure to find all the libraries, also those in non-standard place
+# but with a proper ld.so configuration pointing at them
+ldconfig || :
+
 # Try to print a stack trace for segfaults inside the appliance.
 for d in /lib64 /lib; do
   f=$d/libSegFault.so
--

-- 
1.9.3
Vasiliy Tolstov | 11 Jul 16:18 2014
Picon

golang binding help

Hello. I'm very happy with libguestfs, but now i'm try to write packer
plugin to strip images:
1) resize filesystem to minimum
2) resize partitions to minimum
3) create/resize file with needed size

But golang binding have not docs. Is that possible to generate
something suitable to godoc.org to determine api methods and
input,output variables for functions?

--

-- 
Vasiliy Tolstov,
e-mail: v.tolstov <at> selfip.ru
jabber: vase <at> selfip.ru
Gleb Voronich | 11 Jul 14:00 2014
Picon

File not found by ext2_lookup

Hello,

I've been trying to clone one disk image (LVM) to another using virt-resize.
Unfortunately I get the following error:

# virt-resize /dev/vm/vm6 /dev/vm/vm7

supermin helper [00004ms] finished creating kernel
supermin helper [00251ms] finished mke2fs
<domain type='kvm'>
supermin helper [00252ms] visiting /usr/lib64/guestfs/supermin.d
supermin helper [00252ms] visiting /usr/lib64/guestfs/supermin.d/base.img.gz
supermin helper [03505ms] visiting 
/usr/lib64/guestfs/supermin.d/daemon.img.gz
supermin helper [03527ms] visiting /usr/lib64/guestfs/supermin.d/hostfiles
libguestfs: trace: launch = -1 (error)
Fatal error: exception Guestfs.Error("supermin-helper exited with error 
status 1, see debug messages above")
libguestfs: trace: close

Is there any known issue that could cause this?
I have CentOS 7.0.1406 at the host node at CentOS 6.5 at the guest.

Thanks.
Richard W.M. Jones | 11 Jul 11:42 2014
Picon

[PATCH] sparsify: Add --tmp prebuilt:file option.

This option allows oVirt to pass a prebuilt qcow2 file to use as the
temporary overlay.  The file must be qcow2, and must have indisk as a
backing file - the code does minimal checks to ensure this is correct.

Example usage:

  qemu-img create -f qcow2 -b indisk overlay.qcow2
  virt-sparsify indisk --tmp prebuilt:overlay.qcow2 outdisk

Note this only applies in copying mode.
---
 sparsify/cmdline.ml        |  2 +-
 sparsify/copying.ml        | 54 ++++++++++++++++++++++++++++++++--------------
 sparsify/virt-sparsify.pod | 27 +++++++++++++++++++++++
 3 files changed, 66 insertions(+), 17 deletions(-)

diff --git a/sparsify/cmdline.ml b/sparsify/cmdline.ml
index 11e5895..a99c851 100644
--- a/sparsify/cmdline.ml
+++ b/sparsify/cmdline.ml
 <at>  <at>  -80,7 +80,7  <at>  <at>  let parse_cmdline () =
     "-o",        Arg.Set_string option,     s_"option" ^ " " ^ s_"Add qemu-img options";
     "-q",        Arg.Set quiet,             " " ^ s_"Quiet output";
     "--quiet",   Arg.Set quiet,             ditto;
-    "--tmp",     Arg.Set_string tmp,        s_"block|dir" ^ " " ^ s_"Set temporary block device or directory";
+    "--tmp",     Arg.Set_string tmp,        s_"block|dir|prebuilt:file" ^ " " ^ s_"Set temporary block device,
directory or prebuilt file";
     "-v",        Arg.Set verbose,           " " ^ s_"Enable debugging messages";
     "--verbose", Arg.Set verbose,           ditto;
     "-V",        Arg.Unit display_version,  " " ^ s_"Display version and exit";
(Continue reading)


Gmane