Re: [Libguestfs] [PATCH v2v] convert: Allow preferred block driver to be specified on the command line

2023-03-07 Thread Richard W.M. Jones
On Tue, Mar 07, 2023 at 08:48:56AM +0100, Laszlo Ersek wrote: > On 3/6/23 17:52, Richard W.M. Jones wrote: > > > diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml > > index 9d8d271d05..f36b486359 100644 > > --- a/convert/convert_windows.ml > > ++

[Libguestfs] [PATCH v2v] convert: Allow preferred block driver to be specified on the command line

2023-03-06 Thread Richard W.M. Jones
--- docs/virt-v2v.pod | 10 ++ convert/convert.mli | 1 + convert/convert_linux.mli | 3 ++- convert/convert_windows.mli | 3 ++- convert/convert.ml | 9 ++--- convert/convert_linux.ml| 2 +- convert/convert_windows.ml | 12 +++-

[Libguestfs] [PATCH v2v] convert: Allow preferred block driver to be specified on the command line

2023-03-06 Thread Richard W.M. Jones
This is just an outline patch, only compile tested. It doesn't make changes to virt-v2v-in-place, but those would be the same as made in v2v/v2v.ml. It reuses the existing Types.guestcaps_block_type which is a bit ugly but fairly practical. I've made the change to the documentation, but it

[Libguestfs] [PATCH common] mlcustomize: Add accessors for block driver priority list

2023-03-06 Thread Richard W.M. Jones
When injecting virtio-win drivers, allow the list of block drivers that we search to be modified. --- mlcustomize/inject_virtio_win.ml | 12 +--- mlcustomize/inject_virtio_win.mli | 10 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git

Re: [Libguestfs] [PATCH] docs: Prefer 'cookie' over 'handle'

2023-03-04 Thread Richard W.M. Jones
okie'. Copy that approach into the NBD spec, and make it > obvious that a cookie is opaque data from the point of view of the > server. Makes no difference to implementations (other than older code > still using 'handle' may be slightly harder to tie back to the spec). > > Sugge

Re: [Libguestfs] [nbdkit PATCH 0/9] common: catch up with libnbd

2023-03-03 Thread Richard W.M. Jones
This series looks, great, thanks! ACK 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] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-03 Thread Richard W.M. Jones
On Thu, Mar 02, 2023 at 11:31:14PM +0200, Andrey Drobyshev wrote: > On 3/2/23 22:59, Richard W.M. Jones wrote: > > On Thu, Mar 02, 2023 at 08:52:33PM +0200, Andrey Drobyshev wrote: > >> On 3/2/23 20:36, Richard W.M. Jones wrote: > >>> I can probably do an

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-02 Thread Richard W.M. Jones
On Thu, Mar 02, 2023 at 08:52:33PM +0200, Andrey Drobyshev wrote: > On 3/2/23 20:36, Richard W.M. Jones wrote: > > I can probably do an outline of a patch if you need it, but > > not today. > > Yes, sure. But speaking of the ways to influence the behaviour of a > command

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-03-02 Thread Richard W.M. Jones
On Thu, Mar 02, 2023 at 08:15:37PM +0200, Andrey Drobyshev wrote: > On 2/28/23 16:39, Richard W.M. Jones wrote: > > On Tue, Feb 28, 2023 at 03:24:46PM +0100, Laszlo Ersek wrote: > >> On 2/28/23 14:01, Richard W.M. Jones wrote: > >>> On Wed, Feb 22, 2023 at 08:20:43PM

Re: [Libguestfs] [nbdkit PATCH 0/5] ci: Get to green status on FreeBSD and MacOS

2023-03-02 Thread Richard W.M. Jones
ACK series, thanks for fixing this. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit

Re: [Libguestfs] Checksums and other verification

2023-03-02 Thread Richard W.M. Jones
On Mon, Feb 27, 2023 at 07:09:33PM +0200, Nir Soffer wrote: > On Mon, Feb 27, 2023 at 6:41 PM Richard W.M. Jones wrote: > > I think it would be more useful if (or in addition) it could compute > > the checksum of a stream which is being converted with 'qemu-img > > co

Re: [Libguestfs] [libnbd PATCH 6/6] common/include: Fix MIN and MAX macros so they can be nested [finish port]

2023-03-01 Thread Richard W.M. Jones
While I normally port across dependent changes too (eg you mention that libnbd doesn't have get-current-dir-name.h - I would have ported the commit that introduced that too, even though it's not used except by the test), I'm also not that fussed. These are separate projects and as long as the

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-02-28 Thread Richard W.M. Jones
On Tue, Feb 28, 2023 at 03:24:46PM +0100, Laszlo Ersek wrote: > On 2/28/23 14:01, Richard W.M. Jones wrote: > > On Wed, Feb 22, 2023 at 08:20:43PM +0200, Andrey Drobyshev wrote: > >> Since commits b28cd1dc ("Remove requested_guestcaps / rcaps"), f0afc439 > &

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-02-28 Thread Richard W.M. Jones
On Wed, Feb 22, 2023 at 08:20:43PM +0200, Andrey Drobyshev wrote: > Since commits b28cd1dc ("Remove requested_guestcaps / rcaps"), f0afc439 > ("Remove guestcaps_block_type Virtio_SCSI") support for installing > virtio-scsi driver is missing in virt-v2v. AFAIU plans and demands for > bringing this

