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

2023-02-20 Thread Laszlo Ersek
On 2/17/23 18:39, Richard W.M. Jones wrote: > 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

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] [PATCH v2v 1/3] v2v: Rename gcaps_default_cpu to gcaps_arch_min_version

2023-02-20 Thread Laszlo Ersek
On 2/17/23 10:56, Richard W.M. Jones wrote: > 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

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

2023-02-20 Thread Laszlo Ersek
On 2/17/23 18:45, Richard W.M. Jones wrote: > 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:

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 1/2] Revert "python: fix call of Python handlers of events"

2023-02-20 Thread Laszlo Ersek
On 2/17/23 18:45, Richard W.M. Jones wrote: > 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 > +++

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 that we know won't work on

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 disadvantage that -cpu host is

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 1/2] python: Avoid crash if callback parameters cannot be built

2023-02-20 Thread Laszlo Ersek
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 higher-level object "args" > > Reference transfer is done with "N",

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

2023-02-20 Thread Laszlo Ersek
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 that we know won't work on qemu64, eg. RHEL 9 requires > x86_64-v2 where we use > > However we

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

2023-02-20 Thread Laszlo Ersek
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 disadvantage that -cpu host is non-migratable, in practice it > would be very difficult to live

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

2023-02-20 Thread Laszlo Ersek
On 2/17/23 12:44, 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 guests requiring higher versions, let's encode the > minimum architecture version instead of a

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

2023-02-20 Thread Laszlo Ersek
On 2/15/23 17:23, Richard W.M. Jones wrote: > 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);

Re: [Libguestfs] [libnbd PATCH v3 03/29] socket activation: rename sa_(tmpdir|sockpath) to sact_(tmpdir|sockpath)

2023-02-20 Thread Laszlo Ersek
On 2/15/23 21:00, Eric Blake wrote: > On Wed, Feb 15, 2023 at 03:11:32PM +0100, Laszlo Ersek wrote: >> in POSIX reserves the "sa_" prefix: >> >> https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02 >> >> Let's use "sact_" instead. >> >> Signed-off-by: Laszlo

Re: [Libguestfs] [libnbd PATCH v3 02/29] generator/C.ml: use space consistently in func. and func.-like macro calls

2023-02-20 Thread Laszlo Ersek
On 2/15/23 20:54, Eric Blake wrote: > On Wed, Feb 15, 2023 at 03:11:31PM +0100, Laszlo Ersek wrote: >> Apply the ideas in the previous patch to the C-language bindings >> generator. >> >> Signed-off-by: Laszlo Ersek >> --- >> generator/C.ml | 20 ++-- >> 1 file changed, 10

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

2023-02-20 Thread Laszlo Ersek
On 2/15/23 20:48, Eric Blake wrote: > On Wed, Feb 15, 2023 at 03:11:30PM +0100, Laszlo Ersek wrote: >> We intend to place a space character between the function designator and >> the opening parenthesis in a function call. We've been executing on that >> mostly consistently; fix the few exceptions

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

2023-02-20 Thread Laszlo Ersek
On 2/15/23 21:27, Eric Blake wrote: > 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); >> >>

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

2023-02-20 Thread Eric Blake
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 "name##_iter" function is used 11 times in libnbd; in all those cases, > >> "name" is "string_vector", and the "f" callback

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

2023-02-20 Thread Eric Blake
On Mon, Feb 20, 2023 at 09:08:08PM +0200, Nir Soffer wrote: > On Mon, Feb 20, 2023 at 10:45 AM 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

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

2023-02-20 Thread Eric Blake
On Mon, Feb 20, 2023 at 02:38:25PM +0100, Laszlo Ersek wrote: > > > > [1] This change widened out beyond 80 columns. Is it worth splitting > > that typedef line in two, perhaps as: > > > > typedef char NBDKIT_UNIQUE_NAME (_x_has_uint_type) \ > > [(typeof (x))-1 > 0 ? 1

Re: [Libguestfs] [libnbd PATCH v3 07/29] lib/utils: add async-signal-safe assert()

2023-02-20 Thread Eric Blake
On Mon, Feb 20, 2023 at 07:21:05PM +0100, Laszlo Ersek wrote: > On 2/15/23 21:57, Eric Blake wrote: > > On Wed, Feb 15, 2023 at 03:11:36PM +0100, Laszlo Ersek wrote: > >> Add an assert() variant that we may call between fork() and exec*(). > >> > >> Signed-off-by: Laszlo Ersek > >> --- > >> > >

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

2023-02-20 Thread Nir Soffer
On Mon, Feb 20, 2023 at 10:45 AM 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] [libnbd PATCH v3 07/29] lib/utils: add async-signal-safe assert()

2023-02-20 Thread Laszlo Ersek
On 2/15/23 21:57, Eric Blake wrote: > On Wed, Feb 15, 2023 at 03:11:36PM +0100, Laszlo Ersek wrote: >> Add an assert() variant that we may call between fork() and exec*(). >> >> Signed-off-by: Laszlo Ersek >> --- >> > >> +++ b/lib/internal.h > >> + >> +#ifdef NDEBUG >> +#define

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] [libnbd PATCH v3 07/29] lib/utils: add async-signal-safe assert()

2023-02-20 Thread Laszlo Ersek
On 2/20/23 19:21, Laszlo Ersek wrote: > On 2/15/23 21:57, Eric Blake wrote: >> On Wed, Feb 15, 2023 at 03:11:36PM +0100, Laszlo Ersek wrote: >>> + >>> + xwrite (STDERR_FILENO, file, strlen (file)); >>> + xwrite (STDERR_FILENO, ":", 1); >> >> Presumably, if our first best-effort xwrite() fails