Re: [Libguestfs] [libnbd PATCH v2 8/8] python: Make nbd.Buffer lighter-weight

2022-06-07 Thread Eric Blake
On Tue, Jun 07, 2022 at 02:20:35PM +0100, Richard W.M. Jones wrote: > On Mon, Jun 06, 2022 at 09:08:33PM -0500, Eric Blake wrote: > > Instead of storing a PyCapsule in _o and repeatedly doing lookups to > > dereference a stored malloc'd pointer, it is easier to just directly > > store a Python

Re: [Libguestfs] [v2v PATCH 4/4] convert_linux: install the QEMU guest agent with a firstboot script

2022-06-07 Thread Richard W.M. Jones
On Tue, Jun 07, 2022 at 01:59:30PM +0100, Richard W.M. Jones wrote: > On Mon, Jun 06, 2022 at 04:19:41PM +0200, Laszlo Ersek wrote: > > +(* Disable SELinux temporarily around package installation. > > Refer to > > + *

Re: [Libguestfs] [libnbd PATCH v2 2/8] python: Plug uninit leak in nbd.Buffer.to_bytearray

2022-06-07 Thread Eric Blake
On Mon, Jun 06, 2022 at 09:08:27PM -0500, Eric Blake wrote: > > The solution employed here is to mark when a buffer has been > initialized, in nbd.Buffer.from_bytearray() and > h.aio_pread[_structured], as well as force-initialize an uninitialized > buffer before b.to_bytearray() or h.aio_pwrite.

Re: [Libguestfs] [libnbd PATCH v2 4/8] python: Reformat generated methods.c in a few places

2022-06-07 Thread Richard W.M. Jones
On Tue, Jun 07, 2022 at 08:53:23AM -0500, Eric Blake wrote: > On Tue, Jun 07, 2022 at 09:00:08AM +0100, Richard W.M. Jones wrote: > > On Mon, Jun 06, 2022 at 09:08:29PM -0500, Eric Blake wrote: > > > + pr ":nbd_%s\",\n" name; > > > > You could put this pr (but without the \n) ... > > > > > +

Re: [Libguestfs] [libnbd PATCH v2 4/8] python: Reformat generated methods.c in a few places

2022-06-07 Thread Eric Blake
On Tue, Jun 07, 2022 at 09:00:08AM +0100, Richard W.M. Jones wrote: > On Mon, Jun 06, 2022 at 09:08:29PM -0500, Eric Blake wrote: > > + pr ":nbd_%s\",\n" name; > > You could put this pr (but without the \n) ... > > > + pr " "; > > + pr_wrap ',' (fun () -> > > ...

Re: [Libguestfs] [libnbd PATCH v2 3/8] python: Enhance tests of nbd.Buffer

2022-06-07 Thread Eric Blake
On Tue, Jun 07, 2022 at 02:14:36PM +0100, Richard W.M. Jones wrote: > On Mon, Jun 06, 2022 at 09:08:28PM -0500, Eric Blake wrote: > > Add some more coverage of existing behavior, so we can better track > > that we are not introducing unintended changes in upcoming patches. > > --- > >

Re: [Libguestfs] [libnbd PATCH v2 2/8] python: Plug uninit leak in nbd.Buffer.to_bytearray

2022-06-07 Thread Eric Blake
On Tue, Jun 07, 2022 at 02:13:23PM +0100, Richard W.M. Jones wrote: > On Mon, Jun 06, 2022 at 09:08:27PM -0500, Eric Blake wrote: > > @@ -79,7 +80,7 @@ let > > "aio_buffer_from_bytearray"; > > "aio_buffer_to_bytearray"; > > "aio_buffer_size"; > > -

Re: [Libguestfs] [libnbd PATCH v2 8/8] python: Make nbd.Buffer lighter-weight

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:33PM -0500, Eric Blake wrote: > Instead of storing a PyCapsule in _o and repeatedly doing lookups to > dereference a stored malloc'd pointer, it is easier to just directly > store a Python buffer-like object as _o. Track initialization via > ._init: absent for

Re: [Libguestfs] [libnbd PATCH v2 7/8] python: Simplify python generator

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:32PM -0500, Eric Blake wrote: > Now that none of our parameter types uses a getter sequence, we can > simplify the code for generating nbd.py. No change to generated > output. > --- > generator/Python.ml | 49 ++--- > 1 file

Re: [Libguestfs] [libnbd PATCH v2 6/8] python: Don't unwrap nbd.Buffer in nbd.py

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:31PM -0500, Eric Blake wrote: > Prior to this commit, we were unwrapping buf._o in nbd.py, which > causes cryptic errors when the user passes in the wrong type: > > $ nbdkit -U - memory 10 --run \ > 'nbdsh -u "$uri" -c "h.aio_pread(bytearray(10), 0)"' > Traceback

Re: [Libguestfs] [libnbd PATCH v2 5/8] python: Make py_aio_buffer a private struct

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:30PM -0500, Eric Blake wrote: > Instead of having methods.c poking into the internals of a struct that > we defined, have it use PyMemoryView* and Py_buffer*; this separation > makes it easier to separate how we store the persistent data (for now, > in a PyCapsule)

Re: [Libguestfs] [libnbd PATCH v2 3/8] python: Enhance tests of nbd.Buffer

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:28PM -0500, Eric Blake wrote: > Add some more coverage of existing behavior, so we can better track > that we are not introducing unintended changes in upcoming patches. > --- > python/t/500-aio-pread.py | 83 +++--- >

Re: [Libguestfs] [libnbd PATCH v2 2/8] python: Plug uninit leak in nbd.Buffer.to_bytearray

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:27PM -0500, Eric Blake wrote: > @@ -79,7 +80,7 @@ let > "aio_buffer_from_bytearray"; > "aio_buffer_to_bytearray"; > "aio_buffer_size"; > - "aio_buffer_is_zero" ] @ List.map fst handle_calls); > + "aio_buffer_is_zero"] @ List.map fst

