[Libguestfs] [nbdkit PATCH] python: Make sure callbacks are actually callable

2018-04-05 Thread Eric Blake
Rather than catching a Python error at runtime when trying to call an object that wasn't callable, just ignore that object up front when loading the plugin. Signed-off-by: Eric Blake --- Various examples on calling Python functions from C recommend doing this filtering check.

[Libguestfs] [nbdkit PATCH] tests: Skip guestfs tests on CentOS 6

2018-04-05 Thread Eric Blake
CentOS 6 has libguestfs-devel 1.20.11, which predates the support in guestfs_add_drive_opts() for requesting an nbd drive instead of a local file. The guestfs plugin can still be built, so no configure changes are needed; but skip the tests that fail to compile so that 'make check' can at least

Re: [Libguestfs] [nbdkit PATCH 2/3] tests: Add coverage of zero in language bindings

2018-04-05 Thread Eric Blake
On 04/05/2018 01:54 PM, Eric Blake wrote: > The existing test of language bindings was not covering any > use of NBD_CMD_WRITE_ZEROES, making it harder to test changes > to the plugin's zero callback. Recent Linux kernels are now > smart enough to turn fallocate(2) with FALLOC_FL_ZERO_RANGE >

[Libguestfs] [nbdkit PATCH 1/3] python: Follow pep8 recommendations

2018-04-05 Thread Eric Blake
No semantic change, just fixing style issues to comply with pep8 rules. Signed-off-by: Eric Blake --- plugins/python/example.py | 10 -- tests/python-exception.py | 4 tests/shebang.py | 5 - tests/test.py | 17 ++--- 4

[Libguestfs] [nbdkit PATCH 0/3] Test zero callback of python plugin

2018-04-05 Thread Eric Blake
I'm planning on tweaking the language callbacks to support fua; first up is the python bindings. I want to move from: def zero(h, count, offset, may_trim): to a nicer: def zero(h, count, offset, may_trim=False, fua=False): where the C code passes keywords for the flags (we can add new flags

[Libguestfs] [nbdkit PATCH 3/3] python: Test implementation of zero callback

2018-04-05 Thread Eric Blake
The previous commit enabled testing of the fallback when a zero callback is not present; but even better is testing that the zero callback is called correctly. Signed-off-by: Eric Blake --- tests/test.py | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/test.py

[Libguestfs] [nbdkit PATCH 2/3] tests: Add coverage of zero in language bindings

2018-04-05 Thread Eric Blake
The existing test of language bindings was not covering any use of NBD_CMD_WRITE_ZEROES, making it harder to test changes to the plugin's zero callback. Recent Linux kernels are now smart enough to turn fallocate(2) with FALLOC_FL_ZERO_RANGE into a SCSI WRITE SAME request, which qemu in turn

Re: [Libguestfs] [nbdkit PATCH] nbd: Fix gcc warning and off-by-one in socket name length