Re: [Libguestfs] [libnbd PATCH v5 0/5] vector: introduce DEFINE_POINTER_VECTOR_TYPE()

2023-02-28 Thread Richard W.M. Jones
Thanks for this series. I checked it upstream & it looks great. 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 machines. Supports shell scripting,

Re: [Libguestfs] Checksums and other verification

2023-02-28 Thread Richard W.M. Jones
On Tue, Feb 28, 2023 at 12:24:04PM +0100, Laszlo Ersek wrote: > On 2/27/23 17:44, Richard W.M. Jones wrote: > > On Mon, Feb 27, 2023 at 08:42:23AM -0600, Eric Blake wrote: > >> Or intentionally choose a hash that can be computed out-of-order, such > >> as a Merkle Tree

Re: [Libguestfs] Checksums and other verification

2023-02-27 Thread Richard W.M. Jones
On Mon, Feb 27, 2023 at 08:42:23AM -0600, Eric Blake wrote: > Or intentionally choose a hash that can be computed out-of-order, such > as a Merkle Tree. But we'd need a standard setup for all parties to > agree on how the hash is to be computed and checked, if it is going to > be anything more

Re: [Libguestfs] Checksums and other verification

2023-02-27 Thread Richard W.M. Jones
On Mon, Feb 27, 2023 at 04:24:33PM +0200, Nir Soffer wrote: > On Mon, Feb 27, 2023 at 3:56 PM Richard W.M. Jones wrote: > > > > > > https://github.com/kubevirt/containerized-data-importer/issues/1520 > > > > Hi Eric, > > > > We had a question from

[Libguestfs] Checksums and other verification

2023-02-27 Thread Richard W.M. Jones
https://github.com/kubevirt/containerized-data-importer/issues/1520 Hi Eric, We had a question from the Kubevirt team related to the above issue. The question is roughly if it's possible to calculate the checksum of an image as an nbdkit filter and/or in the qemu block layer. Supplemental #1:

Re: [Libguestfs] [PATCH nbdkit] curl: Try to share as much as possible between handles in the pool

