[PATCH v2] xen: rework pci_piix3_xen_ide_unplug

2020-10-27 Thread Anthony PERARD via
From: Anthony PERARD This is to allow IDE disks to be unplugged when adding to QEMU via: -drive file=/root/disk_file,if=none,id=ide-disk0,format=raw -device ide-hd,drive=ide-disk0,bus=ide.0,unit=0 as the current code only works for disk added with: -drive file=/root/disk_file,if=ide,

Re: [PATCH v2] xen: rework pci_piix3_xen_ide_unplug

2020-10-28 Thread Anthony PERARD via
On Tue, Oct 27, 2020 at 01:33:32PM -0400, John Snow wrote: > On 10/27/20 11:40 AM, Anthony PERARD wrote: > > From: Anthony PERARD > > > > This is to allow IDE disks to be unplugged when adding to QEMU via: > > -drive file=/root/disk_file,if=none,id=ide-disk0,format=raw > > -device ide-h

[PATCH] xen: rework pci_piix3_xen_ide_unplug

2020-09-18 Thread Anthony PERARD via
This is to allow IDE disks to be unplugged when adding to QEMU via: -drive file=/root/disk_file,if=none,id=ide-disk0,format=raw -device ide-hd,drive=ide-disk0,bus=ide.0,unit=0 as the current code only works for disk added with: -drive file=/root/disk_file,if=ide,index=0,media=disk,form

Re: [PATCH 2/6] hw/xen: use G_GNUC_PRINTF/SCANF for various functions

2022-12-19 Thread Anthony PERARD via
On Mon, Dec 19, 2022 at 08:02:01AM -0500, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé Acked-by: Anthony PERARD Thanks, -- Anthony PERARD

Re: [PATCH] xen-block: Fix removal of backend instance via xenstore

2021-03-08 Thread Anthony PERARD via
On Mon, Mar 08, 2021 at 03:38:49PM +0100, Paolo Bonzini wrote: > On 08/03/21 15:32, Anthony PERARD wrote: > > From: Anthony PERARD > > > > Whenever a Xen block device is detach via xenstore, the image > > associated with it remained open by the backend QEMU and an error is > > logged: > > qe

Re: [PATCH] xen-block: Fix removal of backend instance via xenstore

2021-03-08 Thread Anthony PERARD via
On Mon, Mar 08, 2021 at 06:37:38PM +0100, Paolo Bonzini wrote: > On 08/03/21 18:29, Anthony PERARD wrote: > > > If nothing else works then I guess it's okay, but why can't you do the > > > xen_block_drive_destroy from e.g. an unrealize callback? > > > > I'm not sure if that's possible. > > > > xe

Re: [PATCH] xen-block: Fix removal of backend instance via xenstore

2021-03-22 Thread Anthony PERARD via
Hi Paul, Stefano, Could one of you could give a Ack to this patch? Thanks, On Mon, Mar 08, 2021 at 02:32:32PM +, Anthony PERARD wrote: > From: Anthony PERARD > > Whenever a Xen block device is detach via xenstore, the image > associated with it remained open by the backend QEMU and an err

[PATCH] xen-block: Use specific blockdev driver

2021-04-30 Thread Anthony PERARD via
From: Anthony PERARD ... when a xen-block backend instance is created via xenstore. Following 8d17adf34f50 ("block: remove support for using "file" driver with block/char devices"), using the "file" blockdev driver for everything doesn't work anymore, we need to use the "host_device" driver when

Re: [PATCH v2 1/3] hw/ide/piix: Remove redundant "piix3-ide-xen" device class

2022-05-19 Thread Anthony PERARD via
On Fri, May 13, 2022 at 08:09:55PM +0200, Bernhard Beschow wrote: > Commit 0f8445820f11a69154309863960328dda3dc1ad4 'xen: piix reuse pci > generic class init function' already resolved redundant code which in > turn rendered piix3-ide-xen redundant. > > Signed-off-by: Bernhard Beschow Creating a

Re: [PATCH v2 2/3] hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug()