2018-04-05 Thread Richard W.M. Jones
On Thu, Apr 05, 2018 at 10:27:10AM -0500, Eric Blake wrote: > gcc 8 gripes (when using './configure --enable-gcc-warnings'): > nbd.c: In function 'nbd_open': > nbd.c:470:3: error: 'strncpy' specified bound 108 equals destination size > [-Werror=stringop-truncation] strncpy (sock.sun_path,

[Libguestfs] [nbdkit PATCH] nbd: Fix gcc warning and off-by-one in socket name length

2018-04-05 Thread Eric Blake
gcc 8 gripes (when using './configure --enable-gcc-warnings'): nbd.c: In function 'nbd_open': nbd.c:470:3: error: 'strncpy' specified bound 108 equals destination size [-Werror=stringop-truncation] strncpy (sock.sun_path, sockname, sizeof (sock.sun_path)); The warning is a false positive, given

Re: [Libguestfs] [PATCH v3 3/3] v2v: OVF: fix ovf:id for VirtualSystem in OVirt flavour

2018-04-05 Thread Richard W.M. Jones
Looks good, ACK series. 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

Re: [Libguestfs] [PATCH v2 1/2] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Michal Skrivanek
> On 5 Apr 2018, at 14:16, Tomáš Golembiovský wrote: > > On Thu, 05 Apr 2018 13:56:11 +0200 > Pino Toscano wrote: > >> On Thursday, 5 April 2018 13:45:53 CEST Tomáš Golembiovský wrote: >>> On Thu, 5 Apr 2018 10:34:33 +0200 >>> Pino Toscano

Re: [Libguestfs] [PATCH nbdkit] python: Turn python exceptions into nbdkit errors properly.

2018-04-05 Thread Richard W.M. Jones
On Thu, Apr 05, 2018 at 08:17:00AM -0500, Eric Blake wrote: > On 04/05/2018 07:47 AM, Richard W.M. Jones wrote: > > --- > > configure.ac | 8 +++ > > plugins/python/python.c| 51 > > +++--- > > tests/Makefile.am | 1

Re: [Libguestfs] [PATCH nbdkit] python: Turn python exceptions into nbdkit errors

2018-04-05 Thread Richard W.M. Jones
On Thu, Apr 05, 2018 at 02:05:12PM +0100, Daniel P. Berrangé wrote: > On Thu, Apr 05, 2018 at 01:47:30PM +0100, Richard W.M. Jones wrote: > > Much more annoying that it needs to be, but I have tested it and it > > works on Python 2 & 3. Note this will not work on Python 3.0 - 3.2, > > but I guess

[Libguestfs] [PATCH v8] v2v: Add -o rhv-upload output mode (RHBZ#1557273).

2018-04-05 Thread Richard W.M. Jones
This adds a new output mode to virt-v2v. virt-v2v -o rhv-upload streams images directly to an oVirt or RHV >= 4 Data Domain using the oVirt SDK v4. It is more efficient than -o rhv because it does not need to go via the Export Storage Domain, and is possible for humans to use unlike -o vdsm.

[Libguestfs] [PATCH v8] v2v: Add -o rhv-upload output mode (RHBZ#1557273).

2018-04-05 Thread Richard W.M. Jones
v7 was here: https://www.redhat.com/archives/libguestfs/2018-March/msg00143.html Since then: - Earlier patches are now upstream. - The to-do list is moved from the commit message to the TODO file. - This version forces -of raw + -oa sparse and gives an error in any other mode. We intend

Re: [Libguestfs] [PATCH nbdkit] python: Turn python exceptions into nbdkit errors properly.

2018-04-05 Thread Eric Blake
On 04/05/2018 07:47 AM, Richard W.M. Jones wrote: > --- > configure.ac | 8 +++ > plugins/python/python.c| 51 > +++--- > tests/Makefile.am | 1 + > tests/python-exception.py | 45

Re: [Libguestfs] [PATCH nbdkit] python: Turn python exceptions into nbdkit errors

2018-04-05 Thread Daniel P . Berrangé
On Thu, Apr 05, 2018 at 01:47:30PM +0100, Richard W.M. Jones wrote: > Much more annoying that it needs to be, but I have tested it and it > works on Python 2 & 3. Note this will not work on Python 3.0 - 3.2, > but I guess we don't care about those versions. What's the problem that impacts 3.0 ->

[Libguestfs] [PATCH v3 3/3] v2v: OVF: fix ovf:id for VirtualSystem in OVirt flavour

2018-04-05 Thread Pino Toscano
When writing the OVF in OVirt flavour, write the actual UUID of the VM as ovf:id attribute for , instead of a dummy value. Suggested by Arik Hadas in https://www.redhat.com/archives/libguestfs/2018-April/msg5.html --- v2v/create_ovf.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Libguestfs] [PATCH v3 1/3] v2v: OVF: improve get_ostype mappings

2018-04-05 Thread Pino Toscano
- consider CentOS as RHEL, since oVirt has no CentOS OS mappings, and CentOS is derived from RHEL - use rhel_6_9_plus_ppc64 for RHEL 6 >= 6.9 on ppc64/ppc64le, while rhel_6_ppc64 for RHEL 6 < 6.9 - use rhel_7_s390x for RHEL 7 on s390x - use sles_11, and sles_11_ppc64 for any SLES greater than

[Libguestfs] [PATCH v3 2/3] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Pino Toscano
When writing the OVF in OVirt flavour, add a ovirt:id attribute to the OperatingSystemSection tag: this attribute represents the numeric value of the ostype ID, which is ignored by oVirt when parsing OVFs in API mode. --- v2v/create_ovf.ml | 203

[Libguestfs] [PATCH v3 0/3] v2v: improve OVF in OVirt flavour

2018-04-05 Thread Pino Toscano
Hi, v3 of these patches: https://www.redhat.com/archives/libguestfs/2018-April/msg2.html https://www.redhat.com/archives/libguestfs/2018-April/msg6.html Thanks, Pino Toscano (3): v2v: OVF: improve get_ostype mappings v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

[Libguestfs] [PATCH nbdkit] python: Turn python exceptions into nbdkit errors properly.

2018-04-05 Thread Richard W.M. Jones
--- configure.ac | 8 +++ plugins/python/python.c| 51 +++--- tests/Makefile.am | 1 + tests/python-exception.py | 45 + tests/test-python-exception.sh | 42

[Libguestfs] [PATCH nbdkit] python: Turn python exceptions into nbdkit errors

2018-04-05 Thread Richard W.M. Jones
Much more annoying that it needs to be, but I have tested it and it works on Python 2 & 3. Note this will not work on Python 3.0 - 3.2, but I guess we don't care about those versions. Rich. ___ Libguestfs mailing list Libguestfs@redhat.com

Re: [Libguestfs] [PATCH v2 1/2] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Tomáš Golembiovský
On Thu, 05 Apr 2018 13:56:11 +0200 Pino Toscano wrote: > On Thursday, 5 April 2018 13:45:53 CEST Tomáš Golembiovský wrote: > > On Thu, 5 Apr 2018 10:34:33 +0200 > > Pino Toscano wrote: > > > > > When writing the OVF in OVirt flavour, add a ovirt:id

Re: [Libguestfs] [PATCH v2 1/2] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Pino Toscano
On Thursday, 5 April 2018 13:45:53 CEST Tomáš Golembiovský wrote: > On Thu, 5 Apr 2018 10:34:33 +0200 > Pino Toscano wrote: > > > When writing the OVF in OVirt flavour, add a ovirt:id attribute to the > > OperatingSystemSection tag: this attribute represents the numeric

Re: [Libguestfs] [PATCH v2 1/2] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Tomáš Golembiovský
On Thu, 5 Apr 2018 10:34:33 +0200 Pino Toscano wrote: > When writing the OVF in OVirt flavour, add a ovirt:id attribute to the > OperatingSystemSection tag: this attribute represents the numeric value > of the ostype ID, which is ignored by oVirt when parsing OVFs in API >

Re: [Libguestfs] [PATCH FOR DISCUSSION ONLY v2] v2v: Add -o kubevirt output mode.

2018-04-05 Thread Fabian Deutsch
On Thu, Mar 29, 2018 at 5:26 PM, Piotr Kliczewski wrote: > Richard, > > Great progress. I really like it!!! > That's crazy, Rich! :) And actually pretty straight forward … to read. > > Here is what I noticed: > > I see that in the yaml file we provide short-id as: > >

Re: [Libguestfs] [PATCH v2 2/2] v2v: OVF: fix ovf:id for VirtualSystem in OVirt flavour

2018-04-05 Thread Richard W.M. Jones
ACK series. I tested this series with -o rhv-upload, but not with the old -o rhv (ie. ESD) mode. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual

[Libguestfs] [PATCH v2 0/2] v2v: improve OVF in OVirt flavour

2018-04-05 Thread Pino Toscano
Hi, v2 of this patch: https://www.redhat.com/archives/libguestfs/2018-April/msg3.html that includes an additional fix. Thanks, Pino Toscano (2): v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour v2v: OVF: fix ovf:id for VirtualSystem in OVirt flavour v2v/create_ovf.ml |

[Libguestfs] [PATCH v2 1/2] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Pino Toscano
When writing the OVF in OVirt flavour, add a ovirt:id attribute to the OperatingSystemSection tag: this attribute represents the numeric value of the ostype ID, which is ignored by oVirt when parsing OVFs in API mode. --- v2v/create_ovf.ml | 202

[Libguestfs] [PATCH v2 2/2] v2v: OVF: fix ovf:id for VirtualSystem in OVirt flavour

2018-04-05 Thread Pino Toscano
When writing the OVF in OVirt flavour, write the actual UUID of the VM as ovf:id attribute for , instead of a dummy value. Suggested by Arik Hadas in https://www.redhat.com/archives/libguestfs/2018-April/msg5.html --- v2v/create_ovf.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [Libguestfs] [PATCH] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Arik Hadas
On Thu, Apr 5, 2018 at 10:27 AM, Richard W.M. Jones wrote: > On Wed, Apr 04, 2018 at 06:22:12PM +0200, Pino Toscano wrote: > > When writing the OVF in OVirt flavour, add a ovirt:id attribute to the > > OperatingSystemSection tag: this attribute represents the numeric value > >

Re: [Libguestfs] [PATCH] v2v: OVF: write ovirt:id attribute for the OS in OVirt flavour

2018-04-05 Thread Richard W.M. Jones
On Wed, Apr 04, 2018 at 06:22:12PM +0200, Pino Toscano wrote: > When writing the OVF in OVirt flavour, add a ovirt:id attribute to the > OperatingSystemSection tag: this attribute represents the numeric value > of the ostype ID, which is ignored by oVirt when parsing OVFs in API > mode. > --- >