[Libguestfs] [PATCH v2 1/5] daemon: directly use Optgroups

2018-04-10 Thread Pino Toscano
Avoid extra module variables, and just use Optgroups directly. --- daemon/ldm.ml| 2 -- daemon/ldm.mli | 2 -- daemon/listfs.ml | 4 ++-- daemon/lvm.ml| 2 -- daemon/lvm.mli | 2 -- 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/daemon/ldm.ml b/daemon/ldm.ml index c177

[Libguestfs] [PATCH v2 3/5] daemon: move Lvm.lv_canonical to new Lvm_utils module

2018-04-10 Thread Pino Toscano
This way the Lvm module contains only the OCaml implementations of LVM daemon APIs. This is simple refactoring, with no functional changes. --- daemon/Makefile.am | 2 ++ daemon/findfs.ml| 2 +- daemon/inspect_fs_unix_fstab.ml | 2 +- daemon/lvm.ml

[Libguestfs] [nbdkit PATCH v3 0/2] Add nbdkit_realpath

2018-04-12 Thread Pino Toscano
Hi, this is the v3 of my series for nbdkit_realpath; this series adds an extra documentation update to nbdkit_absolute_path, documenting when it can only be used, and then adds nbdkit_realpath. Thanks, Pino Toscano (2): docs: improve documentation of nbdkit_absolute_path plugin: add and use

[Libguestfs] [PATCH 0/2] Support for expanding f2fs partitions

2018-04-12 Thread Pino Toscano
Hi, this small patch series exposes one of the utility in f2fs-tools, and use it to expand f2fs partitions in virt-resize. Thanks, Pino Toscano (2): New API: f2fs_expand resize: expand f2fs partitions daemon/Makefile.am| 1 + daemon/f2fs.c | 49

[Libguestfs] [PATCH 1/2] New API: f2fs_expand

2018-04-12 Thread Pino Toscano
Expose the resize.f2fs utility from f2fs-tools, to expand a f2fs filesystem. --- daemon/Makefile.am| 1 + daemon/f2fs.c | 49 +++ generator/actions_core.ml | 9 + generator/proc_nr.ml | 1 + lib/MAX_PROC_NR |