2022-05-19 Thread Anthony PERARD via
On Fri, May 13, 2022 at 08:09:56PM +0200, Bernhard Beschow wrote: > The comment is based on commit message > ae4d2eb273b167dad748ea4249720319240b1ac2 'xen-platform: add missing disk > unplug option'. Since it seems to describe design decisions and > limitations that still apply it seems worth havin

Re: [PATCH v2 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug()

2022-05-19 Thread Anthony PERARD via
On Fri, May 13, 2022 at 08:09:57PM +0200, Bernhard Beschow wrote: > This function was declared in a generic and public header, implemented > in a device-specific source file but only used in xen_platform. Given its > 'aux' parameter, this function is more xen-specific than piix-specific. > Also, th

[PULL 2/3] hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug()

2022-06-09 Thread Anthony PERARD via
From: Bernhard Beschow The comment is based on commit message ae4d2eb273b167dad748ea4249720319240b1ac2 'xen-platform: add missing disk unplug option'. Since it seems to describe design decisions and limitations that still apply it seems worth having. Signed-off-by: Bernhard Beschow Reviewed-by:

[PULL 1/3] hw/ide/piix: Remove redundant "piix3-ide-xen" device class

2022-06-09 Thread Anthony PERARD via
From: Bernhard Beschow Commit 0f8445820f11a69154309863960328dda3dc1ad4 'xen: piix reuse pci generic class init function' already resolved redundant code which in turn rendered piix3-ide-xen redundant. Signed-off-by: Bernhard Beschow Reviewed-by: Anthony PERARD Message-Id: <20220513180957.90514

[PULL 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug()

2022-06-09 Thread Anthony PERARD via
From: Bernhard Beschow This function was declared in a generic and public header, implemented in a device-specific source file but only used in xen_platform. Given its 'aux' parameter, this function is more xen-specific than piix-specific. Also, the hardcoded magic constants seem to be generic an

Re: [PATCH v5 12/21] xen-block: implement BlockDevOps->drained_begin()

2023-05-16 Thread Anthony PERARD via
On Thu, May 04, 2023 at 03:53:18PM -0400, Stefan Hajnoczi wrote: > Detach event channels during drained sections to stop I/O submission > from the ring. xen-block is no longer reliant on aio_disable_external() > after this patch. This will allow us to remove the > aio_disable_external() API once al

Re: [PATCH v5 13/21] hw/xen: do not set is_external=true on evtchn fds

2023-05-16 Thread Anthony PERARD via
On Thu, May 04, 2023 at 03:53:19PM -0400, Stefan Hajnoczi wrote: > is_external=true suspends fd handlers between aio_disable_external() and > aio_enable_external(). The block layer's drain operation uses this > mechanism to prevent new I/O from sneaking in between > bdrv_drained_begin() and bdrv_dr

Re: [PATCH v5 12/21] xen-block: implement BlockDevOps->drained_begin()

2023-05-16 Thread Anthony PERARD via
On Thu, May 04, 2023 at 03:53:18PM -0400, Stefan Hajnoczi wrote: > @@ -819,11 +841,9 @@ void xen_block_dataplane_start(XenBlockDataPlane > *dataplane, > blk_set_aio_context(dataplane->blk, dataplane->ctx, NULL); > aio_context_release(old_context); > > -/* Only reason for failure is

[PATCH] xen-block: Avoid leaks on new error path

2023-07-04 Thread Anthony PERARD via
From: Anthony PERARD Commit 189829399070 ("xen-block: Use specific blockdev driver") introduced a new error path, without taking care of allocated resources. So only allocate the qdicts after the error check, and free both `filename` and `driver` when we are about to return and thus taking care

[PATCH] xen-block: Fix removal of backend instance via xenstore

2021-03-08 Thread Anthony PERARD via
From: Anthony PERARD Whenever a Xen block device is detach via xenstore, the image associated with it remained open by the backend QEMU and an error is logged: qemu-system-i386: failed to destroy drive: Node xvdz-qcow2 is in use This happened since object_unparent() doesn't immediately frees