Re: [Libguestfs] [COMMON PATCH v2 3/4] mlcustomize: Add accessors for block driver priority list

2023-03-08 Thread Laszlo Ersek
On 3/7/23 20:40, Andrey Drobyshev wrote: > From: "Richard W.M. Jones" > > When injecting virtio-win drivers, allow the list of block drivers > that we search to be modified. This functionality will be used when we > introduce an option for changing the default block driver in virt-v2v. > >

Re: [Libguestfs] [COMMON PATCH v2 1/4] inject_virtio_win: match only vendor/device

2023-03-08 Thread Laszlo Ersek
On 3/7/23 20:40, Andrey Drobyshev wrote: > From: Roman Kagan > > Since different hypervisor vendors are allowed to use their own vendor-id > as PCI subsystem-vendor-id for virtio devices, during v2v conversion it > makes sense to only match the vendor/device and not the full device "path" > in

Re: [Libguestfs] [COMMON PATCH v2 2/4] inject_virtio_win: add Virtio_SCSI to block_type

2023-03-08 Thread Laszlo Ersek
On 3/7/23 20:40, Andrey Drobyshev wrote: > Signed-off-by: Andrey Drobyshev > --- > mlcustomize/inject_virtio_win.ml | 2 +- > mlcustomize/inject_virtio_win.mli | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mlcustomize/inject_virtio_win.ml >

Re: [Libguestfs] [COMMON PATCH v2 2/4] inject_virtio_win: add Virtio_SCSI to block_type

2023-03-08 Thread Andrey Drobyshev
On 3/8/23 12:48, Laszlo Ersek wrote: > On 3/7/23 20:40, Andrey Drobyshev wrote: >> Signed-off-by: Andrey Drobyshev >> --- >> mlcustomize/inject_virtio_win.ml | 2 +- >> mlcustomize/inject_virtio_win.mli | 2 +- >> 2 files changed, 2 insertions(+), 2 deletions(-) >> >> diff --git

Re: [Libguestfs] [COMMON PATCH v2 1/4] inject_virtio_win: match only vendor/device

2023-03-08 Thread Andrey Drobyshev
On 3/8/23 12:47, Laszlo Ersek wrote: > On 3/7/23 20:40, Andrey Drobyshev wrote: >> From: Roman Kagan >> >> Since different hypervisor vendors are allowed to use their own vendor-id >> as PCI subsystem-vendor-id for virtio devices, during v2v conversion it >> makes sense to only match the

Re: [Libguestfs] [COMMON PATCH v2 2/4] inject_virtio_win: add Virtio_SCSI to block_type

2023-03-08 Thread Richard W.M. Jones
On Wed, Mar 08, 2023 at 04:00:10PM +0200, Andrey Drobyshev wrote: > Sure, thanks for pointing out. Will do as soon as Richard leaves his > notes on the series. I'm giving a talk this afternoon, but I should be able to look at it later. Rich. -- Richard Jones, Virtualization Group, Red Hat

[Libguestfs] [V2V PATCH 1/1] convert_windows: add firstboot script to install drivers with pnputil

2023-03-08 Thread Andrey Drobyshev
During conversion we copy the necessary drivers to the directory "%systemroot%\Drivers\Virtio", adding it to the DevicePath registry value. As documented in [1], this should be enough for Windows to find device drivers and successfully install them. However, it doesn't always happen. Commit

[Libguestfs] [V2V PATCH 0/1] convert_windows: add firstboot script to install drivers with pnputil

2023-03-08 Thread Andrey Drobyshev
I've been experiencing problem with the drivers not always being installed. This patch merely implements the solution offered by Richard in the commit 73e009c04 ("v2v: windows: Document use of pnputil to install drivers."). The solution wasn't implemented back then, but rather added merely as a

[Libguestfs] [PATCH libnbd] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Richard W.M. Jones
When a highly multi-threaded program such as nbdcopy encounters an error, there is a race condition in the library which can cause an assertion failure and thus a core dump: (1) An error occurs on one of the threads. nbdcopy calls exit(3). (2) In lib/errors.c, the destructor calls

Re: [Libguestfs] [PATCH libnbd] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Daniel P . Berrangé
On Wed, Mar 08, 2023 at 03:22:29PM -0600, Eric Blake wrote: > On Wed, Mar 08, 2023 at 08:29:41PM +, Richard W.M. Jones wrote: > > When a highly multi-threaded program such as nbdcopy encounters an > > error, there is a race condition in the library which can cause an > > assertion failure and