[Libguestfs] [PATCH] v2v: linux: correctly update resume=/dev/device entries (RHBZ#1532224)

2018-04-15 Thread Pino Toscano
When updating the device names to the new names, handle GRUB_CMDLINE entries (typically in grub2 configuration files) correctly: loop over the whole configuration value, and replace each occurrency of resume=/dev/device found. The actual code is moved away from replace_if_device, since this functi

[Libguestfs] [nbdkit PATCH v3 1/2] docs: improve documentation of nbdkit_absolute_path

2018-04-15 Thread Pino Toscano
Mention what it really does, and where it can only be used. Signed-off-by: Pino Toscano --- docs/nbdkit-plugin.pod | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/nbdkit-plugin.pod b/docs/nbdkit-plugin.pod index 65f3190..27a885e 100644 --- a/docs/nbdkit-plugin.pod

[Libguestfs] [nbdkit PATCH v3 2/2] plugin: add and use nbdkit_realpath

2018-04-15 Thread Pino Toscano
. Related to: https://bugzilla.redhat.com/show_bug.cgi?id=1527334 Signed-off-by: Pino Toscano --- docs/nbdkit-plugin.pod | 17 + include/nbdkit-common.h | 1 + plugins/example2/example2.c | 2 +- plugins/file/file.c | 6 +- plugins/gzip/gzip.c | 2

[Libguestfs] [PATCH v2 2/2] resize: expand f2fs partitions

2018-04-15 Thread Pino Toscano
Use resize.f2fs (via f2fs_expand) to expand f2fs filesystems, if available. --- resize/resize.ml | 12 ++-- resize/virt-resize.pod | 10 -- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/resize/resize.ml b/resize/resize.ml index 1a21e4dff..8e4bb1b16 100644 --

[Libguestfs] [PATCH 2/2] resize: expand f2fs partitions

2018-04-15 Thread Pino Toscano
Use resize.f2fs (via f2fs_expand) to expand f2fs filesystems, if available. --- resize/resize.ml | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resize/resize.ml b/resize/resize.ml index 1a21e4dff..8e4bb1b16 100644 --- a/resize/resize.ml +++ b/resize/resize.ml @@

Re: [Libguestfs] [PATCH] v2v: Give better diagnostics if filesystem falls back to read-only (RHBZ#1567763).

2018-04-16 Thread Pino Toscano
y fail later on with a strange error message. > > Test the root filesystem is writable by creating and deleting a > temporary file, and if the creation fails then give better > diagnostics. Another possibility here could be to use the "norecover" mount option. -- Pino Toscan

[Libguestfs] [PATCH] v2v: rework handling of CPU topology

2018-04-20 Thread Pino Toscano
Instead of storing the number of sockets, cores, and threads separately with the possibility to have each of them optional, store them together, so either we have a CPU topology or none. This slightly simplifies the handling of CPU topology. Most of the output modes/producers already considered a

[Libguestfs] [PATCH] uefi: remove last references to kraxel's old edk2 builds

2018-04-20 Thread Pino Toscano
Commit 889386f8c6088e57fd68f2bb6bf85f69ecfc6f6c removed most of them already, so remove the last ones, and the supporting code. --- generator/UEFI.ml | 6 -- v2v/utils.ml | 1 - 2 files changed, 7 deletions(-) diff --git a/generator/UEFI.ml b/generator/UEFI.ml index 5161e28ee..1ff3f84d2

[Libguestfs] [PATCH] common/mlpcre: fix access to freed memory

2018-04-27 Thread Pino Toscano
free_last_match() frees the memory of the match passed as argument, so accessing it is not possible after free_last_match(). Since all we need is the return code, save it locally for later usage. --- common/mlpcre/pcre-c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comm

[Libguestfs] [PATCH 3/4] common/qemuopts: use the old pointer as realloc pointer

2018-04-30 Thread Pino Toscano
Call realloc() directly with the pointer to the old data, instead of assigning it to the destination variable, and using that one. The rest of the code is the same, already properly checking for the results of realloc(), so this mostly help static code analyzers. --- common/qemuopts/qemuopts.c |

[Libguestfs] [PATCH 4/4] daemon: simplify string allocation

2018-04-30 Thread Pino Toscano
When creating an helper string for do_aug_match(), use a simpler asprintf() with manual free(), since the code block is small enough. This slightly helps static code analyzers. --- daemon/augeas.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/daemon/augeas.c b/dae

[Libguestfs] [PATCH 1/4] daemon: upload: fix fd leak on lseek failure

2018-04-30 Thread Pino Toscano
Make sure to not leak the file descriptor in the upload() function, in case lseek() fails. --- daemon/upload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemon/upload.c b/daemon/upload.c index 9de855f86..540a86437 100644 --- a/daemon/upload.c +++ b/daemon/upload.c @@ -111,6 +111,7 @@ upl

[Libguestfs] [PATCH 2/4] launch: libvirt: free format string

2018-04-30 Thread Pino Toscano
When the result guestfs_disk_format() is not known, free the string before returning an error. --- lib/launch-libvirt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index e4961f201..844023b80 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libv

[Libguestfs] [PATCH] daemon: fix memory allocation and leaks in OCaml stubs

2018-05-03 Thread Pino Toscano
Use the cleanup handlers to free the structs (and list of structs) in case their OCaml->C transformation fails for any reason; use calloc() to not try to use uninitialized memory. In case of lists, avoid allocating the memory for the array if there are no elements, since the returned pointer in th

[Libguestfs] [PATCH] common/qemuopts: ensure arg lists are never empty

2018-05-04 Thread Pino Toscano
Since it does not make much sense, then forbid this situation outright: - change qemuopts_end_arg_list() to return an error if the current arg list has no elements - when creating the argv array, assert that each arg list is not empty --- common/qemuopts/qemuopts.c | 14 -- 1 file ch

[Libguestfs] [PATCH] appliance: initialize the appliance_files struct

2018-05-04 Thread Pino Toscano
Some compilers do not manage to figure out that the members of it are set only when search_appliance() in the end returns 1, which is already checked. Help them a bit by resetting the appliance_files struct on our own, so they will not report that 'appliance.kernel', and the others are used as uni

[Libguestfs] [PATCH] java: support OpenJDK 10+

2018-05-04 Thread Pino Toscano
Starting OpenJDK 10, the 'javah' utility is no more provided [1], and its functionality is provided by 'javac' itself. Hence, do not error out on missing 'javah', and store whether it was found; in case it is not, then: 1) assume 'javac' has the -h parameter to generate the C header, and make u

[Libguestfs] [PATCH] daemon: tweak regexp for file type detection (RHBZ#1575640)

2018-05-07 Thread Pino Toscano
Newer versions of file slightly changed the output, removing the comma between the type, and the architecture string. Tweak the regular expression so: - the comma is optional, but if missing then only the architecture string will follow - the architecture string has no commas --- daemon/filearc

Re: [Libguestfs] [PATCH] Fix building on macOS

2018-05-09 Thread Pino Toscano
+[#ifdef HAVE_RPC_TYPES_H > +# include > +#endif > +]) Considering we assume that rpc/types.h exists, there is no need to check it at configure time -- just include it directly in the AC_CHECK_HEADER for rpc/xdr.h. Also, this needs to be in its own patch (with authorship, description, etc). -- Pin

[Libguestfs] [PATCH] v2v: update results of test-v2v-i-ova-snapshots for non-json

2018-05-09 Thread Pino Toscano
When using non-JSON disk notation, the disk will be the snapshot #2. Fixes commit e5946165c8ea78e0e91c4cfdb5e793526cd638e1. --- v2v/test-v2v-i-ova-snapshots.expected | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2v/test-v2v-i-ova-snapshots.expected b/v2v/test-v2v-i-ova-sna

Re: [Libguestfs] [PATCH v2 0/2] Fix building on macOS

2018-05-15 Thread Pino Toscano
I only tested this on Linux but at least it doesn't break things > there. LGTM. -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] tests: Increase appliance memory when testing 256+ disks.

2018-05-16 Thread Pino Toscano
my $g = Sys::Guestfs->new (); > +$g->set_memsize ($g->get_memsize () * 20 / 5); > $g->launch (); > my %kernel = $g->utsname; > $g->close (); I don't see how this changes the situation, given that the handle here is used only to get the information of the k

[Libguestfs] [PATCH] RFC: v2v: use RHV Setup Tools ISO if available

2018-05-18 Thread Pino Toscano
If the RHV Setup Tools ISO is installed, open it, and copy RHEV APT from there, instead of using (if available) the executable located in the virt-tools data directory. This way, RHV conversion hosts with the RHV Setup Tools ISO installed will always install the latest version when convering Windo

[Libguestfs] [PATCH] v2v: linux: fix kernel detection when split in different packages

2018-05-21 Thread Pino Toscano
The current detection code for Linux kernels assumes that a kernel package contains everything in it, i.e. the kernel itself, its modules, and its configuration. However, since recent Ubuntu versions (e.g. starting from 18.04) modules & config (with few more files) are split in an own package, thu

[Libguestfs] [PATCH] v2v: -o null: support older qemu-img (RHBZ#1580309)

2018-05-21 Thread Pino Toscano
Commit 4699c7b6e126e07c95b67fb95df58aed87a680dd converted the null output to use the null-co qemu driver with a JSON URL syntax -- especially the latter is only available in newer versions of qemu. Even if this output mode is mostly for testing, check at runtime whether the null-co + JSON way is p

Re: [Libguestfs] [PATCH] v2v: Use Std_utils.qemu_input_filename instead of prefixing "file:" to filename (RHBZ#1580292).

2018-05-22 Thread Pino Toscano
On Tuesday, 22 May 2018 09:11:17 CEST Richard W.M. Jones wrote: > This also allows us to use virt-v2v with the old version of qemu in > RHEL 7. > > Fixes commit e29296cfa20dd691995832940a30fe2e6b98149a. > > Thanks: Pino Toscano for suggesting the fix. > --- LGTM (indeed

[Libguestfs] [PATCH v2] v2v: linux: fix kernel detection when split in different packages

2018-05-22 Thread Pino Toscano
The current detection code for Linux kernels assumes that a kernel package contains everything in it, i.e. the kernel itself, its modules, and its configuration. However, since recent Ubuntu versions (e.g. starting from 18.04) modules & config (with few more files) are split in an own package, thu

[Libguestfs] [PATCH] v2v: fix build rules for output_rhv_upload_*_source.ml files

2018-05-22 Thread Pino Toscano
Use the $(srcdir) variable where needed, to make sure it builds also with srcdir != builddir. Furthermore, make sure that the OCaml dependencies calculation depend on the generated output_rhv_upload_*_source.ml files, otherwise there will be incomplete OCaml rules for them in the generated .depend

Re: [Libguestfs] [PATCH] lib: Increase default memory assigned to the appliance.

2018-05-23 Thread Pino Toscano
he default change only if strictly needed to work in "usual workloads". -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] lib: Increase default memory assigned to the appliance.

2018-05-23 Thread Pino Toscano
ay/msg00082.html -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] RFC: v2v: use RHV Setup Tools ISO if available

2018-05-23 Thread Pino Toscano
On Wednesday, 23 May 2018 15:42:42 CEST Tomáš Golembiovský wrote: > On Fri, 18 May 2018 17:42:15 +0200 > Pino Toscano wrote: > > > If the RHV Setup Tools ISO is installed, open it, and copy RHEV APT from > > there, instead of using (if available) the executable located in th

Re: [Libguestfs] [PATCH v2] daemon: Move lvmetad to early in the appliance boot process.

2018-05-24 Thread Pino Toscano
ix: > + lvm_system_dir = getenv ("LVM_SYSTEM_DIR"); > + if (!lvm_system_dir) > +lvm_system_dir = "/etc/lvm"; > + fprintf (stderr, "lvm_system_dir = %s\n", lvm_system_dir); The pointer returned by getenv() can change, so it will be better to

Re: [Libguestfs] [PATCH 0/3] v2v: Various refactorings.

2018-06-06 Thread Pino Toscano
you fetch it once - you want to test conversions offline (assuming the output is a local disk, or libvirt) -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://ww

Re: [Libguestfs] [PATCH] p2v: Allow virt-v2v input and output drivers containing '-' (RHBZ#1590220).

2018-06-12 Thread Pino Toscano
about making them a bit more loose, e.g.: input:((?:[^\\n])+) so there are no further changes to do, in case other non-word characters are used in the names of input, and output modes? -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] p2v: Allow virt-v2v input and output drivers containing '-' (RHBZ#1590220).

2018-06-13 Thread Pino Toscano
On Tuesday, 12 June 2018 18:16:11 CEST Richard W.M. Jones wrote: > On Tue, Jun 12, 2018 at 12:13:32PM +0200, Pino Toscano wrote: > > On Tuesday, 12 June 2018 11:27:56 CEST Richard W.M. Jones wrote: > > > The new ‘-o rhv-upload’ output mode contains a '-' characte

[Libguestfs] [PATCH] fuse: fix build when not available

2018-06-15 Thread Pino Toscano
The 'localmountpoint' variable in the handle is available only when building with FUSE support, so guard it in a proper #ifdef block. Fixes commit 296370fb86e96eec095d86faf6de8f532395ea54. --- lib/handle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/handle.c b/lib/handle.c index bc4

Re: [Libguestfs] [PATCH v2] lib: Convert all drive socket parameters to an absolute path (RHBZ#1588451).

2018-06-21 Thread Pino Toscano
n an user specifies a relative path that cannot be resolved during add_drive, but does chdir before run. -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.r

Re: [Libguestfs] [PATCH v3] lib: libvirt: Convert all drive socket parameters to an absolute path (RHBZ#1588451).

2018-06-21 Thread Pino Toscano
On Thursday, 21 June 2018 12:01:50 CEST Richard W.M. Jones wrote: > --- > lib/launch-libvirt.c | 15 ++- > 1 file changed, 14 insertions(+), 1 deletion(-) LGTM. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed mes

Re: [Libguestfs] [PATCH] v2v: -o libvirt: Don't write only without (RHBZ#1591789).

2018-06-21 Thread Pino Toscano
On Friday, 15 June 2018 17:18:57 CEST Richard W.M. Jones wrote: > Avoids the libvirt error: > > error: XML error: CPU vendor specified without CPU model > --- LGTM. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed

Re: [Libguestfs] [PATCH] v2v: docs: Removed vsyscall support in Debian kernels requiring workaround (RHBZ#1592061).

2018-06-21 Thread Pino Toscano
er parameter already ... -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] v2v: Add attribute containing disk virtual size.

2018-06-21 Thread Pino Toscano
On Monday, 18 June 2018 11:41:32 CEST Richard W.M. Jones wrote: > Required ever since this change was made to oVirt: > https://gerrit.ovirt.org/#/c/91902/ > > Thanks: Arik Hadas > --- It looks compatible with oVirt before the aforementioned patch, so LGTM. Thanks, -

Re: [Libguestfs] [PATCH] v2v: changed to the actual size (if known).

2018-06-21 Thread Pino Toscano
On Monday, 18 June 2018 16:59:49 CEST Richard W.M. Jones wrote: > Note that this attribute is optional. > > Thanks: Arik Hadas > --- LGTM. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed message part. __

Re: [Libguestfs] [PATCH v2] p2v: Allow virt-v2v input and output drivers containing '-' (RHBZ#1590220).

2018-06-21 Thread Pino Toscano
It ended > up mapping this to just "rhv" meaning two "rhv" entries would appear > in the list of output drivers. > > Thanks: Ming Xie. > --- LGTM. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed message part. __

[Libguestfs] [PATCH 2/3] test-tool: add a documentation test

2018-06-27 Thread Pino Toscano
Add the podcheck.pl test, to make sure the documentation is in sync with the available options. Also fix the formats of options in the current POD, so it matches what used already in other documentations, and what podcheck.pl expects. --- test-tool/Makefile.am | 12 +

[Libguestfs] [PATCH 1/3] test-tool: implement --short-options & --long-options

2018-06-27 Thread Pino Toscano
While not useful per-se, it will help checking the available options. --- test-tool/Makefile.am | 5 - test-tool/test-tool.c | 9 - 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/test-tool/Makefile.am b/test-tool/Makefile.am index bf4f5a843..2cbd4d1b1 100644 --- a/test

[Libguestfs] [PATCH 3/3] bash: add a completion script for libguestfs-test-tool

2018-06-27 Thread Pino Toscano
Use the simple virt-v2v-copy-to-local script for it. --- .gitignore | 1 + bash/Makefile.am| 3 ++- bash/virt-v2v-copy-to-local | 6 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 871795bcc..a78fd1633 100644 --- a/.gi

[Libguestfs] [PATCH 0/3] test-tool: small options-related improvements

2018-06-27 Thread Pino Toscano
*** BLURB HERE *** Pino Toscano (3): test-tool: implement --short-options & --long-options test-tool: add a documentation test bash: add a completion script for libguestfs-test-tool .gitignore | 1 + bash/Makefile.am

[Libguestfs] [PATCH] v2v: -o local: print libvirt XML

2018-06-27 Thread Pino Toscano
In verbose mode, print the generated libvirt XML to stderr for debugging, just like -o libvirt does. --- v2v/output_local.ml | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/v2v/output_local.ml b/v2v/output_local.ml index 4e1088afc..c70428134 100644 --- a/v2v/output_local

[Libguestfs] [PATCH] v2v: improve -os documentation for rhv-upload

2018-06-29 Thread Pino Toscano
Thanks to: Ming Xie --- v2v/virt-v2v.pod | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod index ff25f98d4..a533e95da 100644 --- a/v2v/virt-v2v.pod +++ b/v2v/virt-v2v.pod @@ -766,6 +766,9 @@ For I<-o libvirt>, this is a libvirt directory pool For I<-o loca

[Libguestfs] [PATCH 2/2] v2v: change QXL ResourceType in OVirt flavour (RHBZ#1598715)

2018-07-13 Thread Pino Toscano
Due to a conflict with the IDs of the OVF standard, and the existing implementation in ovirt-engine, the ID of QXL devices changed to a different value. As a consequence, change the ResourceType of QXL devices, but only in OVirt flavour to avoid breaking vdsm mode. See: https://bugzilla.redhat.co

[Libguestfs] [PATCH 1/2] Revert "v2v: oVirt changed the ResourceType for QXL video devices (RHBZ#1598715)."

2018-07-13 Thread Pino Toscano
The change is not correct in case the OVF is used in -o vdsm mode, for example. Let's revert it, and then implement it properly. This reverts commit 296b2f66c71df0bf5ee2ee605fe4b92672796ab3. --- v2v/create_ovf.ml| 2 +- v2v/test-v2v-o-rhv.ovf.expected | 2 +- v2v

[Libguestfs] [PATCH] uefi: add non-deprecated Fedora paths for OVMF w/ secboot

2018-07-17 Thread Pino Toscano
Add new paths for the Secure Boot variant of OVMF as found in Fedora. --- generator/UEFI.ml | 6 ++ 1 file changed, 6 insertions(+) diff --git a/generator/UEFI.ml b/generator/UEFI.ml index 1ff3f84d2..bca3fa1ae 100644 --- a/generator/UEFI.ml +++ b/generator/UEFI.ml @@ -52,6 +52,12 @@ let firmw

[Libguestfs] [PATCH] v2v: -o rhv-upload: check for ovirtsdk4 (RHBZ#1601943)

2018-07-17 Thread Pino Toscano
Check earlier whether the ovirtsdk4 Python can be imported correctly, to avoid errors later on during the migration. --- v2v/output_rhv_upload.ml | 8 1 file changed, 8 insertions(+) diff --git a/v2v/output_rhv_upload.ml b/v2v/output_rhv_upload.ml index 0152b8d5a..63fa2411a 100644 --- a/

Re: [Libguestfs] [PATCH 2/3] New API: lvm_scan, deprecate vgscan (RHBZ#1602353).

2018-07-19 Thread Pino Toscano
sers should migrate to lvm_scan, they can just add a new optarg. -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH] v2v: ovf: add firmware and machine type element

2018-07-19 Thread Pino Toscano
o convoluted -- what about something like (untested): let get_ovirt_biostype guestcaps = function | TargetBIOS -> 0 (* i440fx + SeaBIOS *) | TargetUEFI -> let caps = find_uefi_firmware guestcaps.gcaps_arch in if List.mem Uefi.UEFI_FLAG_SECURE_BOOT_REQUIRED caps.flags th

Re: [Libguestfs] [PATCH 2/3] New API: lvm_scan, deprecate vgscan (RHBZ#1602353).

2018-07-23 Thread Pino Toscano
it 19b0ae6c6502c4833c73e1b1bfa47b43a40f21e9, so its behaviour will be as the patch does 2) add the new APIs in a second commit This way the fix for vgscan could be backported to 1.38.x, if it is safe enough, leaving the new API for 1.39+. Also, just (1) should be enough to fix rhbz#16

[Libguestfs] [PATCH] daemon: inspect: ignore fstab devs that cannot be resolved (RHBZ#1608131)

2018-07-27 Thread Pino Toscano
If the /etc/fstab of a guest contains devices specified with UUID or LABEL, then the new OCaml inspection code will report the findfs failure as general failure of the inspection. OTOH, the old C inspection code simply ignored all the devices that cannot be resolved. Hence, restore the old behavi

[Libguestfs] [PATCH] v2v: -o rhv-upload: PEP8 fixes for rhv-upload-plugin.py

2018-07-31 Thread Pino Toscano
- wrap a too long line - join strings in multiple lines using + (plus) instead of \ (backslash) --- v2v/rhv-upload-plugin.py | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 4fad27fb8..bdc1e104a 100644 --- a/v2v/rh

[Libguestfs] [PATCH] btrfs_balance_status: delay allocation of 'ret'

2018-08-06 Thread Pino Toscano
Allocate 'ret' as late as possible, so there is no risk that early returns will leak it. --- daemon/btrfs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daemon/btrfs.c b/daemon/btrfs.c index 26757d4fb..5c4be6cf7 100644 --- a/daemon/btrfs.c +++ b/daemon/btrfs.c @

Re: [Libguestfs] [PATCH] v2v: Add --mac option to machine-readable

2018-08-07 Thread Pino Toscano
odules ()); > List.iter (printf "convert:%s\n") (Modules_list.convert_modules ()); Make sense, I will push it soon. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH] v2v: parse_libvirt_xml: handle srN CDROM devices (RHBZ#1612785)

2018-08-09 Thread Pino Toscano
This device naming is mostly written by virt-p2v, so get the slot from it directly without using the drive_index "decoding" function. --- v2v/parse_libvirt_xml.ml | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_libvirt_xml.ml index

[Libguestfs] [PATCH] Change wording from "twice" to "more than once" in error messages

2018-08-10 Thread Pino Toscano
When erroring out about duplicated parameters, say "more than once" instead of "twice", since there can be more than two repeated parameters. Thanks to: Xiaodai Wang --- generator/fish.ml | 2 +- generator/perl.ml | 2 +- resize/resize.ml | 4 ++-- tools/virt-tar

Re: [Libguestfs] [PATCH] v2v: parse_libvirt_xml: handle srN CDROM devices (RHBZ#1612785)

2018-08-10 Thread Pino Toscano
On Friday, 10 August 2018 14:51:12 CEST Richard W.M. Jones wrote: > On Thu, Aug 09, 2018 at 03:05:26PM +0200, Pino Toscano wrote: > > This device naming is mostly written by virt-p2v, so get the slot from > > it directly without using the drive_index "decoding" f

Re: [Libguestfs] [PATCH] v2v: -o rhv-upload: Fix error message disk numbering (RHBZ#1615885).

2018-08-14 Thread Pino Toscano
-i disk, -i ova, and -i vmx. IMHO the issue is in the libvirt XML parser, which starts to number the disks from 1. I'm sending a patch for this. -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH] v2v: parse_libvirt_xml: number disks from 0 (RHBZ#1615885)

2018-08-14 Thread Pino Toscano
When parsing the libvirt XML, make sure to assign the IDs for disks (s_disk_id) from 0 instead of 1, just like all the other input modes not based on libvirt XML. --- v2v/parse_libvirt_xml.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2v/parse_libvirt_xml.ml b/v2v/parse_l

Re: [Libguestfs] [PATCH] v2v: parse_libvirt_xml: number disks from 0 (RHBZ#1615885)

2018-08-14 Thread Pino Toscano
On Tuesday, 14 August 2018 16:53:02 CEST Richard W.M. Jones wrote: > On Tue, Aug 14, 2018 at 04:04:10PM +0200, Pino Toscano wrote: > > When parsing the libvirt XML, make sure to assign the IDs for disks > > (s_disk_id) from 0 instead of 1, just like all the other input modes n

Re: [Libguestfs] [PATCH] v2v: parse_libvirt_xml: number disks from 0 (RHBZ#1615885)

2018-08-14 Thread Pino Toscano
On Tuesday, 14 August 2018 17:44:30 CEST Richard W.M. Jones wrote: > On Tue, Aug 14, 2018 at 05:32:08PM +0200, Pino Toscano wrote: > > On Tuesday, 14 August 2018 16:53:02 CEST Richard W.M. Jones wrote: > > > On Tue, Aug 14, 2018 at 04:04:10PM +0200, Pino Toscano wrote: > &

[Libguestfs] [PATCH v2] v2v: parse_libvirt_xml: number disks from 0

2018-08-15 Thread Pino Toscano
When parsing the libvirt XML, make sure to assign the IDs for disks (s_disk_id) from 0 instead of 1. This does not change the actual behaviour, just makes the IDs like in all the other input modes not based on libvirt XML. --- v2v/parse_libvirt_xml.ml | 2 +- 1 file changed, 1 insertion(+), 1 del

Re: [Libguestfs] [PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.

2018-08-17 Thread Pino Toscano
messages in the QMP communication, which we do not do. We parse JSON from: - output of ldmtool - output of qemu-img - QMP schema - SimpleStream files Furthermore, why not just fix qemu, instead of letting its "JSON implementation" rule out perfectly compliant JSON parsers? -- Pino To

Re: [Libguestfs] [PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.

2018-08-20 Thread Pino Toscano
> +| JSON_parser_bool of bool I'd drop the _parser_ from the name, as seems redundant (and makes both type name, and all its values long enough...). The rest of it LGTM. -- Pino Toscano signature.asc Description: This is a digitally signed message part. _

Re: [Libguestfs] [PATCH v3 4/4] v2v: Add --print-estimate option to print copy size estimate.

2018-08-20 Thread Pino Toscano
error_unexpected_output (s_"expecting \"required\" to be an > integer") > + json > + ) > + | _ -> > + error_unexpected_output (s_"expecting object at top level") json You can replace this whole using

Re: [Libguestfs] [PATCH v3 4/4] v2v: Add --print-estimate option to print copy size

2018-08-20 Thread Pino Toscano
Hi, patches #2, and #3 LGTM; I left notes for patches #1, and #4. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo

[Libguestfs] [PATCH 1/2] mlstdutils/mltools: factorize the machine-readable option

2018-08-20 Thread Pino Toscano
Store the machine-readable flag globally, just like done for verbose/debug/etc, and enhance create_standard_options to provide --machine-readable automatically. --- common/mlstdutils/std_utils.ml | 4 common/mlstdutils/std_utils.mli | 7 +-- common/mltools/tools_utils.ml | 7 ++- c

[Libguestfs] [PATCH 2/2] OCaml tools: simplify machine-readable handling

2018-08-20 Thread Pino Toscano
Make use of the helper provided by Tools_utils.create_standard_options, so there is no need to implement the logic in each tool. This affects all the OCaml tools with --machine-readable, namely: virt-builder, virt-builder-repository, virt-dib, virt-get-kernel, virt-resize, virt-sparsify, and virt-

[Libguestfs] [PATCH] common/mltools: getopt: add Getopt.OptString

2018-08-20 Thread Pino Toscano
Introduce a new type of option with an optional string argument. --- common/mltools/getopt-c.c | 20 +++- common/mltools/getopt.ml | 5 - common/mltools/getopt.mli | 4 common/mltools/getopt_tests.ml | 18 +- common/mltools/test-getopt.sh

[Libguestfs] [PATCH 1/2] common/mltools: getopt: add Getopt.OptString

2018-08-21 Thread Pino Toscano
Introduce a new type of option with an optional string argument. --- common/mltools/getopt-c.c | 20 +++- common/mltools/getopt.ml | 5 - common/mltools/getopt.mli | 4 common/mltools/getopt_tests.ml | 18 +- common/mltools/test-getopt.sh

[Libguestfs] [PATCH 0/2] RFC: add output selection for --machine-readable

2018-08-21 Thread Pino Toscano
osed --print-estimate for virt-v2v [1] could print human output (just like the --print-source), while printing e.g. JSON to the machine-readable stream. [1] https://www.redhat.com/archives/libguestfs/2018-August/msg00158.html Thanks, Pino Toscano (2): common/mltools: getopt: add Getopt.OptString O

[Libguestfs] [PATCH 2/2] OCaml tools: add output selection for --machine-readable

2018-08-21 Thread Pino Toscano
Add an optional argument for --machine-readable to select the output, adding a new function to specifically write data to that output stream. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=str

Re: [Libguestfs] [PATCH 1/4] build: Use LT_INIT in configure.ac.

2018-08-22 Thread Pino Toscano
ble AC_USE_SYSTEM_EXTENSIONS. > (AC_GNU_SOURCE was removed back in 2011). > --- LGTM. -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs

Re: [Libguestfs] [PATCH 4/4] java: Link with gnulib to resolve missing hash_free symbol.

2018-08-22 Thread Pino Toscano
uestfs.la \ > + $(top_builddir)/gnulib/lib/libgnu.la Hmm what's the exact error in this case? On which platform? The java binding does not explicitly use the hash stuff from gnulib. -- Pino Toscano signature.asc Description: This is a digitally signed message part.

Re: [Libguestfs] [PATCH 0/4] mltools: JSON unification

2018-08-22 Thread Pino Toscano
On Monday, 20 August 2018 18:02:02 CEST Richard W.M. Jones wrote: > An evolution of: > > https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html Patches #1, #2, and #3 LGTM. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed mes

Re: [Libguestfs] [PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.

2018-08-22 Thread Pino Toscano
thus JSON.json_t must represent it as well. This is even used in other parts, for example the check of backing files of disks (see guestfs_impl_disk_has_backing_file). -- Pino Toscano signature.asc Description: This is a digitally signed message part.

Re: [Libguestfs] [PATCH 2/2] OCaml tools: add output selection for --machine-readable

2018-08-22 Thread Pino Toscano
On Wednesday, 22 August 2018 12:29:41 CEST Richard W.M. Jones wrote: > On Tue, Aug 21, 2018 at 05:44:30PM +0200, Pino Toscano wrote: > > +let machine_readable_printf fs = > > + let get_machine_readable_channel () = > > +let open_machine_readable_channel

[Libguestfs] [PATCH] lib: create: avoid one extra string allocation

2018-08-22 Thread Pino Toscano
When creating the qemu-img command, use the guestfs_int_cmd_add_arg & guestfs_int_cmd_add_arg_format APIs to add the proper filename directly, without creating a string for it. This should cause no functional change. --- lib/create.c | 25 +++-- 1 file changed, 11 insertions(+

Re: [Libguestfs] [PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.

2018-08-22 Thread Pino Toscano
On Wednesday, 22 August 2018 16:41:01 CEST Richard W.M. Jones wrote: > v2: > - Added back the null value. > - Reran the tests. LGTM. Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestf

Re: [Libguestfs] [PATCH 4/4] java: Link with gnulib to resolve missing hash_free symbol.

2018-08-23 Thread Pino Toscano
On Wednesday, 22 August 2018 16:16:40 CEST Richard W.M. Jones wrote: > On Wed, Aug 22, 2018 at 12:56:47PM +0200, Pino Toscano wrote: > > On Tuesday, 14 August 2018 15:42:13 CEST Richard W.M. Jones wrote: > > > --- > > > java/Makefile.am | 3 ++- > > > 1 file

[Libguestfs] [PATCH v2 0/2] add output selection for --machine-readable

2018-08-23 Thread Pino Toscano
Tools_utils - expose all in a single machine_readable () function - add a test - add the documentation bits Thanks, Pino Toscano (2): common/mltools: getopt: add Getopt.OptString OCaml tools: add output selection for --machine-readable .gitignore | 1 + builder

[Libguestfs] [PATCH v2 2/2] OCaml tools: add output selection for --machine-readable

2018-08-23 Thread Pino Toscano
Add an optional argument for --machine-readable to select the output, adding a new function to specifically write data to that output stream. The possible choices are: * --machine-readable: to stdout, like before * --machine-readable=file:name-of-file: to the specified file * --machine-readable=str

[Libguestfs] [PATCH v2 1/2] common/mltools: getopt: add Getopt.OptString

2018-08-23 Thread Pino Toscano
Introduce a new type of option with an optional string argument. --- common/mltools/getopt-c.c | 20 +++- common/mltools/getopt.ml | 26 ++ common/mltools/getopt.mli | 4 common/mltools/getopt_tests.ml | 18 +- common/ml

Re: [Libguestfs] [PATCH] Fix error with --uninstall option on SUSE

2018-08-23 Thread Pino Toscano
alled Of course the example above is overly simplified -- though, can the above happen? Thanks, -- Pino Toscano signature.asc Description: This is a digitally signed message part. ___ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.co

Re: [Libguestfs] [PATCH] Fix error with --uninstall option on SUSE

2018-08-23 Thread Pino Toscano
On Thursday, 23 August 2018 17:44:21 CEST Sebastian Meyer wrote: > Hi Pino, > > On 23.08.2018 17:21, Pino Toscano wrote: > > No problem with the patch, just one question: can it happen that zypper > > may decide to install packages when removing others, e.g. to keep some

Re: [Libguestfs] [PATCH v4] v2v: Add --print-estimate option to print copy size estimate.

2018-08-23 Thread Pino Toscano
ter the number of disks, for coherency. > + let json = Filename.temp_file "v2vmeasure" ".json" in > + unlink_on_exit json; > + > + let fd = Unix.openfile json [O_WRONLY; O_CREAT; O_TRUNC] 0o600 in IMHO these can be replaced by Filename.open_temp_file + Unix.descr_o

[Libguestfs] [PATCH 2/2] builder: use the new json_parser_tree_parse_file

2018-08-23 Thread Pino Toscano
No need to read the whole file manually. --- builder/simplestreams_parser.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/simplestreams_parser.ml b/builder/simplestreams_parser.ml index ccbfdff67..407eb11fb 100644 --- a/builder/simplestreams_parser.ml +++ b/builder/s

[Libguestfs] [PATCH 1/2] mltools: JSON: add json_parser_tree_parse_file

2018-08-23 Thread Pino Toscano
Easy way to parse JSON from a file, without reading it all to string first. --- common/mltools/JSON_parser-c.c | 25 + common/mltools/JSON_parser.ml | 1 + common/mltools/JSON_parser.mli | 3 +++ common/mltools/JSON_parser_tests.ml | 23 +++

Re: [Libguestfs] [PATCH v5] v2v: Add --print-estimate option to print copy size estimate.

2018-08-24 Thread Pino Toscano
n; > + let json = json_parser_tree_parse json in I just pushed json_parser_tree_parse_file, so that can be used instead using read_whole_file. > +echo -n "Estimate: " > +cat $f > + > +# Check the output looks reasonable. > +grep -E 'total.*[[:digit:]]+' $f M

<    5   6   7   8   9   10   11   12   13   14   >