Re: [Libguestfs] [PATCH 2/2] build: Replace ./nbdkit with a C program.

2018-11-13 Thread Eric Blake
On 11/13/18 4:51 PM, Richard W.M. Jones wrote: There are advantages to having the same code parse the options in the ./nbdkit wrapper as in the real nbdkit: - We can parse options in exactly the same way as the real program. - Use the more accurate ‘is_short_name’ test for unadorned

[Libguestfs] [PATCH 0/2] build: Replace ./nbdkit with a C program.

2018-11-13 Thread Richard W.M. Jones
This patch series solves the FreeBSD shebang problem in a completely different way, and a few other things besides. I propose that we replace ./nbdkit with a C program. The C program is a straightforward translation of the shell script. Some advantages of this approach are: - We can parse

[Libguestfs] [PATCH 2/2] build: Replace ./nbdkit with a C program.

2018-11-13 Thread Richard W.M. Jones
There are advantages to having the same code parse the options in the ./nbdkit wrapper as in the real nbdkit: - We can parse options in exactly the same way as the real program. - Use the more accurate ‘is_short_name’ test for unadorned plugin/filter names on the command line. - Fixes the

[Libguestfs] [PATCH v5 1/3] v2v: refactor copy_drivers() in Windows_virtio

2018-11-13 Thread Tomáš Golembiovský
Changed the function to be more generic and renamed. The only change in behavior is in produced debug messages. Signed-off-by: Tomáš Golembiovský --- v2v/windows_virtio.ml | 46 +++ 1 file changed, 29 insertions(+), 17 deletions(-) diff --git

Re: [Libguestfs] [PATCH v3 1/3] v2v: refactor copy_drivers() in Windows_virtio

2018-11-13 Thread Tomáš Golembiovský
On Wed, 7 Nov 2018 15:43:00 + "Richard W.M. Jones" wrote: > On Wed, Nov 07, 2018 at 12:53:18PM +0100, Tomáš Golembiovský wrote: > > Changed the function to be more generic and renamed. > > The only change in behavior is in produced debug messages. > > > > Signed-off-by: Tomáš Golembiovský

[Libguestfs] [PATCH 1/2] src: Move long_options short_options, is_short_name to a header file.

2018-11-13 Thread Richard W.M. Jones
This refactoring is simply so the exact same options can be reused in another program. --- src/Makefile.am | 1 + src/main.c | 70 +-- src/options.h | 109 3 files changed, 111 insertions(+), 69 deletions(-)

