Re: [Libguestfs] [PATCH libnbd v2 2/4] generator: Check that more parameters are not NULL

2022-09-28 Thread Richard W.M. Jones
On Wed, Sep 28, 2022 at 12:47:24PM +0200, Laszlo Ersek wrote: > On 09/28/22 11:30, Richard W.M. Jones wrote: > > We previously checked only that String parameters are not NULL, > > returning an error + EFAULT if so. > > > > However we did not check Bytes*, SockAdd

Re: [Libguestfs] another GTK3 regression...

2022-09-28 Thread Richard W.M. Jones
On Wed, Sep 28, 2022 at 02:01:11PM +0200, Laszlo Ersek wrote: > (this reproduces at commit 0687cea6a86e; IOW the regression is not from > the recent GTK-related patches, but due to building p2v with GTK3. as > opposed to GTK2) > > In the first dialog, when the Test Connection button is clicked, a

[Libguestfs] [PATCH libnbd v2 4/4] lib/utils.c: Assert that argv != NULL and add comments

2022-09-28 Thread Richard W.M. Jones
Change check into an assertion, and add detailed comments explaining our assumptions. Updates: commit d0fbb769286a97728b0d1358e7accc2eb708d795 --- lib/utils.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/utils.c b/lib/utils.c index

[Libguestfs] [PATCH libnbd v2 1/4] generator: Add attribute((nonnull)) annotations to non-NULL parameters

2022-09-28 Thread Richard W.M. Jones
For API parameters that are pointers and must not be NULL, add the appropriate GCC annotations. These are only enabled in very recent GCC (>= 12) because we have concerns with earlier versions, see for example: https://bugzilla.redhat.com/show_bug.cgi?id=1041336 --- generator/C.ml | 53

[Libguestfs] [PATCH libnbd v2 2/4] generator: Check that more parameters are not NULL

2022-09-28 Thread Richard W.M. Jones
We previously checked only that String parameters are not NULL, returning an error + EFAULT if so. However we did not check Bytes*, SockAddrAndLen, Path or StringList parameters, also never NULL. Be consistent about checks. Thanks: Eric Blake for help and an earlier version of the patch ---

[Libguestfs] [PATCH libnbd v2 3/4] generator: Document non-NULL behaviour of some parameters

2022-09-28 Thread Richard W.M. Jones
In the C API documentation mention the potential problems of calling non-nullable parameters with NULL. Usually an error is returned, but warnings and worse might happen too. Thanks: Eric Blake --- docs/libnbd.pod | 18 ++ generator/C.ml | 21 + 2 files

[Libguestfs] [PATCH libnbd v2 0/4] Additional non-NULL warnings, checks and docs

2022-09-28 Thread Richard W.M. Jones
v1 was: https://listman.redhat.com/archives/libguestfs/2022-September/029982.html This series is actually quite a bit different from v1 because it is rebased on top of Eric's series and takes that into account. Generally this heads down the return error instead of asserting route, hoping that

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-28 Thread Richard W.M. Jones
n-place operation completed with no errors > root@weibupos:/home/intel/guestfs-tools/sparsify# du -sh > /home/intel/imgStore/POS_DATA.qcow2 > 55M /home/intel/imgStore/POS_DATA.qcow2 > > > -----Original Message- > From: Richard W.M. Jones > Sent: 2022年9月27日 23:04 > To:

Re: [Libguestfs] [PATCH libnbd 3/5] generator: Add attribute((nonnull)) annotations to non-NULL parameters

2022-09-27 Thread Richard W.M. Jones
On Tue, Sep 27, 2022 at 01:25:55PM -0500, Eric Blake wrote: > On Tue, Sep 27, 2022 at 03:46:19PM +0100, Richard W.M. Jones wrote: > > For API parameters that are pointers and must not be NULL, add the > > appropriate GCC annotations. These are only enabled in very recent > >

Re: [Libguestfs] [PATCH libguestfs-common] options: Don't attempt to scan LVs if "lvm2" feature is not available

2022-09-27 Thread Richard W.M. Jones
I have pushed the two patches to various places ... https://github.com/libguestfs/libguestfs/commit/c2dd84b2635bb2d9f7fb0b4ecf1e0274bfd553b1 https://github.com/libguestfs/libguestfs-common/commit/4b4a5b84647b1496d034bcdff910930ca5f5c486

Re: [Libguestfs] [p2v PATCH 1/7] "shutdown_actions": suppress "missing initializer" warnings/errors