2023-02-26 Thread Richard W.M. Jones
On Wed, Feb 22, 2023 at 03:01:45PM +, Richard W.M. Jones wrote: > I'm mainly posting this to the list as a back-up. It does work, it > does _not_ improve performance in any noticable way. However I'm > having lots of trouble getting HTTP/2 to work (with or without this > patch

Re: [Libguestfs] no way to force-close NBD handle in nbdsh

2023-02-25 Thread Richard W.M. Jones
And after this commit: https://gitlab.com/nbdkit/libnbd/-/commit/3a49373a78a611af7497f76b797c78d612f47c84 You can use a with-style to automatically close the handle: with nbd.nbd() as h: # use the handle 'h' Rich. -- Richard Jones, Virtualization Group, Red Hat

Re: [Libguestfs] no way to force-close NBD handle in nbdsh

2023-02-25 Thread Richard W.M. Jones
On Sat, Feb 25, 2023 at 09:57:41AM +, Richard W.M. Jones wrote: > I can have a go at adding this since I unexpectedly have some free > time this weekend. https://gitlab.com/nbdkit/libnbd/-/commit/b7f85610ac19085a1631439fbcb7dd241f1e9ebf https://gitlab.com/nbdkit/libnbd/-/

Re: [Libguestfs] no way to force-close NBD handle in nbdsh

2023-02-25 Thread Richard W.M. Jones
On Fri, Feb 24, 2023 at 04:41:20PM -0600, Eric Blake wrote: > I'm out of time this weekend, but while trying to write a test for an > nbdkit bug fix (a nasty assertion failure when the client disconnects > uncleanly without NBD_CMD_DISC, which is what nbdcopy does if it gets > an EIO read response

Re: [Libguestfs] [V2V PATCH 0/5] Bring support for virtio-scsi back to Windows

2023-02-23 Thread Richard W.M. Jones
I'm probably not going to get around to looking at this before next week. But just wanted to say that while switching the default probably won't be acceptable, adding support for virtio-scsi may be OK. I'll look at the patches later! Rich. -- Richard Jones, Virtualization Group, Red Hat

Re: [Libguestfs] [libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY

2023-02-22 Thread Richard W.M. Jones
On Wed, Feb 22, 2023 at 05:22:57PM +0100, Laszlo Ersek wrote: > On 2/22/23 10:40, Laszlo Ersek wrote: > > On 2/22/23 09:17, Richard W.M. Jones wrote: > >> On Tue, Feb 21, 2023 at 05:23:52PM +0100, Laszlo Ersek wrote: > > > >>> This is

Re: [Libguestfs] [PATCH nbdkit] curl: Try to share as much as possible between handles in the pool

2023-02-22 Thread Richard W.M. Jones
On Wed, Feb 22, 2023 at 05:25:03PM +0100, Laszlo Ersek wrote: > On 2/22/23 17:00, Richard W.M. Jones wrote: > > On Wed, Feb 22, 2023 at 04:52:35PM +0100, Laszlo Ersek wrote: > > ... > >> Seems sane to me in general, except for the fact that the documentation > >&

Re: [Libguestfs] [PATCH nbdkit] curl: Try to share as much as possible between handles in the pool

2023-02-22 Thread Richard W.M. Jones
On Wed, Feb 22, 2023 at 04:52:35PM +0100, Laszlo Ersek wrote: ... > Seems sane to me in general, except for the fact that the documentation > at writes: > > """ > CURL_LOCK_DATA_CONNECT > > Put the connection cache in the share object and make all

[Libguestfs] [PATCH nbdkit] curl: Try to share as much as possible between handles in the pool

2023-02-22 Thread Richard W.M. Jones
Using the libcurl share interface we can share data between the separate curl easy handles in the pool. For more about this see: https://curl.se/libcurl/c/CURLSHOPT_SHARE.html https://gist.github.com/bagder/7eccf74f8b6d70b5abefeb7f288dba9b https://everything.curl.dev/libcurl/sharing ---

[Libguestfs] [PATCH nbdkit] curl: Try to share as much as possible between handles in the pool

2023-02-22 Thread Richard W.M. Jones
I'm mainly posting this to the list as a back-up. It does work, it does _not_ improve performance in any noticable way. However I'm having lots of trouble getting HTTP/2 to work (with or without this patch) and that's stopping me from testing anything properly. Rich.

Re: [Libguestfs] [libnbd PATCH v3 09/29] lib/utils: introduce async-signal-safe execvpe()

2023-02-22 Thread Richard W.M. Jones
On Wed, Feb 22, 2023 at 09:25:04AM +, Daniel P. Berrangé wrote: > macOS is the real pain point because of its restrictive EULA > meaning you basically have to buy it. It makes it very much a second > class citizen for developers, unless they happen to have personal > apple hardware. FWIW I

Re: [Libguestfs] [libnbd PATCH v3 09/29] lib/utils: introduce async-signal-safe execvpe()

2023-02-22 Thread Richard W.M. Jones
On Wed, Feb 22, 2023 at 09:48:04AM +0100, Laszlo Ersek wrote: > So: if the libnbd project can tolerate my attitude (approach#2), then > I'd like to proceed with this series (full scope), with me addressing > the v3 review feedback in v4, and so on. If not, then I'll abandon the > series, and try

Re: [Libguestfs] [libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY

2023-02-22 Thread Richard W.M. Jones
On Tue, Feb 21, 2023 at 05:23:52PM +0100, Laszlo Ersek wrote: > On 2/20/23 21:38, Eric Blake wrote: > > On Mon, Feb 20, 2023 at 06:03:13PM +0100, Laszlo Ersek wrote: > >> On 2/15/23 21:27, Eric Blake wrote: > >>> On Wed, Feb 15, 2023 at 03:11:34PM +0100, Laszlo Ersek wrote: > The

Re: [Libguestfs] [libnbd PATCH v3 09/29] lib/utils: introduce async-signal-safe execvpe()

2023-02-22 Thread Richard W.M. Jones
On Tue, Feb 21, 2023 at 05:03:23PM +0100, Laszlo Ersek wrote: > Rich mentioned that libnbd had actually encountered a bug of this kind, > just not specifically in exec*p*(). Probably this one? https://github.com/libguestfs/libguestfs/commit/e1c9bbb3d1d5ef81490977060120dda0963eb567 glibc was

Re: [Libguestfs] [libnbd PATCH v3 12/29] socket activation: clean up responsibilities of prep.sock.act.env.()

2023-02-21 Thread Richard W.M. Jones
On Tue, Feb 21, 2023 at 05:11:53PM +0100, Laszlo Ersek wrote: > On 2/21/23 14:24, Richard W.M. Jones wrote: > > On Tue, Feb 21, 2023 at 02:17:15PM +0100, Laszlo Ersek wrote: > >> On 2/15/23 17:39, Richard W.M. Jones wrote: > >>> On Wed, Feb 15, 2023 at 03:11:

Re: [Libguestfs] [libnbd PATCH v3 12/29] socket activation: clean up responsibilities of prep.sock.act.env.()

2023-02-21 Thread Richard W.M. Jones
On Tue, Feb 21, 2023 at 02:17:15PM +0100, Laszlo Ersek wrote: > On 2/15/23 17:39, Richard W.M. Jones wrote: > > On Wed, Feb 15, 2023 at 03:11:41PM +0100, Laszlo Ersek wrote: > >> prepare_socket_activation_environment() is a construction function that is > >> supposed

Re: [Libguestfs] [libnbd PATCH v3 01/29] use space consistently in function and function-like macro invocations

2023-02-20 Thread Richard W.M. Jones
On Mon, Feb 20, 2023 at 02:38:25PM +0100, Laszlo Ersek wrote: > I certainly don't want to dismiss these observations, but I'll > definitely forget about them unless we record them somewhere. Do these > deserve a bugzilla (or multiple bugzillas)? You could drop a note in the TODO file. Rich. --

Re: [Libguestfs] [PATCH v2v v2 3/3] -o qemu: Always use -cpu host unless overridden by source hypervisor

2023-02-20 Thread Richard W.M. Jones
Thanks, this is now upstream in: 2cf337c26e2b6a99aa3cf1acd88ce637fa8fbbf7 83a6400aeaa00f930bee2e8aa1f9d25156204605 e4a7f08c406a588d6034242ce14c5efc832cb476 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog:

Re: [Libguestfs] [PATCH v3 2/2] python: Avoid leaking py_array and py_args in event callbacks

2023-02-20 Thread Richard W.M. Jones
Thanks for the detailed review. This is now upstream in these two commits: e07304de86defb8d3a09902b5f9f7593fa9863ac afa4d64fca1672734ec474d6e8a1eeed4b34c6f4 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog:

Re: [Libguestfs] [PATCH v2v v2 3/3] -o qemu: Always use -cpu host unless overridden by source hypervisor

2023-02-20 Thread Richard W.M. Jones
On Mon, Feb 20, 2023 at 11:36:36AM +0100, Laszlo Ersek wrote: > On 2/17/23 12:44, Richard W.M. Jones wrote: > > As with the prior commit, prefer -cpu host for all guests (except when > > we have more information from the source hypervisor). Although there > > is the disadv

Re: [Libguestfs] [PATCH v2v v2 2/3] -o libvirt: Always use host-model unless overridden by source hypervisor

2023-02-20 Thread Richard W.M. Jones
On Mon, Feb 20, 2023 at 11:30:54AM +0100, Laszlo Ersek wrote: > On 2/17/23 12:44, Richard W.M. Jones wrote: > > In the case where the source hypervisor doesn't specify a CPU model, > > previously we chose qemu64 (qemu's most basic model), except for a few > > guests th

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-20 Thread Richard W.M. Jones
On Mon, Feb 20, 2023 at 09:45:33AM +0100, Laszlo Ersek wrote: > On 2/17/23 17:52, Eric Blake wrote: > > On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: > > >> - Py_BuildValue with the "O" format specifier transfers the new list's > >> *sole* reference (= ownership) to the just-built

Re: [Libguestfs] [supermin PATCH] Add support for OCaml 5.0

2023-02-17 Thread Richard W.M. Jones
On Fri, Feb 17, 2023 at 05:49:35PM +, Kate Deplaix wrote: > Hi, > > Here is a patch to add support to OCaml 5.0 to supermin: > https://github.com/libguestfs/supermin/commit/ > 01a6f2cfdb44d6140f11dbd00f13ceb9e45892c7 > > Note: As with my hivex patch, this patch also breaks support for OCaml

[Libguestfs] [PATCH v3 0/2] python: Avoid leaking py_array and py_args in event callbacks

2023-02-17 Thread Richard W.M. Jones
Version 1 was here: https://listman.redhat.com/archives/libguestfs/2023-February/030732.html (Ignore version 2 which had a mistake, this is version 3) Following Eric's suggestion here: https://listman.redhat.com/archives/libguestfs/2023-February/030746.html let's decrement the reference

[Libguestfs] [PATCH v3 2/2] python: Avoid leaking py_array and py_args in event callbacks

2023-02-17 Thread Richard W.M. Jones
See also: https://listman.redhat.com/archives/libguestfs/2023-February/030730.html https://listman.redhat.com/archives/libguestfs/2023-February/030745.html https://listman.redhat.com/archives/libguestfs/2023-February/030746.html Fixes: commit 6ef5837e2d8c5d4d83eff51c0201eb2e08f719de Thanks:

[Libguestfs] [PATCH v3 1/2] Revert "python: fix call of Python handlers of events"

2023-02-17 Thread Richard W.M. Jones
This reverts commit 85235aec837716f1ddb2926b9a59a02543195500. --- python/handle.c | 1 - 1 file changed, 1 deletion(-) diff --git a/python/handle.c b/python/handle.c index bf639b5789..8eeabe60a7 100644 --- a/python/handle.c +++ b/python/handle.c @@ -139,7 +139,6 @@

Re: [Libguestfs] python: Avoid leaking py_array and py_args in event callbacks

2023-02-17 Thread Richard W.M. Jones
Sorry, ignore this, I found yet another problem. Will post v3. 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

[Libguestfs] [PATCH v2] python: Avoid leaking py_array and py_args in event callbacks

2023-02-17 Thread Richard W.M. Jones
See also: https://listman.redhat.com/archives/libguestfs/2023-February/030730.html https://listman.redhat.com/archives/libguestfs/2023-February/030745.html https://listman.redhat.com/archives/libguestfs/2023-February/030746.html Fixes: commit 6ef5837e2d8c5d4d83eff51c0201eb2e08f719de Thanks:

[Libguestfs] python: Avoid leaking py_array and py_args in event callbacks

2023-02-17 Thread Richard W.M. Jones
Version 1 was here: https://listman.redhat.com/archives/libguestfs/2023-February/030732.html Following Eric's suggestion here: https://listman.redhat.com/archives/libguestfs/2023-February/030746.html let's decrement the reference of py_array right after adding it to the args. (This works

Re: [Libguestfs] [PATCH] python: Avoid leaking py_array along error paths

2023-02-17 Thread Richard W.M. Jones
On Fri, Feb 17, 2023 at 10:54:26AM -0600, Eric Blake wrote: > On Thu, Feb 16, 2023 at 03:23:51PM +0000, Richard W.M. Jones wrote: > > See-also: > > https://listman.redhat.com/archives/libguestfs/2023-February/030730.html > > Fixes: commit 6ef5837e2d8c5d4d83eff51c0201eb

Re: [Libguestfs] [libnbd PATCH v3 01/29] use space consistently in function and function-like macro invocations

2023-02-17 Thread Richard W.M. Jones
On Wed, Feb 15, 2023 at 01:48:39PM -0600, Eric Blake wrote: > In my experience with GNU code (which this is not), the style I've > seen there is to omit () whenever possible, as in: > > #if defined __GNUC__ > > or even > > #ifdef __GNUC__ I didn't know this was possible. I checked it. GCC

[Libguestfs] [PATCH v2v v2 1/3] v2v: Rename gcaps_default_cpu to gcaps_arch_min_version

2023-02-17 Thread Richard W.M. Jones
Some guests require not just a specific architecture, but cannot run on qemu's default CPU model, eg. requiring x86_64-v2. Since we anticipate future guests requiring higher versions, let's encode the minimum architecture version instead of a simple boolean. This patch essentially just remaps:

[Libguestfs] [PATCH v2v v2 3/3] -o qemu: Always use -cpu host unless overridden by source hypervisor

2023-02-17 Thread Richard W.M. Jones
As with the prior commit, prefer -cpu host for all guests (except when we have more information from the source hypervisor). Although there is the disadvantage that -cpu host is non-migratable, in practice it would be very difficult to live migrate a host launched using direct qemu commands.

[Libguestfs] [PATCH v2v v2 2/3] -o libvirt: Always use host-model unless overridden by source hypervisor

2023-02-17 Thread Richard W.M. Jones
In the case where the source hypervisor doesn't specify a CPU model, previously we chose qemu64 (qemu's most basic model), except for a few guests that we know won't work on qemu64, eg. RHEL 9 requires x86_64-v2 where we use However we recently encountered an obscure KVM bug related to this

[Libguestfs] [PATCH v2v v2 0/3] Use host-model

2023-02-17 Thread Richard W.M. Jones
Version 1 was here: https://listman.redhat.com/archives/libguestfs/2023-February/thread.html#30694 I made a few changes in v2 but overall decided to keep the now unused gcaps_arch_min_version capability. This doesn't preclude removing it in future if we think it's never going to be useful. I

Re: [Libguestfs] [PATCH v2v 1/3] v2v: Rename gcaps_default_cpu to gcaps_arch_min_version

2023-02-17 Thread Richard W.M. Jones
On Fri, Feb 17, 2023 at 08:53:42AM +0100, Laszlo Ersek wrote: > On 2/15/23 15:12, Richard W.M. Jones wrote: > > Some guests require not just a specific architecture, but cannot run > > on qemu's default CPU model, eg. requiring x86_64-v2. Since we > > anticipate future gu

Re: [Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-16 Thread Richard W.M. Jones
On Thu, Feb 16, 2023 at 03:09:02PM +0100, Laszlo Ersek wrote: > On 2/14/23 19:51, Richard W.M. Jones wrote: > > In the case that building the parameters to the Python event callback > > fails, args was returned as NULL. We immediately tried to call > > Py_INCREF on this whic

[Libguestfs] [PATCH] python: Avoid leaking py_array along error paths

2023-02-16 Thread Richard W.M. Jones
Tested by reverting bbf396fc5562b4f so that the error path is used, and re-running the reproducer supplied by Google. Rich. ___ Libguestfs mailing list Libguestfs@redhat.com https://listman.redhat.com/mailman/listinfo/libguestfs

[Libguestfs] [PATCH] python: Avoid leaking py_array along error paths

2023-02-16 Thread Richard W.M. Jones
See-also: https://listman.redhat.com/archives/libguestfs/2023-February/030730.html Fixes: commit 6ef5837e2d8c5d4d83eff51c0201eb2e08f719de Thanks: Laszlo Ersek --- python/handle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/python/handle.c b/python/handle.c index bf639b5789..717eee83ed

Re: [Libguestfs] [libnbd PATCH v3 29/29] socket activation: set LISTEN_FDNAMES

2023-02-15 Thread Richard W.M. Jones
For #26, #27, #28, #29: Reviewed-by: Richard W.M. Jones -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD

Re: [Libguestfs] [libnbd PATCH v3 25/29] CONNECT_COMMAND.START: replace execvp() call with fork-safe variant

2023-02-15 Thread Richard W.M. Jones
For #23, #24, #25: Reviewed-by: Richard W.M. Jones -- 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 machines. Supports shell scripting, bindings from many

Re: [Libguestfs] [libnbd PATCH v3 22/29] CONNECT_COMMAND.START: check syscalls for errors in the child process

2023-02-15 Thread Richard W.M. Jones
t (126); >} > >/* Parent. */ For use of exit code 126, see: https://listman.redhat.com/archives/libguestfs/2019-September/022737.html https://listman.redhat.com/archives/libguestfs/2019-September/022739.html https://www.gnu.org/software/bash/manual/html_node/Exit-Status.h

Re: [Libguestfs] [libnbd PATCH v3 21/29] CONNECT_COMMAND.START: sanitize close() calls in the child process

2023-02-15 Thread Richard W.M. Jones
; >} > if (pid == 0) { /* child - run command */ > -close (STDIN_FILENO); > -close (STDOUT_FILENO); > close (sv[0]); > dup2 (sv[1], STDIN_FILENO); > dup2 (sv[1], STDOUT_FILENO); > +NBD_INTERNAL_FORK_SAFE_ASSERT (sv[1] != STDIN_FILENO); >

Re: [Libguestfs] [libnbd PATCH v3 20/29] CONNECT_COMMAND.START: use symbolic constants for fd#0 and fd#1

2023-02-15 Thread Richard W.M. Jones
NO); > + dup2 (sv[1], STDOUT_FILENO); > close (sv[1]); Reviewed-by: Richard W.M. Jones -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virt

Re: [Libguestfs] [libnbd PATCH v3 19/29] CONNECT_COMMAND.START: set the NBD error when fcntl() fails

2023-02-15 Thread Richard W.M. Jones
) { > SET_NEXT_STATE (%.DEAD); > +/* nbd_internal_socket_create() calls set_error() internally */ > close (sv[0]); > return 0; >} > >/* The sockets are connected already, we can jump directly to > * receiving the server magic. > */ >SET_

Re: [Libguestfs] [libnbd PATCH v3 18/29] CONNECT_COMMAND.START: fix small comment thinko about socket pair usage

2023-02-15 Thread Richard W.M. Jones
g a non-blocking socket. > */ >flags = fcntl (sv[0], F_GETFL, 0); >if (flags == -1 || >fcntl (sv[0], F_SETFL, flags|O_NONBLOCK) == -1) { Reviewed-by: Richard W.M. Jones -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my progr

Re: [Libguestfs] [libnbd PATCH v3 17/29] socket activation: replace execvp() call with fork-safe variant

2023-02-15 Thread Richard W.M. Jones
sizeof addr; >memcpy (>connaddr, , h->connaddrlen); >next = %^CONNECT.START; > >/* fall through, for releasing the temporaries */ > > empty_env: >string_vector_empty (); > > +uninit_execvpe: > + nbd_internal_execvpe_uninit (_ct

Re: [Libguestfs] [libnbd PATCH v3 16/29] socket activation: plug AF_UNIX socket address (filesystem) leak on error

2023-02-15 Thread Richard W.M. Jones
gt;connaddrlen = sizeof addr; >memcpy (>connaddr, , h->connaddrlen); >next = %^CONNECT.START; > >/* fall through, for releasing the temporaries */ > > empty_env: >string_vector_empty (); > > +unlink_sockpath: > + if (next == %.DEAD) > +

Re: [Libguestfs] [libnbd PATCH v3 15/29] socket activation: centralize resource release

2023-02-15 Thread Richard W.M. Jones
mit. */ > + h->sact_tmpdir = tmpdir; > + h->sact_sockpath = sockpath; >h->pid = pid; > >h->connaddrlen = sizeof addr; >memcpy (>connaddr, , h->connaddrlen); > - SET_NEXT_STATE (%^CONNECT.START); > + next = %^CONNECT.START; > + > + /*

Re: [Libguestfs] [libnbd PATCH v3 14/29] socket activation: check syscalls for errors in the child process

2023-02-15 Thread Richard W.M. Jones
; > +if (signal (SIGPIPE, SIG_DFL) == SIG_ERR) { > + nbd_internal_fork_safe_perror ("signal"); > + _exit (126); > +} > > environ = env.ptr; > execvp (h->argv.ptr[0], h->argv.ptr); > nbd_internal_fork_safe_perror (h->argv.ptr

Re: [Libguestfs] [libnbd PATCH v3 13/29] socket activation: avoid manipulating the sign bit

2023-02-15 Thread Richard W.M. Jones
[I've no idea about this, adding Eric to CC for attention] On Wed, Feb 15, 2023 at 03:11:42PM +0100, Laszlo Ersek wrote: > F_SETFD takes an "int", so it stands to reason that FD_CLOEXEC expands to > an "int". In turn, it's bad hygiene to manipulate the sign bit of (signed) > integers with bit

Re: [Libguestfs] [libnbd PATCH v3 11/29] socket activation: fix error message upon asprintf() failure

2023-02-15 Thread Richard W.M. Jones
tion.c > @@ -127,7 +127,7 @@ CONNECT_SA.START: > >if (asprintf (>sact_sockpath, "%s/sock", h->sact_tmpdir) == -1) { > SET_NEXT_STATE (%.DEAD); > -set_error (errno, "strdup"); > +set_error (errno, "asprintf"); > return 0; Reviewed-by:

Re: [Libguestfs] [libnbd PATCH v3 12/29] socket activation: clean up responsibilities of prep.sock.act.env.()

2023-02-15 Thread Richard W.M. Jones
On Wed, Feb 15, 2023 at 03:11:41PM +0100, Laszlo Ersek wrote: > prepare_socket_activation_environment() is a construction function that is > supposed to fill in a string_vector object from the ground up. Right now > it has its responsibilities mixed up in two ways: > > - it expects the caller to

Re: [Libguestfs] [libnbd PATCH v3 10/29] lib/utils: add unit tests for async-signal-safe execvpe()

2023-02-15 Thread Richard W.M. Jones
For #6, #7, #8, #9, #10: Reviewed-by: Richard W.M. Jones -- 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

Re: [Libguestfs] [libnbd PATCH v3 05/29] vector: (mostly) factor out DEFINE_VECTOR_EMPTY

2023-02-15 Thread Richard W.M. Jones
On Wed, Feb 15, 2023 at 03:11:34PM +0100, Laszlo Ersek wrote: > The "name##_iter" function is used 11 times in libnbd; in all those cases, > "name" is "string_vector", and the "f" callback is "free": > > string_vector_iter (..., (void *) free); > > Casting "free" to (void*) is ugly.

Re: [Libguestfs] [libnbd PATCH v3 04/29] ocaml: rename "sa_u" to "saddr_u"

2023-02-15 Thread Richard W.M. Jones
For #1, #2, #3, #4: Reviewed-by: Richard W.M. Jones -- 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 machines. Supports shell scripting, bindings from many

[Libguestfs] [PATCH v2v 3/3] -o qemu: Always use -cpu host unless overridden by source hypervisor

2023-02-15 Thread Richard W.M. Jones
As with the prior commit, prefer -cpu host for all guests (except when we have more information from the source hypervisor). Although there is the disadvantage that -cpu host is non-migratable, in practice it would be very difficult to live migrate a host launched using direct qemu commands.

[Libguestfs] [PATCH v2v 2/3] -o libvirt: Always use host-model unless overridden by source hypervisor

2023-02-15 Thread Richard W.M. Jones
In the case where the source hypervisor doesn't specify a CPU model, previously we chose qemu64 (qemu's most basic model), except for a few guests that we know won't work on qemu64, eg. RHEL 9 requires x86_64-v2 where we use However we recently encountered an obscure KVM bug related to this

[Libguestfs] [PATCH v2v 1/3] v2v: Rename gcaps_default_cpu to gcaps_arch_min_version

2023-02-15 Thread Richard W.M. Jones
Some guests require not just a specific architecture, but cannot run on qemu's default CPU model, eg. requiring x86_64-v2. Since we anticipate future guests requiring higher versions, let's encode the minimum architecture version instead of a simple boolean. This patch essentially just remaps:

Re: [Libguestfs] [PATCH 2/2] python: Use bytes instead of str for event callback buffer

2023-02-15 Thread Richard W.M. Jones
The series was pushed as: https://github.com/libguestfs/libguestfs/commit/6ef5837e2d8c5d4d83eff51c0201eb2e08f719de https://github.com/libguestfs/libguestfs/commit/bbf396fc5562b4f0e27132f6b10c8a503f71effc -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my

[Libguestfs] [PATCH 2/2] python: Use bytes instead of str for event callback buffer

2023-02-14 Thread Richard W.M. Jones
The event callback gets a buffer parameter which is usually something like a log message. However as it comes from C it is not necessarily well-formed (eg) UTF-8 but could contain any old byte sequence. In the test case provided by the reported, we failed to encode the buffer as str with this

[Libguestfs] [PATCH 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-14 Thread Richard W.M. Jones
In the case that building the parameters to the Python event callback fails, args was returned as NULL. We immediately tried to call Py_INCREF on this which crashed. Returning NULL means the Python function threw an exception, so print the exception and return (there is no way to return an error

Re: [Libguestfs] Issue with downloading files whose path contains multi-byte utf-8 characters

2023-02-14 Thread Richard W.M. Jones
, xdrp=xdrp@entry=0x0, ret= > ret@entry=0x0) >     at proto.c:668 > #11 0x7f6dd163825e in guestfs_download (g=g@entry=0xae06f0, > remotefilename= > , filename=0x7f6dd17edea0 "/tmp/1") at actions-5.c:2984 > #12 0x7f6dd17ab01a in guestfs_int_py_download (self

Re: [Libguestfs] Issue with downloading files whose path contains multi-byte utf-8 characters

2023-02-13 Thread Richard W.M. Jones
On Mon, Feb 13, 2023 at 09:38:50PM +0200, Yonatan Shtarkman wrote: > Also, as a workaround, I avoided calling the event callback if null is > returned > by Py_BuildValue (still print the error and release the thread). > This seems to work for our usage (we only use the event callbacks for >

Re: [Libguestfs] Issue with downloading files whose path contains multi-byte utf-8 characters

2023-02-13 Thread Richard W.M. Jones
or our usage (we only use the event callbacks for > logging), > any potential issues I'm missing? > > On Mon, Feb 13, 2023 at 8:14 PM Daniel P. Berrangé > wrote: > > On Mon, Feb 13, 2023 at 06:07:58PM +, Richard W.M. Jones wrote: > > On Sun, Feb 12, 2023

Re: [Libguestfs] Issue with downloading files whose path contains multi-byte utf-8 characters

2023-02-13 Thread Richard W.M. Jones
And this one too: https://bugzilla.redhat.com/show_bug.cgi?id=1684004 -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful

Re: [Libguestfs] Issue with downloading files whose path contains multi-byte utf-8 characters

2023-02-13 Thread Richard W.M. Jones
On Mon, Feb 13, 2023 at 06:07:58PM +, Richard W.M. Jones wrote: > On Sun, Feb 12, 2023 at 03:31:08PM +0200, Yonatan Shtarkman wrote: > > Hey, > > When downloading a file whose path contains multi-byte utf-8, libguestfs > > sometimes crashes. > > This reproduces when

Re: [Libguestfs] Issue with downloading files whose path contains multi-byte utf-8 characters

2023-02-13 Thread Richard W.M. Jones
On Sun, Feb 12, 2023 at 03:31:08PM +0200, Yonatan Shtarkman wrote: > Hey, > When downloading a file whose path contains multi-byte utf-8, libguestfs > sometimes crashes. > This reproduces when using python, and not when using guestfish. > > Code to reproduce: > for i in range(2000): >    

Re: [Libguestfs] [PATCH] lib: Choose q35 machine type for x86-64

2023-02-10 Thread Richard W.M. Jones
On Fri, Feb 10, 2023 at 10:57:40AM +, Richard W.M. Jones wrote: > > This is upstream in > https://github.com/libguestfs/libguestfs/commit/f0f8e6c5fe0c3f6d5d90534d263bded3a4dc7e8d This is a Fedora Rawhide build: https://koji.fedoraproject.org/koji/taskinfo?taskID=97341784 which if s

Re: [Libguestfs] [PATCH] lib: Choose q35 machine type for x86-64

2023-02-10 Thread Richard W.M. Jones
This is upstream in https://github.com/libguestfs/libguestfs/commit/f0f8e6c5fe0c3f6d5d90534d263bded3a4dc7e8d -- 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.

Re: [Libguestfs] [PATCH] lib: Choose q35 machine type for x86-64

2023-02-09 Thread Richard W.M. Jones
On Thu, Feb 09, 2023 at 03:34:26PM +0100, Laszlo Ersek wrote: > On 2/9/23 14:54, Daniel P. Berrangé wrote: > > On Thu, Feb 09, 2023 at 01:45:33PM +, Richard W.M. Jones wrote: > >> This machine type is more modern than the older 'pc' type and as most > >> qemu

Re: [Libguestfs] [PATCH] lib: Choose q35 machine type for x86-64

2023-02-09 Thread Richard W.M. Jones
On Thu, Feb 09, 2023 at 01:54:42PM +, Daniel P. Berrangé wrote: > On Thu, Feb 09, 2023 at 01:45:33PM +0000, Richard W.M. Jones wrote: > > This machine type is more modern than the older 'pc' type and as most > > qemu development is now focused there we expect it will perform

[Libguestfs] [PATCH] lib: Choose q35 machine type for x86-64

2023-02-09 Thread Richard W.M. Jones
This machine type is more modern than the older 'pc' type and as most qemu development is now focused there we expect it will perform and behave better. In almost all respects this change should make no difference. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2168578 ---

[Libguestfs] [PATCH nbdkit v2 1/4] curl: Split out the libcurl handle from the plugin handle

2023-02-07 Thread Richard W.M. Jones
In a future commit we will create a pool of libcurl handles. In order to prepare for that, split out the libcurl handle and associated fields and buffers, from the plugin handle. The plugin handle (for the moment) contains a pointer to the libcurl handle so there is still a 1-1 relationship

[Libguestfs] [PATCH nbdkit v2 2/4] curl: Introduce concept of getting/putting handles from a common pool

2023-02-07 Thread Richard W.M. Jones
Introduce the concept of a pool of curl handles from which the main code has to take a handle (get_handle()), and later return it to the pool (put_handle()). When a handle is taken from the pool it can be used exclusively by the main code until it is returned. The "pool" only has at most one

[Libguestfs] [PATCH nbdkit v2 4/4] curl: Use the parallel thread model

2023-02-07 Thread Richard W.M. Jones
NOTE! THIS PESSIMIZES PERFORMANCE: https://listman.redhat.com/archives/libguestfs/2023-February/030618.html After previous changes, it is now safe to use the parallel thread model in this plugin. The locking in pool.c protects a single curl handle from being used from multiple threads. An

[Libguestfs] [PATCH nbdkit v2 0/4] curl: Use a curl handle pool

2023-02-07 Thread Richard W.M. Jones
NOTE! At least patch 4 should not be applied, and maybe the whole series is a bust. I am mainly posting this on the list for discussion and maybe to archive it. Version 1 was here: https://listman.redhat.com/archives/libguestfs/2023-February/030610.html This patch series introduces the concept

[Libguestfs] [PATCH nbdkit v2 3/4] curl: Complete implementation of the curl handle pool

2023-02-07 Thread Richard W.M. Jones
This commit implements the curl handle pool. By default it can grow to up to 4 curl handles, shared between all NBD connections. You can change this using the new connections=N parameter. --- plugins/curl/nbdkit-curl-plugin.pod | 7 +++ plugins/curl/curldefs.h | 5 +-

Re: [Libguestfs] [PATCH v2v] -o libvirt: Use cpu='host-model' for gcaps_default_cpu = false

2023-02-07 Thread Richard W.M. Jones
On Tue, Feb 07, 2023 at 01:25:34PM +0100, Laszlo Ersek wrote: > On 2/7/23 09:46, Richard W.M. Jones wrote: > > For RHEL >= 9 / x86-64 guests we cannot use the default qemu CPU > > (eg. "qemu64"), and so we have a mechanism for conversion to indicate > > to the ou

[Libguestfs] ANNOUNCE: libguestfs 1.50 & guestfs-tools 1.50

2023-02-07 Thread Richard W.M. Jones
Kuparinen Kashyap Chamarthy Laszlo Ersek Marcin Stanclik Michał Smyk Neil Hanlon Nikolay Shirokovskiy Pavel Borecki Piotr Drąg Richard W.M. Jones Ricky Tigg Temuri Doghonadze Yuri Chornoivan COPYRIGHT Copyright (C)

Re: [Libguestfs] [PATCH v2v] convert: linux: Require host cpu for all RHEL-alike >= 9

2023-02-07 Thread Richard W.M. Jones
On Tue, Feb 07, 2023 at 08:56:06AM +, Daniel P. Berrangé wrote: > On Mon, Feb 06, 2023 at 12:49:41PM +0000, Richard W.M. Jones wrote: > > (2) If the guest is RHEL family >= 9, use -cpu host / host-passthrough > > > > (3) Otherwise don't specify any -cpu or section &

<    1   2   3   4   5   6   7   8   9   10   >