[Libguestfs] [PATCH v5 3/3] v2v: linux: install QEMU-GA (RHBZ#1619665)

2018-11-13 Thread Tomáš Golembiovský
Signed-off-by: Tomáš Golembiovský --- v2v/convert_linux.ml | 2 ++ v2v/windows_virtio.ml | 32 v2v/windows_virtio.mli | 4 3 files changed, 38 insertions(+) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index e8c64ac1b..a1bafe91a 100644 ---

[Libguestfs] [PATCH v5 2/3] v2v: fix path construction in Windows_virtio.copy_files()

2018-11-13 Thread Tomáš Golembiovský
Some paths in the function are evaluated in libguestfs environment. Previous commit copied the invalid construction. This is now fixed. Signed-off-by: Tomáš Golembiovský --- v2v/windows_virtio.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v2v/windows_virtio.ml

[Libguestfs] [PATCH v5 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux

2018-11-13 Thread Tomáš Golembiovský
changes in v5: - simplified expression in copy_drivers - new commit fixing path constructions - indentation fixes changes in v4: - fix call to install_local changes in v2: - moved copy_drivers above copy_files - renamed copy_files to copy_from_virtio_win - renamed install to install_local - use

Re: [Libguestfs] [PATCH v4 3/3] v2v: linux: install QEMU-GA (RHBZ#1619665)

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 01:41:42PM +0100, Tomáš Golembiovský wrote: > +and install_linux_tools g inspect = > + let os = match inspect.i_distro with > + | "fedora" -> Some "fc28" > + | "rhel" | "centos" | "scientificlinux" | "redhat-based" > + | "oraclelinux" -> (match inspect.i_major_version

Re: [Libguestfs] [PATCH v4 2/3] v2v: linux: install packages

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 01:41:41PM +0100, Tomáš Golembiovský wrote: > Install packages from local files without touching network. > > Signed-off-by: Tomáš Golembiovský I pushed this one, thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my

Re: [Libguestfs] Further nbdkit patches for Haiku

2018-11-13 Thread Eric Blake
On 11/13/18 10:24 AM, Richard W.M. Jones wrote: On Tue, Nov 13, 2018 at 02:18:34PM +, Richard W.M. Jones wrote: On Tue, Nov 13, 2018 at 03:09:16PM +0100, François Revol wrote: Possibly use something like this? qemuioargs="-f raw" qemu-io -h | grep -- -f > /dev/null 2>&1 || qemuioargs=""

Re: [Libguestfs] Further nbdkit patches for Haiku

2018-11-13 Thread Richard W.M. Jones
Either of the following changes works on FreeBSD (the second one seems to me to be simpler actually): --- a/tests/shebang.pl +++ b/tests/shebang.pl @@ -1,4 +1,4 @@ -#!../nbdkit perl +#!/usr/bin/env -S bash ../nbdkit perl --- a/tests/shebang.pl +++ b/tests/shebang.pl @@ -1,4 +1,4 @@

Re: [Libguestfs] Further nbdkit patches for Haiku

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 09:16:33AM -0600, Eric Blake wrote: > On 11/13/18 7:40 AM, Richard W.M. Jones wrote: > >>(I think the error message is "incorrect ELF header") could be > >>something to do with the way we use shebangs (#!). IIRC this also > >>fails on FreeBSD so probably nbdkit is doing

Re: [Libguestfs] Further nbdkit patches for Haiku

2018-11-13 Thread Eric Blake
On 11/13/18 7:40 AM, Richard W.M. Jones wrote: (I think the error message is "incorrect ELF header") could be something to do with the way we use shebangs (#!). IIRC this also fails on FreeBSD so probably nbdkit is doing something which is not correct POSIX. POSIX says that #! shebangs are

Re: [Libguestfs] Further nbdkit patches for Haiku

2018-11-13 Thread François Revol
Le 13/11/2018 à 14:40, Richard W.M. Jones a écrit : > On Tue, Nov 06, 2018 at 09:02:17AM +, Richard W.M. Jones wrote: >> Finally about the list of failing tests: >> >> https://pastebin.com/1PFG85DS >> >> Mostly these are because of the old qemu-io binary. The qemu-io -f >> option was added

Re: [Libguestfs] Further nbdkit patches for Haiku

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 03:09:16PM +0100, François Revol wrote: > Le 13/11/2018 à 14:40, Richard W.M. Jones a écrit : > > On Tue, Nov 06, 2018 at 09:02:17AM +, Richard W.M. Jones wrote: > >> Finally about the list of failing tests: > >> > >> https://pastebin.com/1PFG85DS > >> > >> Mostly

Re: [Libguestfs] [PATCH v4 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux

2018-11-13 Thread Tomáš Golembiovský
On Tue, 13 Nov 2018 13:41:39 +0100 Tomáš Golembiovský wrote: > changes in v4: > - fix call to install_local v3 was same as v2 because I forgot to commit the changes. The difference between v2 and v4 is just one line in the Linux.install_local call. Tomas > > changes in v2: > - moved

Re: [Libguestfs] Further nbdkit patches for Haiku

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 06, 2018 at 09:02:17AM +, Richard W.M. Jones wrote: > Finally about the list of failing tests: > > https://pastebin.com/1PFG85DS > > Mostly these are because of the old qemu-io binary. The qemu-io -f > option was added 4 years ago :-/ so it could be time to upgrade. FWIW this

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Peter Dimitrov
Github issue is a fact. https://github.com/collectd/collectd/issues/2993 Best Regards, Peter On Tue, Nov 13, 2018 at 3:28 PM Richard W.M. Jones wrote: > On Tue, Nov 13, 2018 at 03:17:33PM +0200, Peter Dimitrov wrote: > > I was extending the virt plugin. > > It already collects similar data

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Peter Dimitrov
I was extending the virt plugin. It already collects similar data (about VMs) using Libvirt's API, but lacks disk usage information. I went through some hoops to link libguestfs correctly to collectd. Is it okay to just include fork(), waitpid() example? It does reproduce the issue. Best

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 03:17:33PM +0200, Peter Dimitrov wrote: > I was extending the virt plugin. > It already collects similar data (about VMs) using Libvirt's API, but lacks > disk usage information. > > I went through some hoops to link libguestfs correctly to collectd. > Is it okay to just

[Libguestfs] [PATCH v4 2/3] v2v: linux: install packages

2018-11-13 Thread Tomáš Golembiovský
Install packages from local files without touching network. Signed-off-by: Tomáš Golembiovský --- v2v/linux.ml | 14 ++ v2v/linux.mli | 3 +++ 2 files changed, 17 insertions(+) diff --git a/v2v/linux.ml b/v2v/linux.ml index 177724e39..966170cdd 100644 --- a/v2v/linux.ml +++

[Libguestfs] [PATCH v4 1/3] v2v: refactor copy_drivers() in Windows_virtio

2018-11-13 Thread Tomáš Golembiovský
Changed the function to be more generic and renamed. The only change in behavior is in produced debug messages. Signed-off-by: Tomáš Golembiovský --- v2v/windows_virtio.ml | 48 --- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git

[Libguestfs] [PATCH v4 0/3] Install QEMU-GA from oVirt guest tools ISO on Linux

2018-11-13 Thread Tomáš Golembiovský
changes in v4: - fix call to install_local changes in v2: - moved copy_drivers above copy_files - renamed copy_files to copy_from_virtio_win - renamed install to install_local - use rpm instead of yum This installs packages with QEMU Guest Agent when converting Linux machine. The packages should

[Libguestfs] [PATCH v4 3/3] v2v: linux: install QEMU-GA (RHBZ#1619665)

2018-11-13 Thread Tomáš Golembiovský
Signed-off-by: Tomáš Golembiovský --- v2v/convert_linux.ml | 2 ++ v2v/windows_virtio.ml | 30 ++ v2v/windows_virtio.mli | 4 3 files changed, 36 insertions(+) diff --git a/v2v/convert_linux.ml b/v2v/convert_linux.ml index e8c64ac1b..a1bafe91a 100644 ---

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Florian Forster
Hi, thank you very much for reporting this! Sounds like a bug in the exec plugin – it never ceases to amaze me how many issues a single plugin can have ;) > > > This means that any plugin that does the usual pattern of: > > > > > > pid = fork (); Note that the exec plugin is the *only*

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 12:00:19PM +0100, Florian Forster wrote: > Hi, > > thank you very much for reporting this! Sounds like a bug in the exec plugin – > it never ceases to amaze me how many issues a single plugin can have ;) > > > > > This means that any plugin that does the usual pattern of:

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Florian Forster
A quick glance shows that the exec plugin actually is clearing the signal mask: https://github.com/collectd/collectd/blob/master/src/exec.c#L526 Can you give some more context when this problem comes up? Ideally in a Github issue (hint, hint ;). -- Florian octo Forster Hacker in training GnuPG:

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 12:07:23PM +0100, Florian Forster wrote: > A quick glance shows that the exec plugin actually is clearing the signal > mask: > https://github.com/collectd/collectd/blob/master/src/exec.c#L526 The problem is the SIGCHLD handler being set to SIG_IGN, which is different from

Re: [Libguestfs] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Daniel P . Berrangé
On Tue, Nov 13, 2018 at 10:42:20AM +, Richard W.M. Jones wrote: > On Tue, Nov 13, 2018 at 10:04:33AM +, Daniel P. Berrangé wrote: > > On Fri, Nov 09, 2018 at 12:19:30PM +, Richard W.M. Jones wrote: > > > Peter Dimitrov and myself were debugging a very peculiar bug when > > > libguestfs

Re: [Libguestfs] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 10:04:33AM +, Daniel P. Berrangé wrote: > On Fri, Nov 09, 2018 at 12:19:30PM +, Richard W.M. Jones wrote: > > Peter Dimitrov and myself were debugging a very peculiar bug when > > libguestfs is run as a plugin from collectd: > > > >

Re: [Libguestfs] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Daniel P . Berrangé
On Fri, Nov 09, 2018 at 12:19:30PM +, Richard W.M. Jones wrote: > Peter Dimitrov and myself were debugging a very peculiar bug when > libguestfs is run as a plugin from collectd: > > https://www.redhat.com/archives/libguestfs/2018-November/thread.html#00023 > > The long story short is that

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Richard W.M. Jones
On Tue, Nov 13, 2018 at 09:19:40AM +0100, Ruben Kerkhof wrote: > Hi Rich, > > On Fri, Nov 9, 2018 at 1:19 PM, Richard W.M. Jones wrote: > > Peter Dimitrov and myself were debugging a very peculiar bug when > > libguestfs is run as a plugin from collectd: > > > >

Re: [Libguestfs] [collectd] collectd leaks SIGCHLD == SIG_IGN into plugins

2018-11-13 Thread Ruben Kerkhof
Hi Rich, On Fri, Nov 9, 2018 at 1:19 PM, Richard W.M. Jones wrote: > Peter Dimitrov and myself were debugging a very peculiar bug when > libguestfs is run as a plugin from collectd: > > https://www.redhat.com/archives/libguestfs/2018-November/thread.html#00023 > > The long story short is that