[Libguestfs] [libnbd PATCH v2] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Eric Blake
When a highly multi-threaded program such as nbdcopy encounters an error, there is a race condition in the library which can cause an assertion failure and thus a core dump: (1) An error occurs on one of the threads. nbdcopy calls exit(3). (2) In lib/errors.c, the destructor calls

Re: [Libguestfs] [COMMON PATCH v2 4/4] inject_virtio_win: write the proper block controller PCI ID to Win registry

2023-03-08 Thread Richard W.M. Jones
On Tue, Mar 07, 2023 at 09:40:26PM +0200, Andrey Drobyshev wrote: > In case when we are injecting virtio-scsi device driver into the guest > (rather than the default virtio-blk), make sure we write the right PCI ID > value into the Windows guest registry. This is essential for the guest > to be

Re: [Libguestfs] [PATCH libnbd] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Eric Blake
On Wed, Mar 08, 2023 at 08:29:41PM +, Richard W.M. Jones wrote: > When a highly multi-threaded program such as nbdcopy encounters an > error, there is a race condition in the library which can cause an > assertion failure and thus a core dump: > > (1) An error occurs on one of the threads.

Re: [Libguestfs] [libnbd PATCH v2] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Eric Blake
On Wed, Mar 08, 2023 at 04:29:03PM -0600, Eric Blake wrote: > > There aren't any good ways to fix this. We have proven that the > assertions are too tight (it IS possible for one thread's first use of > libnbd API, which causes the allocation of a thread-local error > context, to occur after

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

2023-03-08 Thread Richard W.M. Jones
The patch series looks generally fine, but it really needs a test ... We find that having tests prevents unnoticed regressions from happening later. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog:

Re: [Libguestfs] [PATCH libnbd] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Richard W.M. Jones
On Wed, Mar 08, 2023 at 08:29:41PM +, Richard W.M. Jones wrote: > diff --git a/generator/states.c b/generator/states.c > index fa0f8d716e..c0cf5a7f26 100644 > --- a/generator/states.c > +++ b/generator/states.c > @@ -191,8 +191,6 @@ STATE_MACHINE { >return 0; > > DEAD: > - /* The

Re: [Libguestfs] [libnbd PATCH v2] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Eric Blake
On Wed, Mar 08, 2023 at 10:55:01PM +, Richard W.M. Jones wrote: > > @@ -87,16 +92,23 @@ free_errors_key (void *vp) > > static struct last_error * > > allocate_last_error_on_demand (void) > > { > > - struct last_error *last_error = pthread_getspecific (errors_key); > > + struct last_error

Re: [Libguestfs] [V2V PATCH v2 2/5] convert_windows: add Inject_virtio_win.Virtio_SCSI as a possible block type

2023-03-08 Thread Richard W.M. Jones
On Tue, Mar 07, 2023 at 09:40:07PM +0200, Andrey Drobyshev wrote: > Signed-off-by: Andrey Drobyshev > --- > convert/convert_windows.ml | 1 + > 1 files changed, 1 insertions(+) > > diff --git a/convert/convert_windows.ml b/convert/convert_windows.ml > index 9d8d271d..4f672487 100644 > ---

Re: [Libguestfs] [V2V PATCH 1/1] convert_windows: add firstboot script to install drivers with pnputil

2023-03-08 Thread Richard W.M. Jones
On Wed, Mar 08, 2023 at 08:05:35PM +0200, Andrey Drobyshev wrote: > During conversion we copy the necessary drivers to the directory > "%systemroot%\Drivers\Virtio", adding it to the DevicePath registry > value. As documented in [1], this should be enough for Windows to find > device drivers and

Re: [Libguestfs] [libnbd PATCH v2] lib/errors.c: Fix assert fail in exit path in multi-threaded code

2023-03-08 Thread Richard W.M. Jones
On Wed, Mar 08, 2023 at 04:29:03PM -0600, Eric Blake wrote: > When a highly multi-threaded program such as nbdcopy encounters an > error, there is a race condition in the library which can cause an > assertion failure and thus a core dump: > > (1) An error occurs on one of the threads. nbdcopy