2022-09-27 Thread Richard W.M. Jones
On Tue, Sep 27, 2022 at 04:42:00PM +0200, Laszlo Ersek wrote: > On 09/26/22 10:50, Daniel P. Berrangé wrote: > > On Mon, Sep 26, 2022 at 10:18:06AM +0200, Laszlo Ersek wrote: > >> gcc reports: > >> > >>> gui.c:1795:3: error: missing initializer for field ‘padding’ of > >>> ‘GActionEntry’ {aka

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-27 Thread Richard W.M. Jones
I have pushed the fix to libguestfs & guestfs-tools, so you should just be able to 'git pull' & recompile. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-27 Thread Richard W.M. Jones
On Tue, Sep 27, 2022 at 10:11:24PM +0800, Ming Lei wrote: > On Tue, Sep 27, 2022 at 10:42:45AM +0100, Richard W.M. Jones wrote: > > On Wed, Sep 14, 2022 at 09:47:49AM +0800, Ming Lei wrote: > > > FYI, I plan to stabilize libublksrv's API in 1.0 release, which > &g

[Libguestfs] [PATCH libnbd 2/5] generator: Rename print_extern to print_fndecl

2022-09-27 Thread Richard W.M. Jones
This function generates C function decls so name it accordingly. --- generator/C.ml | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/generator/C.ml b/generator/C.ml index f4d24b650d..013f81edf4 100644 --- a/generator/C.ml +++ b/generator/C.ml @@ -213,7 +213,7 @@ let

[Libguestfs] [PATCH libnbd 5/5] lib/connect: Avoid segfault for zero-length argv

2022-09-27 Thread Richard W.M. Jones
Eric found that passing a zero length array to nbd_connect_command or nbd_connect_systemd_socket_activation results in a segfault. This can be triggered through Python as follows: $ nbdsh -c 'h.connect_command([])' nbdsh: generator/states-connect.c:247: enter_STATE_CONNECT_COMMAND_START:

[Libguestfs] [PATCH libnbd 4/5] generator: Check that more parameters are not NULL

2022-09-27 Thread Richard W.M. Jones
We previously checked only that String parameters are not NULL, returning an error + EFAULT if so. However we did not check Bytes*, SockAddrAndLen, Path or StringList parameters, also never NULL. I'm not sure if we ought to be checking parameters for NULL like this at all (preferring instead to

[Libguestfs] [PATCH libnbd 0/5] generator: Add attribute((nonnull)) annotations

2022-09-27 Thread Richard W.M. Jones
This patch series adds nonnull annotations for parameters which should be non-NULL. There was much discussion on IRC about whether this is a good idea, pointing in particular to the bug below which is still present in modern GCC. It's better to have these discussions on list so they're archived.

[Libguestfs] [PATCH libnbd 3/5] generator: Add attribute((nonnull)) annotations to non-NULL parameters

2022-09-27 Thread Richard W.M. Jones
For API parameters that are pointers and must not be NULL, add the appropriate GCC annotations. These are only enabled in very recent GCC (>= 12) because we have concerns with earlier versions, see for example: https://bugzilla.redhat.com/show_bug.cgi?id=1041336 --- generator/C.ml | 52

[Libguestfs] [PATCH libnbd 1/5] generator: Consistent whitespace in name_of_arg function

2022-09-27 Thread Richard W.M. Jones
No change, just make the layout consistent with similar functions above. --- generator/C.ml | 45 +++-- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/generator/C.ml b/generator/C.ml index b2d46f985a..f4d24b650d 100644 --- a/generator/C.ml

[Libguestfs] [PATCH libguestfs] daemon: Make vg_scan and lvm_scan no-ops if no LVM feature

2022-09-27 Thread Richard W.M. Jones
If the LVM ("lvm2") feature is not available, these calls would fail. Really they ought to be part of the "lvm2" optgroup which would cause the generator to call reply_with_unavailable_feature and generate the correct ENOTSUP error. When vgscan was originally added in 2010 it was not added to the

[Libguestfs] [PATCH libguestfs-common] options: Don't attempt to scan LVs if "lvm2" feature is not available

2022-09-27 Thread Richard W.M. Jones
Since we added support for transparent decryption of LUKS in commit a232e62dcf ("fish: '-i' option automatically handles whole-disk encryption") we have always assumed that the "lvm2" feature is available and so we could call guestfs_vg_activate_all. That API would have failed in the unlikely

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-27 Thread Richard W.M. Jones
On Tue, Sep 27, 2022 at 11:27:34AM +, Li, Feng F wrote: > Any steps to get detail trace log to see why the LVM2 is not > available in the libguestfs? It's looking for a program called "lvm" (not the library). On Red Hat distributions this is provided by the lvm2 package, but it might be a

Re: [Libguestfs] [libnbd PATCH v3 18/18] tests: Language port of nbd_opt_structured_reply() tests

2022-09-27 Thread Richard W.M. Jones
For 14-18: Acked-by: Richard W.M. Jones 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] [libnbd PATCH v3 14/18] tests: Add coverage for nbd_set_export_name fix

