[PULL 07/20] block: add some trace events for new block layer APIs

2023-04-20 Thread Stefan Hajnoczi
From: Sam Li Signed-off-by: Sam Li Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-8-faithilike...@gmail.com Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 3 +++ block/trace-events | 2 ++ 2 files changed, 5

[PULL 03/20] block/block-backend: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-04-20 Thread Stefan Hajnoczi
=host_device, filename=/dev/nullb0 -c "zrp offset nr_zones" Signed-off-by: Sam Li Reviewed-by: Hannes Reinecke Reviewed-by: Stefan Hajnoczi Reviewed-by: Dmitry Fomichev Acked-by: Kevin Wolf Message-id: 20230324090605.28361-4-faithilike...@gmail.com [Adjust commit message prefix as

[PATCH v3 07/20] block/export: stop using is_external in vhost-user-blk server

2023-04-20 Thread Stefan Hajnoczi
the aio_disable_external() API cannot be used since multiple AioContext may be processing I/O, not just one. Switch to BlockDevOps->drained_begin/end() callbacks. Signed-off-by: Stefan Hajnoczi --- block/export/vhost-user-blk-server.c | 43 ++-- util/vhost-user-server.c |

[PATCH v3 19/20] virtio: do not set is_external=true on host notifiers

2023-04-20 Thread Stefan Hajnoczi
Host notifiers can now use is_external=false since virtio-blk and virtio-scsi no longer rely on is_external=true for drained sections. Signed-off-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio

[PATCH v3 05/20] util/vhost-user-server: rename refcount to in_flight counter

2023-04-20 Thread Stefan Hajnoczi
there are no more requests. Avoid confusing by renaming refcount and ref/unref to in_flight and inc/dec. Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Hajnoczi --- include/qemu/vhost-user-server.h | 6 +++--- block/export/vhost-user-blk-server.c | 11

[PATCH v3 12/20] hw/xen: do not set is_external=true on evtchn fds

2023-04-20 Thread Stefan Hajnoczi
BlockDevOps .drained_begin/end() callbacks. It no longer relies on is_external=true so it is safe to pass is_external=false. This is part of ongoing work to remove the aio_disable_external() API. Signed-off-by: Stefan Hajnoczi --- hw/xen/xen-bus.c | 8 1 file changed, 4 insertions(+), 4

[PATCH v3 17/20] virtio-blk: implement BlockDevOps->drained_begin()

2023-04-20 Thread Stefan Hajnoczi
attaching/detaching ioeventfds if the data plane is started/stopped during a drained section. This should be rare, but maybe the mirror block job can trigger it. Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.c | 17 +-- hw/block/virtio-blk.c | 38

[PATCH v3 10/20] block: drain from main loop thread in bdrv_co_yield_to_drain()

2023-04-20 Thread Stefan Hajnoczi
. Signed-off-by: Stefan Hajnoczi --- include/sysemu/block-backend-common.h | 25 + block/io.c| 3 ++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/sysemu/block-backend-common.h b/include/sysemu/block-backend-common.h index

[PATCH v3 06/20] block/export: wait for vhost-user-blk requests when draining

2023-04-20 Thread Stefan Hajnoczi
there are requests in flight. The in-flight counter needs to be atomic. Signed-off-by: Stefan Hajnoczi --- include/qemu/vhost-user-server.h | 4 +++- block/export/vhost-user-blk-server.c | 19 +++ util/vhost-user-server.c | 14 ++ 3 files changed, 32

[PATCH v3 16/20] virtio: make it possible to detach host notifier from any thread

2023-04-20 Thread Stefan Hajnoczi
-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.c | 2 ++ hw/scsi/virtio-scsi-dataplane.c | 9 + 2 files changed, 11 insertions(+) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index b28d81737e..bd7cc6e76b 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b

[PATCH v3 14/20] block/export: don't require AioContext lock around blk_exp_ref/unref()

2023-04-20 Thread Stefan Hajnoczi
The FUSE export calls blk_exp_ref/unref() without the AioContext lock. Instead of fixing the FUSE export, adjust blk_exp_ref/unref() so they work without the AioContext lock. This way it's less error-prone. Suggested-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- include/block/export.h

[PATCH v3 13/20] block/export: rewrite vduse-blk drain code

2023-04-20 Thread Stefan Hajnoczi
in .drained_end(). This eliminates the need for the aio_set_fd_handler(is_external=true) flag, which is being removed from QEMU. This is a long list but splitting it into individual commits would probably lead to git bisect failures - the changes are all related. Signed-off-by: Stefan Hajnoczi

[PATCH v3 11/20] xen-block: implement BlockDevOps->drained_begin()

2023-04-20 Thread Stefan Hajnoczi
on the dataplane instance, so move the blk_set_dev_ops() call after xen_block_dataplane_create(). Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/xen-block.h | 2 ++ hw/block/dataplane/xen-block.c | 42 +- hw/block/xen-block.c | 24

[PATCH v3 18/20] virtio-scsi: implement BlockDevOps->drained_begin()

2023-04-20 Thread Stefan Hajnoczi
sees one pair of .drained_begin/end() calls. After this commit, virtio-scsi no longer depends on hw/virtio's ioeventfd aio_set_event_notifier(is_external=true). This commit is a step towards removing the aio_disable_external() API. Signed-off-by: Stefan Hajnoczi --- include/hw/scsi/scsi.h

[PATCH v3 04/20] block/export: only acquire AioContext once for vhost_user_server_stop()

2023-04-20 Thread Stefan Hajnoczi
vhost_user_server_stop() uses AIO_WAIT_WHILE(). AIO_WAIT_WHILE() requires that AioContext is only acquired once. Since blk_exp_request_shutdown() already acquires the AioContext it shouldn't be acquired again in vhost_user_server_stop(). Signed-off-by: Stefan Hajnoczi --- util/vhost-user

[PATCH v3 15/20] block/fuse: do not set is_external=true on FUSE fd

2023-04-20 Thread Stefan Hajnoczi
This is part of ongoing work to remove the aio_disable_external() API. Use BlockDevOps .drained_begin/end/poll() instead of aio_set_fd_handler(is_external=true). As a side-effect the FUSE export now follows AioContext changes like the other export types. Signed-off-by: Stefan Hajnoczi

[PATCH v3 03/20] virtio-scsi: stop using aio_disable_external() during unplug

2023-04-20 Thread Stefan Hajnoczi
le_device_unplug_cb() returns. Thanks to these two conditions we don't need aio_disable_external() anymore. Cc: Zhengui Li Reviewed-by: Paolo Bonzini Reviewed-by: Daniil Tatianin Signed-off-by: Stefan Hajnoczi --- hw/scsi/scsi-disk.c | 1 + hw/scsi/virtio-scsi.c | 3 --- 2 files changed

[PATCH v3 08/20] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore

2023-04-20 Thread Stefan Hajnoczi
-by: Stefan Hajnoczi --- hw/i386/kvm/xen_xenstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/kvm/xen_xenstore.c b/hw/i386/kvm/xen_xenstore.c index 900679af8a..6e81bc8791 100644 --- a/hw/i386/kvm/xen_xenstore.c +++ b/hw/i386/kvm/xen_xenstore.c @@ -133,7 +133,7

[PATCH v3 20/20] aio: remove aio_disable_external() API

2023-04-20 Thread Stefan Hajnoczi
, is_external, io_read, io_poll, io_poll_ready; @@ - aio_set_event_notifier(ctx, notifier, is_external, io_read, io_poll, io_poll_ready) + aio_set_event_notifier(ctx, notifier, io_read, io_poll, io_poll_ready) Reviewed-by: Juan Quintela Signed-off-by: Stefan Hajnoczi --- include/block/aio.h

[PATCH v3 01/20] hw/qdev: introduce qdev_is_realized() helper

2023-04-20 Thread Stefan Hajnoczi
-off-by: Stefan Hajnoczi --- include/hw/qdev-core.h | 17 ++--- hw/scsi/scsi-bus.c | 3 +-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index bd50ad5ee1..4d734cf35e 100644 --- a/include/hw/qdev-core.h +++ b/include

[PATCH v3 09/20] block: add blk_in_drain() API

2023-04-20 Thread Stefan Hajnoczi
The BlockBackend quiesce_counter is greater than zero during drained sections. Add an API to check whether the BlockBackend is in a drained section. The next patch will use this API. Signed-off-by: Stefan Hajnoczi --- include/sysemu/block-backend-global-state.h | 1 + block/block-backend.c

[PATCH v3 02/20] virtio-scsi: avoid race between unplug and transport event

2023-04-20 Thread Stefan Hajnoczi
Tatianin Signed-off-by: Stefan Hajnoczi --- hw/scsi/scsi-bus.c| 3 ++- hw/scsi/virtio-scsi.c | 18 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 07275fb631..64d7311757 100644 --- a/hw/scsi/scsi-bus.c +++ b

[PATCH v3 00/20] block: remove aio_disable_external() API

2023-04-20 Thread Stefan Hajnoczi
already sent as a separate series. I included them because they are necessary in order to fully remove aio_disable_external(). Based-on: 087bc644b7634436ca9d52fe58ba9234e2bef026 (kevin/block-next) Stefan Hajnoczi (20): hw/qdev: introduce qdev_is_realized() helper virtio-scsi: avoid race

Re: [PATCH v2 16/16] virtio: make it possible to detach host notifier from any thread

2023-04-20 Thread Stefan Hajnoczi
On Wed, 19 Apr 2023 at 14:52, Eric Blake wrote: > > On Wed, Apr 19, 2023 at 01:28:17PM -0400, Stefan Hajnoczi wrote: > > virtio_queue_aio_detach_host_notifier() does two things: > > 1. It removes the fd handler from the event loop. > > 2. It processes the

[PATCH v2 04/16] block/export: only acquire AioContext once for vhost_user_server_stop()

2023-04-19 Thread Stefan Hajnoczi
vhost_user_server_stop() uses AIO_WAIT_WHILE(). AIO_WAIT_WHILE() requires that AioContext is only acquired once. Since blk_exp_request_shutdown() already acquires the AioContext it shouldn't be acquired again in vhost_user_server_stop(). Signed-off-by: Stefan Hajnoczi --- util/vhost-user

[PATCH v2 05/16] util/vhost-user-server: rename refcount to in_flight counter

2023-04-19 Thread Stefan Hajnoczi
there are no more requests. Avoid confusing by renaming refcount and ref/unref to in_flight and inc/dec. Reviewed-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- include/qemu/vhost-user-server.h | 6 +++--- block/export/vhost-user-blk-server.c | 11 +++ util/vhost-user-server.c

[PATCH v2 00/16] block: remove aio_disable_external() API

2023-04-19 Thread Stefan Hajnoczi
-on: 087bc644b7634436ca9d52fe58ba9234e2bef026 (kevin/block-next) Stefan Hajnoczi (16): hw/qdev: introduce qdev_is_realized() helper virtio-scsi: avoid race between unplug and transport event virtio-scsi: stop using aio_disable_external() during unplug block/export: only acquire AioContext

[PATCH v2 02/16] virtio-scsi: avoid race between unplug and transport event

2023-04-19 Thread Stefan Hajnoczi
Tatianin Signed-off-by: Stefan Hajnoczi --- hw/scsi/scsi-bus.c| 3 ++- hw/scsi/virtio-scsi.c | 18 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 07275fb631..64d7311757 100644 --- a/hw/scsi/scsi-bus.c +++ b

[PATCH v2 13/16] block/export: rewrite vduse-blk drain code

2023-04-19 Thread Stefan Hajnoczi
in .drained_end(). This eliminates the need for the aio_set_fd_handler(is_external=true) flag, which is being removed from QEMU. This is a long list but splitting it into individual commits would probably lead to git bisect failures - the changes are all related. Signed-off-by: Stefan Hajnoczi

[PATCH v2 03/16] virtio-scsi: stop using aio_disable_external() during unplug

2023-04-19 Thread Stefan Hajnoczi
le_device_unplug_cb() returns. Thanks to these two conditions we don't need aio_disable_external() anymore. Cc: Zhengui Li Reviewed-by: Paolo Bonzini Reviewed-by: Daniil Tatianin Signed-off-by: Stefan Hajnoczi --- hw/scsi/scsi-disk.c | 1 + hw/scsi/virtio-scsi.c | 3 --- 2 files changed

[PATCH v2 15/16] block/fuse: do not set is_external=true on FUSE fd

2023-04-19 Thread Stefan Hajnoczi
This is part of ongoing work to remove the aio_disable_external() API. Use BlockDevOps .drained_begin/end/poll() instead of aio_set_fd_handler(is_external=true). As a side-effect the FUSE export now follows AioContext changes like the other export types. Signed-off-by: Stefan Hajnoczi

[PATCH v2 11/16] xen-block: implement BlockDevOps->drained_begin()

2023-04-19 Thread Stefan Hajnoczi
on the dataplane instance, so move the blk_set_dev_ops() call after xen_block_dataplane_create(). Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/xen-block.h | 2 ++ hw/block/dataplane/xen-block.c | 42 +- hw/block/xen-block.c | 24

[PATCH v2 14/16] block/export: don't require AioContext lock around blk_exp_ref/unref()

2023-04-19 Thread Stefan Hajnoczi
The FUSE export calls blk_exp_ref/unref() without the AioContext lock. Instead of fixing the FUSE export, adjust blk_exp_ref/unref() so they work without the AioContext lock. This way it's less error-prone. Suggested-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- include/block/export.h

[PATCH v2 07/16] block/export: stop using is_external in vhost-user-blk server

2023-04-19 Thread Stefan Hajnoczi
the aio_disable_external() API cannot be used since multiple AioContext may be processing I/O, not just one. Switch to BlockDevOps->drained_begin/end() callbacks. Signed-off-by: Stefan Hajnoczi --- block/export/vhost-user-blk-server.c | 43 ++-- util/vhost-user-server.c |

[PATCH v2 08/16] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore

2023-04-19 Thread Stefan Hajnoczi
There is no need to suspend activity between aio_disable_external() and aio_enable_external(), which is mainly used for the block layer's drain operation. This is part of ongoing work to remove the aio_disable_external() API. Reviewed-by: David Woodhouse Signed-off-by: Stefan Hajnoczi --- hw

[PATCH v2 06/16] block/export: wait for vhost-user-blk requests when draining

2023-04-19 Thread Stefan Hajnoczi
there are requests in flight. The in-flight counter needs to be atomic. Signed-off-by: Stefan Hajnoczi --- include/qemu/vhost-user-server.h | 4 +++- block/export/vhost-user-blk-server.c | 19 +++ util/vhost-user-server.c | 14 ++ 3 files changed, 32

[PATCH v2 16/16] virtio: make it possible to detach host notifier from any thread

2023-04-19 Thread Stefan Hajnoczi
-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.c | 2 ++ hw/scsi/virtio-scsi-dataplane.c | 9 + 2 files changed, 11 insertions(+) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index b28d81737e..bd7cc6e76b 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b

[PATCH v2 12/16] hw/xen: do not set is_external=true on evtchn fds

2023-04-19 Thread Stefan Hajnoczi
BlockDevOps .drained_begin/end() callbacks. It no longer relies on is_external=true so it is safe to pass is_external=false. This is part of ongoing work to remove the aio_disable_external() API. Signed-off-by: Stefan Hajnoczi --- hw/xen/xen-bus.c | 8 1 file changed, 4 insertions(+), 4

[PATCH v2 10/16] block: drain from main loop thread in bdrv_co_yield_to_drain()

2023-04-19 Thread Stefan Hajnoczi
. Signed-off-by: Stefan Hajnoczi --- include/sysemu/block-backend-common.h | 25 + block/io.c| 3 ++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/sysemu/block-backend-common.h b/include/sysemu/block-backend-common.h index

[PATCH v2 01/16] hw/qdev: introduce qdev_is_realized() helper

2023-04-19 Thread Stefan Hajnoczi
Add a helper function to check whether the device is realized without requiring the Big QEMU Lock. The next patch adds a second caller. The goal is to avoid spreading DeviceState field accesses throughout the code. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Hajnoczi --- include

[PATCH v2 09/16] block: add blk_in_drain() API

2023-04-19 Thread Stefan Hajnoczi
The BlockBackend quiesce_counter is greater than zero during drained sections. Add an API to check whether the BlockBackend is in a drained section. The next patch will use this API. Signed-off-by: Stefan Hajnoczi --- include/sysemu/block-backend-global-state.h | 1 + block/block-backend.c

Re: [Virtio-fs] [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-19 Thread Stefan Hajnoczi
On Wed, 19 Apr 2023 at 07:16, Hanna Czenczek wrote: > > On 19.04.23 13:10, Stefan Hajnoczi wrote: > > On Wed, 19 Apr 2023 at 06:57, Hanna Czenczek wrote: > >> On 18.04.23 19:59, Stefan Hajnoczi wrote: > >>> On Tue, Apr 18, 2023 at 10:09:30AM +0200, Eugenio Perez

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-19 Thread Stefan Hajnoczi
On Wed, 19 Apr 2023 at 07:10, Hanna Czenczek wrote: > > On 18.04.23 09:54, Eugenio Perez Martin wrote: > > On Mon, Apr 17, 2023 at 9:21 PM Stefan Hajnoczi wrote: > >> On Mon, 17 Apr 2023 at 15:08, Eugenio Perez Martin > >> wrote: > >>> On Mo

Re: [Virtio-fs] [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-19 Thread Stefan Hajnoczi
On Wed, 19 Apr 2023 at 06:57, Hanna Czenczek wrote: > > On 18.04.23 19:59, Stefan Hajnoczi wrote: > > On Tue, Apr 18, 2023 at 10:09:30AM +0200, Eugenio Perez Martin wrote: > >> On Mon, Apr 17, 2023 at 9:33 PM Stefan Hajnoczi wrote: > >>> On Mon, 17 Apr 20

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-19 Thread Stefan Hajnoczi
On Wed, 19 Apr 2023 at 06:45, Hanna Czenczek wrote: > > On 14.04.23 17:17, Eugenio Perez Martin wrote: > > On Thu, Apr 13, 2023 at 7:55 PM Hanna Czenczek wrote: > > [...] > > >> Basically, what I’m hearing is that I need to implement a different > >> feature that has no practical impact right

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-18 Thread Stefan Hajnoczi
On Tue, 18 Apr 2023 at 14:31, Eugenio Perez Martin wrote: > > On Tue, Apr 18, 2023 at 7:59 PM Stefan Hajnoczi wrote: > > > > On Tue, Apr 18, 2023 at 10:09:30AM +0200, Eugenio Perez Martin wrote: > > > On Mon, Apr 17, 2023 at 9:33 PM Stefan Hajnoczi > > > w

Status of "block: Mark drain related functions GRAPH_RDLOCK"?

2023-04-18 Thread Stefan Hajnoczi
Hi Emanuele and Kevin, The following commit is not in qemu.git/master or Kevin's block-next tree: https://repo.or.cz/qemu/kevin.git/commitdiff/b4959a8028f417a269168e1570b5e502123e64ed Do you what the status of that patch is? Multi-queue block layer code I'm working on depends on this change to

Re: [PATCH V4] tracing: install trace events file only if necessary

2023-04-18 Thread Stefan Hajnoczi
On Fri, 7 Apr 2023 at 21:05, wrote: > > From: Carlos Santos > > It is not useful when configuring with --enable-trace-backends=nop. > > Signed-off-by: Carlos Santos > --- > Changes v1->v2: > Install based on chosen trace backend, not on chosen emulators. > Changes v2->v3: > Add missing

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-18 Thread Stefan Hajnoczi
On Tue, Apr 18, 2023 at 10:09:30AM +0200, Eugenio Perez Martin wrote: > On Mon, Apr 17, 2023 at 9:33 PM Stefan Hajnoczi wrote: > > > > On Mon, 17 Apr 2023 at 15:10, Eugenio Perez Martin > > wrote: > > > > > > On Mon, Apr 17, 2023 at 5:38 PM Stefan Hajnocz

Re: [PATCH 00/12] virtio: add vhost-user-generic and reduce copy and paste

2023-04-18 Thread Stefan Hajnoczi
On Mon, Apr 17, 2023 at 05:14:59PM +0100, Alex Bennée wrote: > > Stefan Hajnoczi writes: > > > On Fri, 14 Apr 2023 at 12:06, Alex Bennée wrote: > >> > >> A lot of our vhost-user stubs are large chunks of boilerplate that do > >> (mostly) t

Move vhost-user SET_STATUS 0 after get vring base?

2023-04-18 Thread Stefan Hajnoczi
Hi, Cindy's commit ca71db438bdc ("vhost: implement vhost_dev_start method") added SET_STATUS calls to vhost_dev_start() and vhost_dev_stop() for all vhost backends. Eugenio's commit c3716f260bff ("vdpa: move vhost reset after get vring base") deferred the SET_STATUS 0 call in vhost_dev_stop()

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Mon, 17 Apr 2023 at 15:12, Eugenio Perez Martin wrote: > > On Mon, Apr 17, 2023 at 9:08 PM Stefan Hajnoczi wrote: > > > > On Mon, 17 Apr 2023 at 14:56, Eugenio Perez Martin > > wrote: > > > > > > On Mon, Apr 17, 2023 at 5:18 PM Stefan Hajnoczi &

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Mon, 17 Apr 2023 at 15:10, Eugenio Perez Martin wrote: > > On Mon, Apr 17, 2023 at 5:38 PM Stefan Hajnoczi wrote: > > > > On Thu, Apr 13, 2023 at 12:14:24PM +0200, Eugenio Perez Martin wrote: > > > On Wed, Apr 12, 2023 at 11:06 PM Stefan Hajnoczi > > > w

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Mon, 17 Apr 2023 at 15:08, Eugenio Perez Martin wrote: > > On Mon, Apr 17, 2023 at 7:14 PM Stefan Hajnoczi wrote: > > > > On Thu, Apr 13, 2023 at 12:14:24PM +0200, Eugenio Perez Martin wrote: > > > On Wed, Apr 12, 2023 at 11:06 PM Stefan Hajnoczi > > > w

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Mon, 17 Apr 2023 at 14:56, Eugenio Perez Martin wrote: > > On Mon, Apr 17, 2023 at 5:18 PM Stefan Hajnoczi wrote: > > > > On Fri, Apr 14, 2023 at 05:17:02PM +0200, Eugenio Perez Martin wrote: > > > On Thu, Apr 13, 2023 at 7:55 PM Hanna Czenczek wrote: > &

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Thu, Apr 13, 2023 at 12:14:24PM +0200, Eugenio Perez Martin wrote: > On Wed, Apr 12, 2023 at 11:06 PM Stefan Hajnoczi wrote: > > > > On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: > > > So-called "internal" virtio-fs migration refers to

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Thu, Apr 13, 2023 at 12:14:24PM +0200, Eugenio Perez Martin wrote: > On Wed, Apr 12, 2023 at 11:06 PM Stefan Hajnoczi wrote: > > > > On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: > > > So-called "internal" virtio-fs migration refers to

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Fri, Apr 14, 2023 at 05:17:02PM +0200, Eugenio Perez Martin wrote: > On Thu, Apr 13, 2023 at 7:55 PM Hanna Czenczek wrote: > > > > On 13.04.23 13:38, Stefan Hajnoczi wrote: > > > On Thu, 13 Apr 2023 at 05:24, Hanna Czenczek wrote: > > >> On 1

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-17 Thread Stefan Hajnoczi
On Thu, Apr 13, 2023 at 07:31:57PM +0200, Hanna Czenczek wrote: > On 13.04.23 12:14, Eugenio Perez Martin wrote: > > On Wed, Apr 12, 2023 at 11:06 PM Stefan Hajnoczi > > wrote: > > > On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: > > > > So-c

Re: [PATCH 00/12] virtio: add vhost-user-generic and reduce copy and paste

2023-04-17 Thread Stefan Hajnoczi
On Fri, 14 Apr 2023 at 12:06, Alex Bennée wrote: > > A lot of our vhost-user stubs are large chunks of boilerplate that do > (mostly) the same thing. This series attempts to fix that by defining > a new base class for vhost-user devices and then converting the rng > and gpio devices to be based

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-13 Thread Stefan Hajnoczi
On Thu, 13 Apr 2023 at 13:55, Hanna Czenczek wrote: > > On 13.04.23 13:38, Stefan Hajnoczi wrote: > > On Thu, 13 Apr 2023 at 05:24, Hanna Czenczek wrote: > >> On 12.04.23 23:06, Stefan Hajnoczi wrote: > >>> On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna

Re: [PATCH for-7.2 v3 3/3] rtl8139: honor large send MSS value

2023-04-13 Thread Stefan Hajnoczi
On Thu, Apr 13, 2023 at 04:38:52PM +0100, Peter Maydell wrote: > On Thu, 17 Nov 2022 at 16:58, Stefan Hajnoczi wrote: > > > > The Large-Send Task Offload Tx Descriptor (9.2.1 Transmit) has a > > Large-Send MSS value where the driver specifies the MSS. See the > &g

[PATCH] rtl8139: fix large_send_mss divide-by-zero

2023-04-13 Thread Stefan Hajnoczi
https://gitlab.com/qemu-project/qemu/-/issues/1582 Fixes: 6d71357a3b65 ("rtl8139: honor large send MSS value") Reported-by: Alexander Bulekov Cc: Peter Maydell Signed-off-by: Stefan Hajnoczi --- hw/net/rtl8139.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/net/rtl8139.c b/hw/net

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-13 Thread Stefan Hajnoczi
On Thu, 13 Apr 2023 at 05:24, Hanna Czenczek wrote: > > On 12.04.23 23:06, Stefan Hajnoczi wrote: > > On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: > >> So-called "internal" virtio-fs migration refers to transporting the > >> back-

Re: [PATCH 3/4] vhost: Add high-level state save/load functions

2023-04-13 Thread Stefan Hajnoczi
On Thu, 13 Apr 2023 at 05:04, Hanna Czenczek wrote: > > On 12.04.23 23:14, Stefan Hajnoczi wrote: > > On Tue, Apr 11, 2023 at 05:05:14PM +0200, Hanna Czenczek wrote: > >> vhost_save_backend_state() and vhost_load_backend_state() can be used by > >> vhost fron

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-13 Thread Stefan Hajnoczi
On Thu, 13 Apr 2023 at 06:15, Eugenio Perez Martin wrote: > On Wed, Apr 12, 2023 at 11:06 PM Stefan Hajnoczi wrote: > > On Tue, Apr 11, 2023 at 05:05:13PM +0200, Hanna Czenczek wrote: > > (And I hope vDPA will import the device state vhost-user messages > > introduced in th

Re: [PATCH 1/4] vhost: Re-enable vrings after setting features

2023-04-13 Thread Stefan Hajnoczi
On Tue, 11 Apr 2023 at 11:05, Hanna Czenczek wrote: > > If the back-end supports the VHOST_USER_F_PROTOCOL_FEATURES feature, > setting the vhost features will set this feature, too. Doing so > disables all vrings, which may not be intended. > > For example, enabling or disabling logging during

Re: [PATCH 1/4] vhost: Re-enable vrings after setting features

2023-04-13 Thread Stefan Hajnoczi
On Thu, 13 Apr 2023 at 04:20, Hanna Czenczek wrote: > > On 12.04.23 22:51, Stefan Hajnoczi wrote: > > On Tue, Apr 11, 2023 at 05:05:12PM +0200, Hanna Czenczek wrote: > >> If the back-end supports the VHOST_USER_F_PROTOCOL_FEATURES feature, > >> setting the vhost

Re: [PATCH 3/4] vhost: Add high-level state save/load functions

2023-04-12 Thread Stefan Hajnoczi
On Tue, Apr 11, 2023 at 05:05:14PM +0200, Hanna Czenczek wrote: > vhost_save_backend_state() and vhost_load_backend_state() can be used by > vhost front-ends to easily save and load the back-end's state to/from > the migration stream. > > Because we do not know the full state size ahead of time,

Re: [PATCH 2/4] vhost-user: Interface for migration state transfer

2023-04-12 Thread Stefan Hajnoczi
d the reading > side reads it until it sees an EOF. Then, the front-end will check for > success via CHECK_DEVICE_STATE, which on the destination side includes > checking for integrity (i.e. errors during deserialization). > > Suggested-by: Stefan Hajnoczi > Signed-off-by: Hann

Re: [PATCH 0/4] vhost-user-fs: Internal migration

2023-04-12 Thread Stefan Hajnoczi
Hi, Is there a vhost-user.rst spec patch? Thanks, Stefan signature.asc Description: PGP signature

Re: [PATCH 1/4] vhost: Re-enable vrings after setting features

2023-04-12 Thread Stefan Hajnoczi
On Tue, Apr 11, 2023 at 05:05:12PM +0200, Hanna Czenczek wrote: > If the back-end supports the VHOST_USER_F_PROTOCOL_FEATURES feature, > setting the vhost features will set this feature, too. Doing so > disables all vrings, which may not be intended. > > For example, enabling or disabling

[PATCH] block/file-posix: use unsigned int for zones consistently

2023-04-10 Thread Stefan Hajnoczi
are likely to exceed MAX_INT zones any time soon, so this is mostly a code cleanup. Cc: Sam Li Cc: Dmitry Fomichev Cc: Damien Le Moal Signed-off-by: Stefan Hajnoczi --- block/file-posix.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) This is a cleanup on top of "[PATCH v

Re: [PATCH v10 0/5] Add zoned storage emulation to virtio-blk driver

2023-04-10 Thread Stefan Hajnoczi
On Fri, Apr 07, 2023 at 04:25:23PM +0800, Sam Li wrote: > This patch adds zoned storage emulation to the virtio-blk driver. It > implements the virtio-blk ZBD support standardization that is > recently accepted by virtio-spec. The link to related commit is at > >

Re: [PATCH v9 0/4] Add zone append write for zoned device

2023-04-10 Thread Stefan Hajnoczi
On Fri, Apr 07, 2023 at 04:16:53PM +0800, Sam Li wrote: > This patch series add zone append operation based on the previous > zoned device support part. The file-posix driver is modified to > add zone append emulation using regular writes. > > v9: > - address review comments [Stefan] > * fix

Re: [PATCH v9 1/4] file-posix: add tracking of the zone write pointers

2023-04-10 Thread Stefan Hajnoczi
On Fri, Apr 07, 2023 at 04:16:54PM +0800, Sam Li wrote: > Since Linux doesn't have a user API to issue zone append operations to > zoned devices from user space, the file-posix driver is modified to add > zone append emulation using regular writes. To do this, the file-posix > driver tracks the wp

Re: [PATCH] tracetool: use relative paths for '#line' preprocessor directives

2023-04-09 Thread Stefan Hajnoczi
On Thu, 6 Apr 2023 at 09:22, Thomas De Schampheleire wrote: > > The event filename is an absolute path. Convert it to a relative path when > writing '#line' directives, to preserve reproducibility of the generated > output when different base paths are used. > > Signed-off-by: Thomas De

Re: [PATCH] docs: explain effect of smp_read_barrier_depends() on modern architectures

2023-04-07 Thread Stefan Hajnoczi
a to a footnote > together > with other architectures where it is equivalent to smp_rmb(). > > Suggested-by: Stefan Hajnoczi > Signed-off-by: Paolo Bonzini > --- > docs/devel/atomics.rst | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > Modul

Re: [PATCH for-8.1] qemu-coroutine: remove qatomic_mb_read()

2023-04-07 Thread Stefan Hajnoczi
On Fri, Apr 07, 2023 at 10:32:39AM +0200, Paolo Bonzini wrote: > Il gio 6 apr 2023, 12:55 Stefan Hajnoczi ha scritto: > > > On Thu, 6 Apr 2023 at 06:09, Paolo Bonzini wrote: > > > > > > Replace with an explicit barrier and a comment. > >

Re: [PATCH for-8.1] qemu-coroutine: remove qatomic_mb_read()

2023-04-06 Thread Stefan Hajnoczi
On Thu, 6 Apr 2023 at 06:09, Paolo Bonzini wrote: > > Replace with an explicit barrier and a comment. > > Signed-off-by: Paolo Bonzini > --- > util/qemu-coroutine.c | 10 +++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c

Re: [PATCH for-8.1] block/nfs: do not use qatomic_mb_set

2023-04-06 Thread Stefan Hajnoczi
On Thu, 6 Apr 2023 at 06:09, Paolo Bonzini wrote: > > Signed-off-by: Paolo Bonzini > --- > block/nfs.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [PATCH for-8.1] block-backend: remove qatomic_mb_read()

2023-04-06 Thread Stefan Hajnoczi
sertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi

Re: [PATCH v8 2/4] block: introduce zone append write for zoned devices

2023-04-05 Thread Stefan Hajnoczi
+ > include/block/block-io.h | 4 +++ > include/block/block_int-common.h | 3 ++ > include/block/raw-aio.h | 4 ++- > include/sysemu/block-backend-io.h | 9 + > 10 files changed, 171 insertions(+), 7 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH v8 1/4] file-posix: add tracking of the zone write pointers

2023-04-05 Thread Stefan Hajnoczi
On Tue, Apr 04, 2023 at 11:32:36PM +0800, Sam Li wrote: > Since Linux doesn't have a user API to issue zone append operations to > zoned devices from user space, the file-posix driver is modified to add > zone append emulation using regular writes. To do this, the file-posix > driver tracks the wp

Re: [PATCH-for-8.1] block/dmg: Declare a type definition for DMG uncompress function

2023-04-05 Thread Stefan Hajnoczi
On Mon, Mar 20, 2023 at 04:26:10PM +0100, Philippe Mathieu-Daudé wrote: > Introduce the BdrvDmgUncompressFunc type defintion. To emphasis > dmg_uncompress_bz2 and dmg_uncompress_lzfse are pointer to functions, > declare them using this new typedef. > > Signed-off-by: Philippe Mathieu-Daudé > ---

Re: [PATCH 0/4] block: Split padded I/O vectors exceeding IOV_MAX

2023-04-05 Thread Stefan Hajnoczi
+), 88 deletions(-) > create mode 100755 tests/qemu-iotests/tests/iov-padding > create mode 100644 tests/qemu-iotests/tests/iov-padding.out Acked-by: Stefan Hajnoczi signature.asc Description: PGP signature

Re: [PATCH 00/13] block: remove aio_disable_external() API

2023-04-04 Thread Stefan Hajnoczi
On Tue, Apr 04, 2023 at 03:43:20PM +0200, Paolo Bonzini wrote: > On 4/3/23 20:29, Stefan Hajnoczi wrote: > > The aio_disable_external() API temporarily suspends file descriptor > > monitoring > > in the event loop. The block layer uses this to prevent new I/O requests &g

Re: [PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref()

2023-04-04 Thread Stefan Hajnoczi
On Tue, Apr 04, 2023 at 03:46:34PM +0200, Paolo Bonzini wrote: > On 4/3/23 20:30, Stefan Hajnoczi wrote: > > These functions must be called with the AioContext acquired: > > > >/* Callers must hold exp->ctx lock */ > >void blk_exp_ref(BlockExport *exp) >

Re: [PATCH v9 0/5] Add zoned storage emulation to virtio-blk driver

2023-04-04 Thread Stefan Hajnoczi
On Tue, Apr 04, 2023 at 11:46:13PM +0800, Sam Li wrote: > Stefan Hajnoczi 于2023年4月3日周一 20:18写道: > > > > On Wed, 29 Mar 2023 at 01:01, Michael S. Tsirkin wrote: > > > > > > On Mon, Mar 27, 2023 at 10:45:48PM +0800, Sam Li wrote: > > > > > > virt

[PATCH] aio-wait: avoid AioContext lock in aio_wait_bh_oneshot()

2023-04-04 Thread Stefan Hajnoczi
(). Holding a lock across aio_poll() can cause deadlock so we don't want callers to do that. This is a step towards getting rid of the AioContext lock. Cc: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- include/block/aio-wait.h| 2 +- hw/block/dataplane/virtio-blk.c | 3 ++- hw/scsi/virtio

Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event

2023-04-04 Thread Stefan Hajnoczi
On Mon, Apr 03, 2023 at 10:47:11PM +0200, Philippe Mathieu-Daudé wrote: > On 3/4/23 20:29, Stefan Hajnoczi wrote: > > Only report a transport reset event to the guest after the SCSIDevice > > has been unrealized by qdev_simple_device_unplug_cb(). > > > > qdev_sim

[PATCH] block/nvme: use AIO_WAIT_WHILE_UNLOCKED()

2023-04-04 Thread Stefan Hajnoczi
it with AIO_WAIT_WHILE_UNLOCKED(NULL, condition). There is no change in behavior and the dependency on the AioContext lock is eliminated. This is a step towards removing the AioContext lock. Signed-off-by: Stefan Hajnoczi --- block/nvme.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block

[PATCH] block/nfs: avoid BDRV_POLL_WHILE() in nfs_co_get_allocated_file_size()

2023-04-03 Thread Stefan Hajnoczi
e this commit. Signed-off-by: Stefan Hajnoczi --- block/nfs.c | 45 + 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/block/nfs.c b/block/nfs.c index 351dc6ec8d..71062c9b47 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -2

[PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref()

2023-04-03 Thread Stefan Hajnoczi
These functions must be called with the AioContext acquired: /* Callers must hold exp->ctx lock */ void blk_exp_ref(BlockExport *exp) ... /* Callers must hold exp->ctx lock */ void blk_exp_unref(BlockExport *exp) Signed-off-by: Stefan Hajnoczi --- block/export/fuse.c | 4

[PATCH 05/13] block/export: wait for vhost-user-blk requests when draining

2023-04-03 Thread Stefan Hajnoczi
there are requests in flight. The in-flight counter needs to be atomic. Signed-off-by: Stefan Hajnoczi --- include/qemu/vhost-user-server.h | 4 +++- block/export/vhost-user-blk-server.c | 19 +++ util/vhost-user-server.c | 14 ++ 3 files changed, 32

[PATCH 01/13] virtio-scsi: avoid race between unplug and transport event

2023-04-03 Thread Stefan Hajnoczi
needs to be updated to filter out SCSIDevices that are unrealized. These changes ensure that the guest driver does not see the SCSIDevice that's being unplugged if it responds very quickly to the transport reset event. Signed-off-by: Stefan Hajnoczi --- hw/scsi/scsi-bus.c| 3 ++- hw/scsi

[PATCH 03/13] block/export: only acquire AioContext once for vhost_user_server_stop()

2023-04-03 Thread Stefan Hajnoczi
vhost_user_server_stop() uses AIO_WAIT_WHILE(). AIO_WAIT_WHILE() requires that AioContext is only acquired once. Since blk_exp_request_shutdown() already acquires the AioContext it shouldn't be acquired again in vhost_user_server_stop(). Signed-off-by: Stefan Hajnoczi --- util/vhost-user

[PATCH 07/13] virtio: do not set is_external=true on host notifiers

2023-04-03 Thread Stefan Hajnoczi
a finite size, so queuing requests does not lead to unbounded memory usage. Signed-off-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 98c4819fcc..dcd7aabb4e 100644 --- a/hw/virtio

[PATCH 13/13] aio: remove aio_disable_external() API

2023-04-03 Thread Stefan Hajnoczi
, is_external, io_read, io_poll, io_poll_ready; @@ - aio_set_event_notifier(ctx, notifier, is_external, io_read, io_poll, io_poll_ready) + aio_set_event_notifier(ctx, notifier, io_read, io_poll, io_poll_ready) Signed-off-by: Stefan Hajnoczi --- include/block/aio.h | 55

[PATCH 00/13] block: remove aio_disable_external() API

2023-04-03 Thread Stefan Hajnoczi
-on: 087bc644b7634436ca9d52fe58ba9234e2bef026 (kevin/block-next) Stefan Hajnoczi (13): virtio-scsi: avoid race between unplug and transport event virtio-scsi: stop using aio_disable_external() during unplug block/export: only acquire AioContext once for vhost_user_server_stop() util/vhost-user-server: rename refcount

<    11   12   13   14   15   16   17   18   19   20   >