Re: [Libguestfs] [nbdkit PATCH] test-layers: Avoid thread leak

2018-11-07 Thread Eric Blake
On 11/7/18 9:02 PM, Eric Blake wrote: Running 'make check' under a ThreadSanitizer build complains that test-layers leaks a pthread; while harmless, it is also an easy fix, by detaching the thread to ensure it gets cleaned up. Signed-off-by: Eric Blake --- tests/test-layers.c | 6 ++ 1

[Libguestfs] [nbdkit PATCH] test-layers: Avoid thread leak

2018-11-07 Thread Eric Blake
Running 'make check' under a ThreadSanitizer build complains that test-layers leaks a pthread; while harmless, it is also an easy fix, by detaching the thread to ensure it gets cleaned up. Signed-off-by: Eric Blake --- tests/test-layers.c | 6 ++ 1 file changed, 6 insertions(+) diff --git

[Libguestfs] [nbdkit PATCH] nbd: Fix race during close

2018-11-07 Thread Eric Blake
ThreadSanitizer [1] pointed out that in the nbd plugin, nbd_close() can attempt close() in the main thread while the worker thread is still attempting to start a read(). Normally, if the read() loses the race, it will get a harmless EBADF that exits the worker thread (which is what we want, as we

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

2018-11-07 Thread Tomáš Golembiovský
On Wed, 7 Nov 2018 17:32:56 +0100 Tomáš Golembiovský wrote: > On Wed, 7 Nov 2018 15:31:56 + > "Richard W.M. Jones" wrote: > > > On Wed, Nov 07, 2018 at 12:53:17PM +0100, Tomáš Golembiovský wrote: > > > changes in v3: > > > - fix call to install_local > > > > > > changes in v2: > > > -

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

2018-11-07 Thread Tomáš Golembiovský
On Wed, 7 Nov 2018 15:46:49 + "Richard W.M. Jones" wrote: > On Wed, Nov 07, 2018 at 12:53:20PM +0100, Tomáš Golembiovský wrote: > > Signed-off-by: Tomáš Golembiovský > > --- > > v2v/convert_linux.ml | 2 ++ > > v2v/windows_virtio.ml | 30 ++ > >

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

2018-11-07 Thread Richard W.M. Jones
On Wed, Nov 07, 2018 at 05:27:18PM +0100, Tomáš Golembiovský wrote: > On Wed, 7 Nov 2018 15:46:49 + > "Richard W.M. Jones" wrote: > > > On Wed, Nov 07, 2018 at 12:53:20PM +0100, Tomáš Golembiovský wrote: > > > Signed-off-by: Tomáš Golembiovský > > > --- > > > v2v/convert_linux.ml | 2 ++

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

2018-11-07 Thread Tomáš Golembiovský
On Wed, 7 Nov 2018 15:31:56 + "Richard W.M. Jones" wrote: > On Wed, Nov 07, 2018 at 12:53:17PM +0100, Tomáš Golembiovský wrote: > > changes in v3: > > - fix call to install_local > > > > changes in v2: > > - moved copy_drivers above copy_files > > - renamed copy_files to

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

2018-11-07 Thread Richard W.M. Jones
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ý > --- > v2v/windows_virtio.ml | 48

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

2018-11-07 Thread Richard W.M. Jones
On Wed, Nov 07, 2018 at 12:53:20PM +0100, Tomáš Golembiovský wrote: > 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

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

2018-11-07 Thread Richard W.M. Jones
On Wed, Nov 07, 2018 at 12:53:19PM +0100, Tomáš Golembiovský wrote: > 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

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

2018-11-07 Thread Richard W.M. Jones
On Wed, Nov 07, 2018 at 12:53:17PM +0100, Tomáš Golembiovský wrote: > changes in v3: > - 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

Re: [Libguestfs] guestfs_launch() fails when C application is started as a systemd service

2018-11-07 Thread Richard W.M. Jones
On Wed, Nov 07, 2018 at 01:37:03PM +0200, Peter Dimitrov wrote: > > That makes no sense because we are supposed to have just forked > successfully > > I just realized libguestfs uses fork. Now we know why qemu-img worked - I > launched it with popen. > > > So it must be something to do with

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

2018-11-07 Thread Tomáš Golembiovský
On Wed, 07 Nov 2018 13:32:45 +0100 Pino Toscano wrote: > On Wednesday, 7 November 2018 12:53:17 CET Tomáš Golembiovský wrote: > > - support for Debian is missing > > I don't know how to install the package only when all it's dependencies > > are > > already installed. > > dpkg -i foo.deb

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

2018-11-07 Thread Pino Toscano
On Wednesday, 7 November 2018 12:53:17 CET Tomáš Golembiovský wrote: > - support for Debian is missing > I don't know how to install the package only when all it's dependencies are > already installed. dpkg -i foo.deb > dpkg cannot be used to check that (simulate the install). dpkg

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

2018-11-07 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

Re: [Libguestfs] guestfs_launch() fails when C application is started as a systemd service

2018-11-07 Thread Peter Dimitrov
> That makes no sense because we are supposed to have just forked successfully I just realized libguestfs uses fork. Now we know why qemu-img worked - I launched it with popen. > So it must be something to do with collectd and how it runs programs. > Is it using LD_PRELOAD trickery, or replacing

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

2018-11-07 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 v2 2/3] v2v: linux: install packages

2018-11-07 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 v2 3/3] v2v: linux: install QEMU-GA (RHBZ#1619665)

2018-11-07 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 ---

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

2018-11-07 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] guestfs_launch() fails when C application is started as a systemd service

2018-11-07 Thread Peter Dimitrov
Thank you, Rich, This was the issue indeed. export LIBGUESTFS_BACKEND=direct fixed it. The next step I tried was to integrate libguestfs in collectd virt plugin to collect this data automatically. In this case I'm having an unknown error in add_libvirt_dom() (same with add_domain) when it's

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

2018-11-07 Thread Tomáš Golembiovský
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 be available on guest tools ISO. The

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

2018-11-07 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 +++

Re: [Libguestfs] guestfs_launch() fails when C application is started as a systemd service

2018-11-07 Thread Richard W.M. Jones
On Wed, Nov 07, 2018 at 12:32:48PM +0200, Peter Dimitrov wrote: > Thank you, Rich, > This was the issue indeed. export LIBGUESTFS_BACKEND=direct fixed it. > > The next step I tried was to integrate libguestfs in collectd virt plugin > to collect this data automatically. > In this case I'm having

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

2018-11-07 Thread Tomáš Golembiovský
On Tue, 6 Nov 2018 11:32:38 + "Richard W.M. Jones" wrote: > On Tue, Nov 06, 2018 at 11:44:14AM +0100, Tomáš Golembiovský wrote: > > Install packages from local files without touching network. > > In fact, not limited to local files, but is limited to guests which > use ‘yum’. So I think

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

2018-11-07 Thread Richard W.M. Jones
On Wed, Nov 07, 2018 at 11:24:48AM +0100, Tomáš Golembiovský wrote: > I used the same style as remove(). I will inline the code as I prefer > that. This is a stylistic point, so whichever style is easier to read, more consistent, etc. Rich. -- Richard Jones, Virtualization Group, Red Hat