2022-09-27 Thread Richard W.M. Jones
On Mon, Sep 26, 2022 at 05:05:56PM -0500, Eric Blake wrote: [...] > @@ -102,6 +99,16 @@ main (int argc, char *argv[]) > exit (EXIT_FAILURE); >} > > + /* info on something not present fails */ > + if (nbd_set_export_name (nbd, "a") == -1) { > +fprintf (stderr, "%s\n", nbd_get_error

Re: [Libguestfs] [libnbd PATCH v3 13/18] api: Reset state on changed nbd_set_export_name()

2022-09-27 Thread Richard W.M. Jones
(export_name); > if (!new_name) { > set_error (errno, "strdup"); > @@ -240,6 +243,7 @@ nbd_unlocked_set_export_name (struct nbd_handle *h, const > char *export_name) > >free (h->export_name); >h->export_name = new_name; > + nbd_internal_rese

Re: [Libguestfs] [libnbd PATCH v3 12/18] tests: Add coverage for stateless nbd_opt_list_meta_context

2022-09-27 Thread Richard W.M. Jones
For patches 3-12: Acked-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows

Re: [Libguestfs] [libnbd PATCH v3 01/18] api: Fix crashes on nbd_connect_command with bad argv

2022-09-27 Thread Richard W.M. Jones
On Mon, Sep 26, 2022 at 05:05:43PM -0500, Eric Blake wrote: > nbd_connect_command (h, (char **) { NULL }) triggers SIGABRT when > preparing to exec a NULL command name (during > enter_STATE_CONNECT_COMMAND_START in v1.0). > > nbd_connect_command (h, NULL) in newer releases triggers SIGSEGV by >

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-27 Thread Richard W.M. Jones
On Tue, Sep 27, 2022 at 10:42:45AM +0100, Richard W.M. Jones wrote: > On Wed, Sep 14, 2022 at 09:47:49AM +0800, Ming Lei wrote: > > FYI, I plan to stabilize libublksrv's API in 1.0 release, which > > shouldn't take long. > > > > And recently I did some API change

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-27 Thread Richard W.M. Jones
On Wed, Sep 14, 2022 at 09:47:49AM +0800, Ming Lei wrote: > FYI, I plan to stabilize libublksrv's API in 1.0 release, which > shouldn't take long. > > And recently I did some API changes, so suggest you to update with > it in both nbdublk and libublksrv. Just got around to looking at the changes

Re: [Libguestfs] [p2v PATCH 7/7] gui.c: annotate GTK_INPUT_PURPOSE_PASSWORD with upstream GTK3 version

2022-09-26 Thread Richard W.M. Jones
Apart from Dan's suggestions in patch 1, the series looks good to me. FWIW RHEL 7 (the earliest distro with PCRE 2) has glib2 2.56.1 & gtk3 3.22.30, so supporting any earlier versions also seems pointless, so that might be another thing to review. We could make USE_POPOVERS unconditional, and

Re: [Libguestfs] [p2v PATCH 1/7] "shutdown_actions": suppress "missing initializer" warnings/errors

2022-09-26 Thread Richard W.M. Jones
On Mon, Sep 26, 2022 at 09:50:48AM +0100, Daniel P. Berrangé wrote: > On Mon, Sep 26, 2022 at 10:18:06AM +0200, Laszlo Ersek wrote: > > gcc reports: > > > > > gui.c:1795:3: error: missing initializer for field ‘padding’ of > > > ‘GActionEntry’ {aka ‘const struct _GActionEntry’} > > >

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-26 Thread Richard W.M. Jones
On Sun, Sep 25, 2022 at 08:21:19AM +0200, Laszlo Ersek wrote: > On 09/23/22 16:19, Richard W.M. Jones wrote: > > From 98f0b3565457c08d14e1f9ab2acecea003ebf6e1 Mon Sep 17 00:00:00 2001 > > From: "Richard W.M. Jones" > > Date: Fri, 23 Sep 2022 15:18:43 +0100 >

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-23 Thread Richard W.M. Jones
On Fri, Sep 23, 2022 at 03:19:47PM +0100, Richard W.M. Jones wrote: > On Fri, Sep 23, 2022 at 02:03:45PM +, Li, Feng F wrote: > > The log output from command " ./virt-sparsify --inplace -v -x > > /home/intel/imgStore/POS_DATA.qcow2" > > Thanks. This

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-23 Thread Richard W.M. Jones
tch to libguestfs/common ? Rich. > > -Original Message- > From: Richard W.M. Jones > Sent: 2022年9月23日 20:07 > To: Li, Feng F > Cc: libguestfs@redhat.com > Subject: Re: can not get the virt-sparsify code in libguestfs ? > > On Fri, Sep 23, 2022 at 11:37:01AM

Re: [Libguestfs] redhat 7.6 on intel ice lake sp kvm got error

2022-09-23 Thread Richard W.M. Jones
: Checking for cgroup 'blkio' controller mount-point : > PASS >LXC: Checking if device /sys/fs/fuse/connections exists : > FAIL (Load the 'fuse' module to enable /proc/ overrides) > > same X86 server with redhat 8.4 has no problem. That's th

Re: [Libguestfs] redhat 7.6 on intel ice lake sp kvm got error

2022-09-23 Thread Richard W.M. Jones
On Fri, Sep 23, 2022 at 09:05:31PM +0800, mark wrote: > Dear >On redhat 7.6 OS with intel ice lake cpu like : > _ > [root@localhost ~]# lscpu > Architecture: x86_64 > CPU op-mode(s):32-bit, 64-bit > Byte

Re: [Libguestfs] [p2v PATCH 15/15] virt-p2v.pod: explain how to bring iSCSI LUNs to the disk selection dialog

2022-09-23 Thread Richard W.M. Jones
On Fri, Sep 23, 2022 at 02:36:14PM +0200, Laszlo Ersek wrote: > On 09/23/22 12:14, Laszlo Ersek wrote: > > On 09/23/22 11:54, Richard W.M. Jones wrote: > > >> (2) Should we drop Gtk2 support? I kept this around to allow virt-p2v > >> to be compiled on RHEL <= 6

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-23 Thread Richard W.M. Jones
? Difficult to say. What is the complete output from virt-sparsify -v -x ? Rich. > > > [cid] > > > > > > Thanks a lot ! > > lifeng > > > > -Original Message- > From: Richard W.M. Jones > Sent: 2022年9月22日 21:00 >

Re: [Libguestfs] [p2v PATCH 15/15] virt-p2v.pod: explain how to bring iSCSI LUNs to the disk selection dialog

2022-09-23 Thread Richard W.M. Jones
ACK series, but see my comment about patch 14. A couple of other general points: (1) You could copy the vector type from nbdkit if that would help with handling lists of strings. (2) Should we drop Gtk2 support? I kept this around to allow virt-p2v to be compiled on RHEL <= 6. RHEL 5 in

Re: [Libguestfs] [p2v PATCH 14/15] create_conversion_dialog(): add button to refresh disks & removables

2022-09-23 Thread Richard W.M. Jones
On Mon, Sep 19, 2022 at 03:35:10PM +0200, Laszlo Ersek wrote: > +At the bottom of the dialog, the C button instructs > +virt-p2v to re-enumerate the fixed hard disks and the removable media > +drives. (Note that the button will also reset the currently active > +selections in both of those

Re: [Libguestfs] [p2v PATCH 08/15] set_config_defaults(): clean up some warts

2022-09-23 Thread Richard W.M. Jones
On Mon, Sep 19, 2022 at 03:35:04PM +0200, Laszlo Ersek wrote: > The statement > > if (!test_disk) { /* block A */ } else { /* block B */ } > > is needlessly complex; drop the logical negation in exchange for > reordering the branches: > > if (test_disk) { /* block B */ } else { /* block A

Re: [Libguestfs] [p2v PATCH 4/4] ssh.c: fix crash in "v2v_version" lifecycle management

2022-09-23 Thread Richard W.M. Jones
ACK series... Although if I was going to quibble, GNU code tends to use *_p to indicate a predicate (following the LISP convention [1]), whereas I think your meaning is "private to function", so maybe that's confusing to some. Rich. [1]

Re: [Libguestfs] can not get the virt-sparsify code in libguestfs ?

2022-09-22 Thread Richard W.M. Jones
On Thu, Sep 22, 2022 at 11:48:17AM +, Li, Feng F wrote: > 2) https://libguestfs.org/virt-sparsify.1.html > > we downloaded the libguestfs (1.48-stable) library ,but after the > configure and make, we did not found the virt-sparsify source code > and binary file, would you please help see where

Re: [Libguestfs] Libguestfs + e2fsprogs

2022-09-13 Thread Richard W.M. Jones
e's any easy way around this. Rich. > On Tue, 13 Sep, 2022, 8:37 pm Richard W.M. Jones, wrote: > > On Tue, Sep 13, 2022 at 08:26:26PM +0530, Jevin Gala wrote: > > Hi, > > > > Using latest libguestfs won't be possible since I want NTFS support too. >

Re: [Libguestfs] Libguestfs + e2fsprogs

2022-09-13 Thread Richard W.M. Jones
n will pick it up. Rich. > > On Tue, 13 Sep, 2022, 8:19 pm Richard W.M. Jones, wrote: > > On Tue, Sep 13, 2022 at 07:50:35PM +0530, Jevin Gala wrote: > > Hi, > > > > > > Thank you for your response. > > > > You mean

Re: [Libguestfs] ZFS-on-NBD

2022-09-13 Thread Richard W.M. Jones
As an aside, we'll soon be adding the feature to use nbdkit plugins as Linux ublk (userspace block) devices. The API is nearly the same so there's just a bit of code needed to let nbdkit plugins be loaded by ubdsrv. Watch this space. Of course it may not (probably will not) fix other problems

Re: [Libguestfs] Libguestfs + e2fsprogs

2022-09-13 Thread Richard W.M. Jones
using file :  hostfiles ? If there are particular files that you want to copy to the appliance you might do something like: # cat > /usr/lib64/supermin.d/guestfs/zz-extra-files < > On Tue, Sep 13, 2022 at 7:20 PM Richard W.M. Jones wrote: > > On Mon, Sep 12, 2022 at 06:52:3

Re: [Libguestfs] Libguestfs + e2fsprogs

2022-09-13 Thread Richard W.M. Jones
On Mon, Sep 12, 2022 at 06:52:34PM +0530, Jevin Gala wrote: > Hi, > > > I wanted to use a higher version of e2fsprogs (1.45) with libguestfs 1.28. > Can I get some information on how I can proceed or use the one compiled on the > server separately ? Supermin just uses whatever version of

Re: [Libguestfs] [p2v PATCH v2 0/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-09 Thread Richard W.M. Jones
On Fri, Sep 09, 2022 at 02:53:11PM +0200, Laszlo Ersek wrote: > On 09/09/22 13:51, Richard W.M. Jones wrote: > > On Fri, Sep 09, 2022 at 11:10:47AM +0200, Laszlo Ersek wrote: > >> On 09/08/22 18:27, Laszlo Ersek wrote: > >>> Bugzilla: https://bugzilla.redhat.com/sh

Re: [Libguestfs] [libnbd PATCH 2/4] generator: Add RUInt64 for 64-bit counters without error

2022-09-09 Thread Richard W.M. Jones
On Tue, Sep 06, 2022 at 04:08:20AM -0500, Eric Blake wrote: > If we later find ourselves needing an actual 64-bit unsigned value, > unrelated to counters, we can add RCounter at that point and > repurpose RUInt64 to the new purpose. We've done that sort of enum > splitting before; the enum names

Re: [Libguestfs] [p2v PATCH v2 0/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-09 Thread Richard W.M. Jones
On Fri, Sep 09, 2022 at 11:10:47AM +0200, Laszlo Ersek wrote: > On 09/08/22 18:27, Laszlo Ersek wrote: > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721 > > v1: > > https://listman.redhat.com/archives/libguestfs/2022-September/029806.html > > > > Please see the Notes

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Richard W.M. Jones
(Adding Dan for input) On Thu, Sep 08, 2022 at 03:23:41PM +0200, Laszlo Ersek wrote: > On 09/08/22 10:03, Richard W.M. Jones wrote: > > On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: > >> + "p2v.vcpu.dense_topo" => manual_entry->new( &

Re: [Libguestfs] [p2v PATCH 6/6] Makefile.am: set vCPU topology to 1*2*2 in the "p2v in a VM" tests

2022-09-08 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 01:25:31PM +0200, Laszlo Ersek wrote: > This lets us exercise both states of the "p2v.vcpu.dense_topo" switch > sensibly via the in-VM GUI. > > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1590721 > Signed-off-by: Laszlo Ersek > --- > Makefile.am | 2 ++ > 1

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 01:25:27PM +0200, Laszlo Ersek wrote: > + "p2v.vcpu.dense_topo" => manual_entry->new( > +shortopt => "", # ignored for booleans > +description => " > +Copy the physical machine's CPU topology, densely populated, to the > +guest. Disabled by default. If disabled,

Re: [Libguestfs] [p2v PATCH 4/6] gui: offer copying the vCPU topology from the fully populated physical one

2022-09-08 Thread Richard W.M. Jones
@ -1577,6 +1613,12 @@ vcpus_or_memory_check_callback (GtkWidget *w, gpointer > data) > gtk_label_set_text (GTK_LABEL (target_warning_label), ""); > } > > +static bool > +get_dense_topo_from_conv_dlg (void) > +{ > + return gtk_toggle_button_get

Re: [Libguestfs] [p2v PATCH 3/6] gui: set row count from a running variable when populating tables

2022-09-08 Thread Richard W.M. Jones
0, 1, 3, 4, GTK_FILL, GTK_FILL, 1, 1); > +0, 1, row, GTK_FILL, GTK_FILL, 1, 1); >set_alignment (of_label, 1., 0.5); >of_entry = gtk_entry_new (); >gtk_label_set_mnemonic_widget (GTK_LABEL (of_label), of_entry); > @@ -854,11 +868,12 @@ create_con

Re: [Libguestfs] [p2v PATCH 2/6] restrict vCPU topology to (a) fully populated physical, or (b) 1 * N * 1

2022-09-08 Thread Richard W.M. Jones
element ("model") { > + attribute ("fallback", "allow"); > + string (config->cpu.model); > +} end_element (); > + } > + start_element ("topology") { > +attribute_format ("sockets&q

Re: [Libguestfs] [libnbd PATCH 4/4] tests: Add language binding tests for stats reception

2022-09-08 Thread Richard W.M. Jones
On Tue, Sep 06, 2022 at 04:19:40AM -0500, Eric Blake wrote: > > > + assert (cr3 = (Int64.add cr2 fudge)) > > Not so in OCaml, where + isn't even polymorphic to int64, so I have to > break out manual calls to Int64.XXX methods. Here, I went with a > helper variable 'fudge'. No implicit type

Re: [Libguestfs] [libnbd PATCH 2/2] debug: Trace even may_set_error=false functions

2022-09-05 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 02:41:57PM -0500, Eric Blake wrote: > On Sun, Sep 04, 2022 at 05:44:33PM +0100, Richard W.M. Jones wrote: > > > > So my feeling about this patch series: > > > > I don't understand why the first patch is necessary, _and_ I think it > >

Re: [Libguestfs] [libnbd PATCH 3/4] api: Add new nbd_stats_*() statistics counters

2022-09-05 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 02:12:24PM +0200, Laszlo Ersek wrote: > On 09/03/22 18:30, Richard W.M. Jones wrote: > > On Fri, Sep 02, 2022 at 05:14:24PM -0500, Eric Blake wrote: > >> I was trying to write a test that determined whether a failure was due > >> to a short-circ

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-05 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 08:06:24PM +0800, Ming Lei wrote: > On Fri, Sep 02, 2022 at 09:06:27AM +0100, Richard W.M. Jones wrote: > > On Thu, Sep 01, 2022 at 12:14:40PM +0100, Richard W.M. Jones wrote: > > > On Thu, Sep 01, 2022 at 04:01:39PM +0800, Ming Lei wrote: > > >

Re: [Libguestfs] [libnbd PATCH] copy: Write progress to stderr, not /dev/tty

2022-09-05 Thread Richard W.M. Jones
On Mon, Sep 05, 2022 at 11:01:52AM +0200, Laszlo Ersek wrote: > On 09/02/22 21:53, Eric Blake wrote: > > On Fri, Sep 02, 2022 at 06:58:53PM +0100, Richard W.M. Jones wrote: > >> On Fri, Sep 02, 2022 at 10:25:38AM -0500, Eric Blake wrote: > >>> dd writ

Re: [Libguestfs] [libnbd PATCH 2/2] debug: Trace even may_set_error=false functions

2022-09-04 Thread Richard W.M. Jones
So my feeling about this patch series: I don't understand why the first patch is necessary, _and_ I think it might be "dangerous" (for small values of dangerous). What happens if in future we add a new RStaticString API which returns a string that does need to be escaped? It should at least

[Libguestfs] IRC question about error while loading shared libraries: libgcrypt.so.20

2022-09-04 Thread Richard W.M. Jones
Ran libguestfs-test-tool and got lots of output, the pertinent line being: 15:55 < Scamdotnet> guestfsd: error while loading shared libraries: libgcrypt.so.20: cannot open shared object file: No such file or directory (https://pastebin.com/9PgqEPuq) 16:17 < rwmjones> Scamdotnet: ok I see

Re: [Libguestfs] [libnbd PATCH 4/4] tests: Add language binding tests for stats reception

2022-09-03 Thread Richard W.M. Jones
So the patch series is OK, modulo my comments. But I think it'd be better not to bind our future selves to complicated guarantees about what are basically internal details of the library and protocol. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read

Re: [Libguestfs] [libnbd PATCH 3/4] api: Add new nbd_stats_*() statistics counters

2022-09-03 Thread Richard W.M. Jones
On Fri, Sep 02, 2022 at 05:14:24PM -0500, Eric Blake wrote: > I was trying to write a test that determined whether a failure was due > to a short-circuit test on the client side or an actual failure > returned by the server. Such a test is a lot easier if we can watch > status counters increase

Re: [Libguestfs] [libnbd PATCH 1/4] internal: Track traffic stats

2022-09-03 Thread Richard W.M. Jones
On Fri, Sep 02, 2022 at 05:14:22PM -0500, Eric Blake wrote: > #ifdef DUMP_PACKETS > - if (h->rbuf != NULL) > -nbd_internal_hexdump (h->rbuf, r, stderr); > + nbd_internal_hexdump (h->rbuf, r, stderr); Should this be a separate patch? I guess the assertion here is that h->rbuf is set to an

Re: [Libguestfs] [libnbd PATCH] copy: Write progress to stderr, not /dev/tty

2022-09-02 Thread Richard W.M. Jones
On Fri, Sep 02, 2022 at 10:25:38AM -0500, Eric Blake wrote: > dd writes progress messages to stderr, with no complaints. Having > nbdcopy open /dev/tty instead of reusing stderr to write messages > litters the output of a terminal during an interactive 'make check', > which is rather distracting,

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-02 Thread Richard W.M. Jones
FYI, nbdublk is now available in Fedora Rawhide, along with the dependencies liburing 2.2 and ubdsrv. https://koji.fedoraproject.org/koji/buildinfo?buildID=2056223 Thanks for your help. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-02 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 12:14:40PM +0100, Richard W.M. Jones wrote: > On Thu, Sep 01, 2022 at 04:01:39PM +0800, Ming Lei wrote: > > Maybe you should use one nbd disk, which has the closest code path > > with nbdublk. > > Good idea - I have started a heavy test using nb

Re: [Libguestfs] [libnbd PATCH v2 04/12] api: Add nbd_set_request_meta_context()

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 03:38:34PM -0500, Eric Blake wrote: > On Thu, Sep 01, 2022 at 05:29:21PM +0100, Richard W.M. Jones wrote: > > On Wed, Aug 31, 2022 at 09:39:20AM -0500, Eric Blake wrote: > > > Add a new control knob nbd_set_request_meta_context(), modeled after

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 02:55:45PM -0500, Eric Blake wrote: > On Thu, Sep 01, 2022 at 05:17:14PM +0100, Richard W.M. Jones wrote: > > > > > > [*]It's easier to skip on server failure than to try and write an > > > nbdkit patch to add yet another --config feature pro

Re: [Libguestfs] [libnbd PATCH] RFC: api: Add nbd_supports_vsock()

2022-09-01 Thread Richard W.M. Jones
stem, this returns true if there is compile-time > support, but you may still need runtime support for some aspects > of AF_VSOCK usage; for example, use of C as the > server name requires that the I kernel module is > loaded. You can use paragraphs (and even subheadings) in the POD here if

Re: [Libguestfs] [libnbd PATCH v2 04/12] api: Add nbd_set_request_meta_context()

2022-09-01 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 09:39:20AM -0500, Eric Blake wrote: > Add a new control knob nbd_set_request_meta_context(), modeled after > the existing nbd_set_request_structured_replies(), to make it possible > to skip the NBD_OPT_SET_META_CONTEXT half of the two-command sequence > currently performed

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 11:21:38AM +0200, Laszlo Ersek wrote: > On 08/31/22 16:39, Eric Blake wrote: > > Upstream NBD clarified (see NBD commit 13a4e33a8) that since > > NBD_OPT_LIST_META_CONTEXT is stateless on the server side, it is > > acceptable (but not mandatory) for servers to accept it

Re: [Libguestfs] [libnbd PATCH v2 03/12] api: Allow nbd_opt_list_meta_context without SR

2022-09-01 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 09:39:19AM -0500, Eric Blake wrote: > Upstream NBD clarified (see NBD commit 13a4e33a8) that since > NBD_OPT_LIST_META_CONTEXT is stateless on the server side, it is > acceptable (but not mandatory) for servers to accept it without the > client having pre-negotiated

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 04:01:39PM +0800, Ming Lei wrote: > Maybe you should use one nbd disk, which has the closest code path > with nbdublk. Good idea - I have started a heavy test using nbd.ko as the backing. Let's see what happens after 12 hours or more. Rich. -- Richard Jones,

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Richard W.M. Jones
On Thu, Sep 01, 2022 at 11:26:10AM +0800, Ming Lei wrote: > On Wed, Aug 31, 2022 at 04:06:16PM +0100, Richard W.M. Jones wrote: > > I have also added the changes to Fedora: > > > > https://koji.fedoraproject.org/koji/taskinfo?taskID=91468555 > > > > Please consi

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-09-01 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 11:22:04AM +0100, Richard W.M. Jones wrote: > > After running those tests for an hour or two I got a nasty kernel > memory corruption issue in the test VM, see attached. Another one from running overnight. Rich. -- Richard Jones, Virtualization Group, Red

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-31 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 10:49:42PM +0800, Ming Lei wrote: > On Wed, Aug 31, 2022 at 5:41 PM Richard W.M. Jones wrote: > > > > On Wed, Aug 31, 2022 at 05:29:13PM +0800, Ming Lei wrote: > > > I can reproduce it, please try the top patch in aio branch, which fixed >

Re: [Libguestfs] [p2v PATCH 1/4] Makefile.am: factor out "make-physical-machine.sh"

2022-08-31 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 08:59:15AM +0200, Laszlo Ersek wrote: > Now, whether this kills "set -e" for me for good... I'm not so sure. I'm > trying to think up a shell function that I would want to (a) call from > an outer conditional context, and at the same time (b) cause the whole > script to

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-31 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 06:33:25PM +0800, Ming Lei wrote: > On Wed, Aug 31, 2022 at 11:22:04AM +0100, Richard W.M. Jones wrote: > > > > After running those tests for an hour or two I got a nasty kernel > > memory corruption issue in the test VM, see attached. > > >

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-31 Thread Richard W.M. Jones
After running those tests for an hour or two I got a nasty kernel memory corruption issue in the test VM, see attached. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-31 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 05:29:13PM +0800, Ming Lei wrote: > I can reproduce it, please try the top patch in aio branch, which fixed > hang in my reproducer with your test setting. > > https://github.com/ming1/ubdsrv/commits/aio

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-31 Thread Richard W.M. Jones
On Wed, Aug 31, 2022 at 09:45:45AM +0800, Ming Lei wrote: > On Tue, Aug 30, 2022 at 05:13:46PM +0100, Richard W.M. Jones wrote: > > On Tue, Aug 30, 2022 at 11:29:26PM +0800, Ming Lei wrote: > > > On Tue, Aug 30, 2022 at 03:38:50PM +0100, Richard W.M. Jones wrote: > > > &

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-30 Thread Richard W.M. Jones
On Tue, Aug 30, 2022 at 11:29:26PM +0800, Ming Lei wrote: > On Tue, Aug 30, 2022 at 03:38:50PM +0100, Richard W.M. Jones wrote: > > On Tue, Aug 30, 2022 at 03:12:23PM +0800, Ming Lei wrote: > > > The patch sent in last email may cause io hang on MQ, and follows the > &g

Re: [Libguestfs] Benchmarks of asynch nbdublk

2022-08-30 Thread Richard W.M. Jones
On Tue, Aug 30, 2022 at 01:43:17PM +0200, Laszlo Ersek wrote: > On 08/27/22 19:40, Richard W.M. Jones wrote: > > Alright, so final version for now is here: > > > > https://gitlab.com/rwmjones/libnbd/-/tree/nbdublk/ublk > > I'm slightly interested to review this, but

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-30 Thread Richard W.M. Jones
On Tue, Aug 30, 2022 at 03:12:23PM +0800, Ming Lei wrote: > The patch sent in last email may cause io hang on MQ, and follows the fixed > version: I split this into two commits and cleaned them up and posted them here: https://gitlab.com/rwmjones/libnbd/-/commits/nbdublk/ Unfortunately this

Re: [Libguestfs] [libnbd PATCH 1/2] api: Better use of nbd_internal_reset_size_and_flags

2022-08-30 Thread Richard W.M. Jones
On Tue, Aug 30, 2022 at 01:16:02PM +0200, Laszlo Ersek wrote: > Thanks for the explanation. I didn't expect these two principles to have > driven the design (generability, and long-term convenience calls). I > think the more usual (albeit likely less programmer-friendly) approach > is to (a)

Re: [Libguestfs] [p2v PATCH 4/4] Makefile.am: speed up the boot phase of the "virt-p2v in a VM" tests

2022-08-30 Thread Richard W.M. Jones
Series looks good, thanks. Reviewed-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build

Re: [Libguestfs] [p2v PATCH 1/4] Makefile.am: factor out "make-physical-machine.sh"

2022-08-30 Thread Richard W.M. Jones
On Fri, Aug 26, 2022 at 07:39:31AM -0500, Eric Blake wrote: > On Fri, Aug 26, 2022 at 01:39:05PM +0200, Laszlo Ersek wrote: > > Extract and somewhat generalize the recipe for the $(PHYSICAL_MACHINE) > > target to a separate shell script. In preparation for the multiple steps > > we're going to

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-30 Thread Richard W.M. Jones
On Tue, Aug 30, 2022 at 05:38:35PM +0800, Ming Lei wrote: > nbd work thread is created by nbd target code just like before, but > the thread is changed to the following way, basically bound with one > aio_ctx: > while (!ublksrv_aio_ctx_dead(aio_ctx)) { > struct aio_list compl; > >

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-30 Thread Richard W.M. Jones
On Tue, Aug 30, 2022 at 04:30:40PM +0800, Ming Lei wrote: > On Tue, Aug 30, 2022 at 09:04:07AM +0100, Richard W.M. Jones wrote: > > On Tue, Aug 30, 2022 at 10:32:02AM +0800, Ming Lei wrote: > > > Hi Jones, > > > > > > On Thu, Aug 25, 2022 at 01:10:

Re: [Libguestfs] [PATCH libnbd] ublk: Add new nbdublk program

2022-08-30 Thread Richard W.M. Jones
On Tue, Aug 30, 2022 at 10:32:02AM +0800, Ming Lei wrote: > Hi Jones, > > On Thu, Aug 25, 2022 at 01:10:55PM +0100, Richard W.M. Jones wrote: > > This patch adds simple support for a ublk-based NBD client. > > It is also available here: > > https://gitlab.com/rwmjones

Re: [Libguestfs] Benchmarks of asynch nbdublk (was: Re: [PATCH libnbd] ublk: Add new nbdublk program)

2022-08-29 Thread Richard W.M. Jones
nbdublk is marginally faster than nbd.ko, although the difference is small enough to probably be measurement error: nbdublk real18m20.767s user114m57.705s sys 20m29.502s nbd.ko real18m52.872s user117m0.274s sys 21m35.187s Rich. -- Richard Jones, Virtualization Group,

Re: [Libguestfs] Benchmarks of asynch nbdublk (was: Re: [PATCH libnbd] ublk: Add new nbdublk program)

2022-08-28 Thread Richard W.M. Jones
On Sun, Aug 28, 2022 at 04:39:07PM +0100, Richard W.M. Jones wrote: > Performance was within 25% of disk access over virtio-scsi, which I > think is pretty good. BTW we had a GSoC student last summer who was supposed to work on adding io_uring support to libnbd. Unfortunately they

Re: [Libguestfs] Benchmarks of asynch nbdublk (was: Re: [PATCH libnbd] ublk: Add new nbdublk program)

2022-08-28 Thread Richard W.M. Jones
On Sun, Aug 28, 2022 at 04:39:07PM +0100, Richard W.M. Jones wrote: > On Sun, Aug 28, 2022 at 11:21:25PM +0800, Ming Lei wrote: > > On Sat, Aug 27, 2022 at 06:40:29PM +0100, Richard W.M. Jones wrote: > > > Alright, so final version for now is here: > > > > > >

Re: [Libguestfs] Benchmarks of asynch nbdublk (was: Re: [PATCH libnbd] ublk: Add new nbdublk program)

2022-08-28 Thread Richard W.M. Jones
On Sun, Aug 28, 2022 at 11:21:25PM +0800, Ming Lei wrote: > On Sat, Aug 27, 2022 at 06:40:29PM +0100, Richard W.M. Jones wrote: > > Alright, so final version for now is here: > > > > https://gitlab.com/rwmjones/libnbd/-/tree/nbdublk/ublk > > Just clone the above bran

Re: [Libguestfs] Benchmarks of asynch nbdublk (was: Re: [PATCH libnbd] ublk: Add new nbdublk program)

2022-08-27 Thread Richard W.M. Jones
Alright, so final version for now is here: https://gitlab.com/rwmjones/libnbd/-/tree/nbdublk/ublk I resolved the data corruption problem once I realised that ->handle_event must only retire commands which are on the same queue (obvious in hindsight). I ran a parallel job overnight where I did

Re: [Libguestfs] shebang usage in bash scripts

2022-08-26 Thread Richard W.M. Jones
On Fri, Aug 26, 2022 at 07:29:34AM -0500, Eric Blake wrote: > On Thu, Aug 25, 2022 at 02:35:47PM +0100, Richard W.M. Jones wrote: > > On Thu, Aug 25, 2022 at 03:32:15PM +0200, Laszlo Ersek wrote: > > > Hi, > > > > > > most shell scripts in the v2

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