Re: [Libguestfs] [libnbd PATCH v2 1/8] python: Improve doc comments for nbd.py

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:26PM -0500, Eric Blake wrote: > PEP257 recommends that doc comments start with a one line summary and > be a complete sentence. Tweak our existing comments to comply. It > also recommends the use of """ strings, and for u""" when a string > contains Unicode;

Re: [Libguestfs] [guestfs-tools PATCH] customize: rebase to the common/mlcustomize/Guest_packages interface

2022-06-07 Thread Richard W.M. Jones
This patch and the companion patch to libguestfs-common: 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 libguestfs lets you edit virtual machines.

Re: [Libguestfs] [v2v PATCH 0/4] convert_linux: install the QEMU guest agent with a firstboot script

2022-06-07 Thread Richard W.M. Jones
On Tue, Jun 07, 2022 at 01:39:53PM +0100, Richard W.M. Jones wrote: > OTOH ... my comment here: > > https://bugzilla.redhat.com/show_bug.cgi?id=2028764#c2 > > was about more social issues where we've not been able to put the > qemu-ga RPMs on the ISO, and firstboot seemed like the easiest way to

Re: [Libguestfs] [v2v PATCH 4/4] convert_linux: install the QEMU guest agent with a firstboot script

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 04:19:41PM +0200, Laszlo Ersek wrote: > Register a firstboot script, for installing the guest agent with the > guest's own package manager -- that is, "Guest_packages.install_command". > > For installing the package, network connectivity is required; for lack of > a

Re: [Libguestfs] [v2v PATCH 3/4] convert_linux: extract qemu-guest-agent package name

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 04:19:40PM +0200, Laszlo Ersek wrote: > In commit a30383e35d34 ("v2v: linux: do not install qemu-guest-agent if > already installed", 2019-09-20), the name of the package providing the > QEMU guest agent was hard-coded as "qemu-guest-agent", regardless of > distro family.

Re: [Libguestfs] [v2v PATCH 2/4] windows_virtio: remove "install_linux_tools"

2022-06-07 Thread Richard W.M. Jones
I'm not a big fan of dead code/features, so we should probably just do this regardless of any other changes, so: Acked-by: Richard W.M. Jones Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog:

Re: [Libguestfs] [v2v PATCH 1/4] output/create_libvirt_xml: wire up the QEMU guest agent

2022-06-07 Thread Richard W.M. Jones
The patch looks OK, but qemu-ga supports vsock (-m listen-vsock), so wouldn't it be easier to use that? I thought that virtio-serial was unmaintained these days and so vsock would be preferred. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my

Re: [Libguestfs] [v2v PATCH 0/4] convert_linux: install the QEMU guest agent with a firstboot script

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 04:19:37PM +0200, Laszlo Ersek wrote: > Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2028764 > > I'm going to post the pre-requisite libguestfs-common and guestfs-tools > patches (one patch for each project) in response to this cover letter, > too. > > I'm not

Re: [Libguestfs] [libnbd PATCH v2 4/8] python: Reformat generated methods.c in a few places

2022-06-07 Thread Richard W.M. Jones
On Mon, Jun 06, 2022 at 09:08:29PM -0500, Eric Blake wrote: > + pr ":nbd_%s\",\n" name; You could put this pr (but without the \n) ... > + pr " "; > + pr_wrap ',' (fun () -> ... inside pr_wrap here, and it would mean you wouldn't need to print spaces to indent