Re: [PATCH 7/7] vhost-user: call VHOST_USER_SET_VRING_ENABLE synchronously

2023-08-30 Thread Stefano Garzarella
negotiated, or - performing a separate VHOST_USER_GET_FEATURES *exchange*, which requires a backend response regardless of VHOST_USER_PROTOCOL_F_REPLY_ACK. Thanks for the excellent analysis (and fix of course!). Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Ji

Re: [PATCH 6/7] vhost-user: allow "vhost_set_vring" to wait for a reply

2023-08-30 Thread Stefano Garzarella
re hard-coded within "vhost_user_write_msg". Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez Pascual Cc: Stefano Garzarella Signed-off-by: Laszlo Ersek --- hw/virtio/vhost-user.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH 4/7] vhost-user: flatten "enforce_reply" into "vhost_user_write_msg"

2023-08-30 Thread Stefano Garzarella
genio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez Pascual Cc: Stefano Garzarella Signed-off-by: Laszlo Ersek --- hw/virtio/vhost-user.c | 32 1 file changed, 13 insertions(+), 19 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH 5/7] vhost-user: hoist "write_msg", "get_features", "get_u64"

2023-08-30 Thread Stefano Garzarella
uot;vhost_set_vring". This is purely code movement -- no observable change. Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez Pascual Cc: Stefano Garzarella Signed-off-by: Laszlo Ersek --- hw/virtio/vhost-user

Re: [PATCH 3/7] vhost-user: factor out "vhost_user_write_msg"

2023-08-30 Thread Stefano Garzarella
y refactoring -- no observable change. Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez Pascual Cc: Stefano Garzarella Signed-off-by: Laszlo Ersek --- hw/virtio/vhost-user.c | 66 +--- 1 file

Re: [PATCH 2/7] vhost-user: tighten "reply_supported" scope in "set_vring_addr"

2023-08-30 Thread Stefano Garzarella
o the minimum. This is purely refactoring -- no observable change. Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez Pascual Cc: Stefano Garzarella Signed-off-by: Laszlo Ersek --- hw/virtio/vhost-user.c | 11 ++

Re: [PATCH 1/7] vhost-user: strip superfluous whitespace

2023-08-30 Thread Stefano Garzarella
On Sun, Aug 27, 2023 at 08:29:31PM +0200, Laszlo Ersek wrote: Cc: "Michael S. Tsirkin" (supporter:vhost) Cc: Eugenio Perez Martin Cc: German Maglione Cc: Liu Jiang Cc: Sergio Lopez Pascual Cc: Stefano Garzarella Signed-off-by: Laszlo Ersek --- hw/virtio/vhost-user.c | 2 +- 1 fi

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-08-03 Thread Stefano Garzarella
Hi Michael, On Thu, Aug 3, 2023 at 10:02 PM Michael S. Tsirkin wrote: > > On Wed, Jul 05, 2023 at 09:15:23AM +0200, Stefano Garzarella wrote: > > This reverts commit 8cc5583abe6419e7faaebc9fbd109f34f4c850f2. > > > > That commit causes several problems in Linu

[PATCH v2 2/2] block/blkio: add more comments on the fd passing handling

2023-08-03 Thread Stefano Garzarella
Signed-off-by: Stefano Garzarella --- block/blkio.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/block/blkio.c b/block/blkio.c index baba2f0b67..1dd495617c 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -713,6 +713,12 @@ static int blkio_virtio_blk_connect(BlockD

[PATCH v2 0/2] block/blkio: fix fd leak and add more comments for the fd passing

2023-08-03 Thread Stefano Garzarella
Hanna discovered an fd leak in the error path, and a few comments to improve in the code. v2: - avoid to use `fd_supported` to track a valid fd [Hanna] v1: https://lore.kernel.org/qemu-devel/20230801160332.122564-1-sgarz...@redhat.com/ Stefano Garzarella (2): block/blkio: close the fd when

[PATCH v2 1/2] block/blkio: close the fd when blkio_connect() fails

2023-08-03 Thread Stefano Garzarella
libblkio drivers take ownership of `fd` only after a successful blkio_connect(), so if it fails, we are still the owners. Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk") Suggested-by: Hanna Czenczek Signed-off-by: Stefano Garzarella --- Not

Re: [PATCH 1/2] block/blkio: close the fd when blkio_connect() fails

2023-08-02 Thread Stefano Garzarella
On Wed, Aug 02, 2023 at 01:15:40PM +0200, Hanna Czenczek wrote: On 01.08.23 18:03, Stefano Garzarella wrote: libblkio drivers take ownership of `fd` only after a successful blkio_connect(), so if it fails, we are still the owners. Fixes: cad2ccc395 ("block/blkio: use qemu_open() to suppo

[PATCH 1/2] block/blkio: close the fd when blkio_connect() fails

2023-08-01 Thread Stefano Garzarella
libblkio drivers take ownership of `fd` only after a successful blkio_connect(), so if it fails, we are still the owners. Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk") Suggested-by: Hanna Czenczek Signed-off-by: Stefano Garzarella --- blo

[PATCH 0/2] block/blkio: fix fd leak and add more comments for the fd passing

2023-08-01 Thread Stefano Garzarella
Hanna discovered an fd leak in the error path, and a few comments to improve in the code. Stefano Garzarella (2): block/blkio: close the fd when blkio_connect() fails block/blkio: add more comments on the fd passing handling block/blkio.c | 24 +--- 1 file changed, 21

[PATCH 2/2] block/blkio: add more comments on the fd passing handling

2023-08-01 Thread Stefano Garzarella
As Hanna pointed out, it is not clear in the code why qemu_open() can fail, and why blkio_set_int("fd") is not enough to discover the `fd` property support. Let's fix them by adding more details in the code comments. Suggested-by: Hanna Czenczek Signed-off-by: Stefano Garzarella

[PATCH v2 0/4] block/blkio: fix opening virtio-blk drivers

2023-07-27 Thread Stefano Garzarella
in UDS - changed patch 4 commit description [Stefan] v1: https://lore.kernel.org/qemu-devel/20230724154611.178858-1-sgarz...@redhat.com/ Based on stefanha/block branch. Stefano Garzarella (4): block/blkio: move blkio_connect() in the drivers functions block/blkio: retry blkio_connect

[PATCH v2 4/4] block/blkio: use blkio_set_int("fd") to check fd support

2023-07-27 Thread Stefano Garzarella
passing. This patch switches to setting the `fd` property because it is a better mechanism for probing fd passing support than getting the `fd` property. Signed-off-by: Stefano Garzarella --- Notes: v2: - changed commit description [Stefan] block/blkio.c | 2 +- 1 file changed, 1 insertion

[PATCH v2 3/4] block/blkio: fall back on using `path` when `fd` setting fails

2023-07-27 Thread Stefano Garzarella
`s always fall back on using `path` if we fail the fd passing. Fixes: cad2ccc395 ("block/blkio: use qemu_open() to support fd passing for virtio-blk") Reported-by: Qing Wang Signed-off-by: Stefano Garzarella --- block/blkio.c | 20 ++-- 1 file changed, 10 inserti

[PATCH v2 2/4] block/blkio: retry blkio_connect() if it fails using `fd`

2023-07-27 Thread Stefano Garzarella
/blkio: use qemu_open() to support fd passing for virtio-blk") Suggested-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- Notes: v2: - reworked retrying blkio_connect() [Stefan] block/blkio.c | 29 + 1 file changed, 29 insertions(+) diff --gi

[PATCH v2 1/4] block/blkio: move blkio_connect() in the drivers functions

2023-07-27 Thread Stefano Garzarella
This is in preparation for the next patch, where for virtio-blk drivers we need to handle the failure of blkio_connect(). Let's also rename the *_open() functions to *_connect() to make the code reflect the changes applied. Signed-off-by: Stefano Garzarella --- block/blkio.c | 67

Re: [PATCH 1/2] block/blkio: fix opening virtio-blk drivers

2023-07-26 Thread Stefano Garzarella
On Wed, Jul 26, 2023 at 11:32:10AM -0400, Stefan Hajnoczi wrote: On Wed, Jul 26, 2023 at 09:26:45AM +0200, Stefano Garzarella wrote: On Tue, Jul 25, 2023 at 04:00:38PM -0400, Stefan Hajnoczi wrote: > On Mon, Jul 24, 2023 at 05:46:10PM +0200, Stefano Garzarella wrote: > > libblkio 1.

[PATCH v2] block/blkio: do not use open flags in qemu_open()

2023-07-26 Thread Stefano Garzarella
ink: https://bugzilla.redhat.com/show_bug.cgi?id=2225439 Reported-by: Qing Wang Signed-off-by: Stefano Garzarella --- Notes: v2: - added comment on top of qemu_open() [Daniel] v1: https://lore.kernel.org/qemu-devel/2023072555.85426-1-sgarz...@redhat.com/ block/bl

Re: [PATCH 2/2] block/blkio: use blkio_set_int("fd") to check fd support

2023-07-26 Thread Stefano Garzarella
On Tue, Jul 25, 2023 at 04:05:38PM -0400, Stefan Hajnoczi wrote: On Mon, Jul 24, 2023 at 05:46:11PM +0200, Stefano Garzarella wrote: The way the virtio-blk driver is implemented in libblkio, it's much easier to use blkio_set_int() instead of blkio_get_int() and have it fail right away to see

Re: [PATCH 1/2] block/blkio: fix opening virtio-blk drivers

2023-07-26 Thread Stefano Garzarella
On Tue, Jul 25, 2023 at 04:00:38PM -0400, Stefan Hajnoczi wrote: On Mon, Jul 24, 2023 at 05:46:10PM +0200, Stefano Garzarella wrote: libblkio 1.3.0 added support of "fd" property for virtio-blk-vhost-vdpa driver. In QEMU, starting from commit cad2ccc395 ("block/blkio: use qemu_op

Re: [PATCH] block/blkio: do not use open flags in qemu_open()

2023-07-25 Thread Stefano Garzarella
On Tue, Jul 25, 2023 at 12:15:40PM +0100, Daniel P. Berrangé wrote: On Tue, Jul 25, 2023 at 01:11:55PM +0200, Stefano Garzarella wrote: qemu_open() in blkio_virtio_blk_common_open() is used to open the character device (e.g. /dev/vhost-vdpa-0 or /dev/vfio/vfio) or in the future eventually

[PATCH] block/blkio: do not use open flags in qemu_open()

2023-07-25 Thread Stefano Garzarella
Qing Wang Signed-off-by: Stefano Garzarella --- block/blkio.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/block/blkio.c b/block/blkio.c index 1798648134..fe9bf8ea5f 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -686,15 +686,7 @@ static int blkio_virtio_blk_c

[PATCH] block/blkio: enable the completion eventfd

2023-07-25 Thread Stefano Garzarella
, bool enable); I discovered this while trying a development version of libblkio: the guest kernel hangs during boot, while probing the device. Fixes: fd66dbd424f5 ("blkio: add libblkio block driver") Signed-off-by: Stefano Garzarella --- block/blkio.c | 1 + 1 file changed, 1 insertio

[PATCH 2/2] block/blkio: use blkio_set_int("fd") to check fd support

2023-07-24 Thread Stefano Garzarella
The way the virtio-blk driver is implemented in libblkio, it's much easier to use blkio_set_int() instead of blkio_get_int() and have it fail right away to see if `fd` is supported by the transport. See https://gitlab.com/libblkio/libblkio/-/merge_requests/208 Signed-off-by: Stefano Garzarella

[PATCH 1/2] block/blkio: fix opening virtio-blk drivers

2023-07-24 Thread Stefano Garzarella
d passing for virtio-blk") Reported-by: Qing Wang Signed-off-by: Stefano Garzarella --- block/blkio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/blkio.c b/block/blkio.c index 1798648134..ca1149042a 100644 --- a/block/blkio.c +++ b/block/blkio.c @@ -662,6

[PATCH 0/2] block/blkio: fix opening virtio-blk drivers

2023-07-24 Thread Stefano Garzarella
There is a problem with virtio-blk-vhost-vdpa. The first patch fixes the issue, the second patch tries to prepare QEMU for a future version of libblkio where we can use blkio_set_fd() to check whether the property is supported or not. Stefano Garzarella (2): block/blkio: fix opening virtio-blk

vdpa: use io_uring passthrough command for IOCTLs [was Re: [PATCH 1/2] Reduce vdpa initialization / startup overhead]

2023-07-18 Thread Stefano Garzarella
On Thu, Apr 20, 2023 at 6:20 AM Jason Wang wrote: > > On Wed, Apr 19, 2023 at 11:33 PM Eugenio Perez Martin > wrote: > > > > On Wed, Apr 19, 2023 at 12:56 AM wrote: > > > > > > From: Pei Li > > > > > > Currently, part of the vdpa initialization / startup process > > > needs to trigger many

Re: [PATCH 1/3] scsi: fetch unit attention when creating the request

2023-07-13 Thread Stefano Garzarella
On Wed, Jul 12, 2023 at 06:38:14PM +0200, Paolo Bonzini wrote: On 7/12/23 15:43, Stefano Garzarella wrote: Commit 1880ad4f4e ("virtio-scsi: Batched prepare for cmd reqs") split calls to scsi_req_new() and scsi_req_enqueue() in the virtio-scsi device. This had no drawback, un

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-12 Thread Stefano Garzarella
On Wed, Jul 12, 2023 at 12:14 PM Stefano Garzarella wrote: > > On Wed, Jul 12, 2023 at 10:06:56AM +0200, Paolo Bonzini wrote: > >On 7/11/23 22:21, Mike Christie wrote: > >>What was the issue you are seeing? > >> > >>Was it something like you get the UA.

[PATCH 0/3] scsi: fix issue with Linux guest and unit attention

2023-07-12 Thread Stefano Garzarella
ogs, and a big thanks to Paolo for his help in preparing this series! Stefano [1] https://lore.kernel.org/qemu-devel/i3od362o6unuimlqna3aaedliaabauj6g545esg7txidd4s44e@bkx5des6zytx/ Stefano Garzarella (3): scsi: fetch unit attention when creating the request scsi: cleanup scsi_clear_unit_

[PATCH 3/3] scsi: clear unit attention only for REPORT LUNS commands

2023-07-12 Thread Stefano Garzarella
-by: Stefano Garzarella --- hw/scsi/scsi-bus.c | 34 +++--- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index f9c95dfb50..fc4b77fdb0 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -22,6 +22,7

[PATCH 2/3] scsi: cleanup scsi_clear_unit_attention()

2023-07-12 Thread Stefano Garzarella
The previous commit moved the unit attention clearing when we create the request. So now we can clean scsi_clear_unit_attention() to handle only the case of the REPORT LUNS command. Suggested-by: Paolo Bonzini Signed-off-by: Stefano Garzarella --- hw/scsi/scsi-bus.c | 28

[PATCH 1/3] scsi: fetch unit attention when creating the request

2023-07-12 Thread Stefano Garzarella
rtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events") Reported-by: Thomas Huth Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2176702 Co-developed-by: Paolo Bonzini Signed-off-by: Stefano Garzarella --- include/hw/scsi/scsi.h | 1 + hw/scsi/scsi-

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-12 Thread Stefano Garzarella
On Wed, Jul 12, 2023 at 10:35:48AM +0200, Paolo Bonzini wrote: On 7/11/23 19:06, Stefano Garzarella wrote: CCing `./scripts/get_maintainer.pl -f drivers/scsi/virtio_scsi.c`, since I found a few things in the virtio-scsi driver... FYI we have seen that Linux has problems with a QEMU patch

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-12 Thread Stefano Garzarella
On Wed, Jul 12, 2023 at 10:06:56AM +0200, Paolo Bonzini wrote: On 7/11/23 22:21, Mike Christie wrote: What was the issue you are seeing? Was it something like you get the UA. We retry then on one of the retries the sense is not setup correctly, so the scsi error handler runs? That fails and

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-12 Thread Stefano Garzarella
On Tue, Jul 11, 2023 at 01:41:31PM -0400, Stefan Hajnoczi wrote: On Tue, 11 Jul 2023 at 13:06, Stefano Garzarella wrote: CCing `./scripts/get_maintainer.pl -f drivers/scsi/virtio_scsi.c`, since I found a few things in the virtio-scsi driver... FYI we have seen that Linux has problems

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-11 Thread Stefano Garzarella
d. Paolo, Stefan, Linux SCSI maintainers, any suggestion? Thanks, Stefano On Wed, Jul 05, 2023 at 09:15:23AM +0200, Stefano Garzarella wrote: This reverts commit 8cc5583abe6419e7faaebc9fbd109f34f4c850f2. That commit causes several problems in Linux as described in the BZ. In particular, after a wh

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-11 Thread Stefano Garzarella
Hi Mark On Fri, Jul 7, 2023 at 5:58 PM Mark Kanda wrote: [...] > >> On 7/5/2023 2:15 AM, Stefano Garzarella wrote: > >>> This reverts commit 8cc5583abe6419e7faaebc9fbd109f34f4c850f2. > >>> > >>> That commit causes several problems in Linux as de

Re: [RFC PATCH] docs/interop: define STANDALONE protocol feature for vhost-user

2023-07-07 Thread Stefano Garzarella
On Thu, Jul 06, 2023 at 05:31:15PM +0100, Alex Bennée wrote: Alex Bennée writes: Currently QEMU has to know some details about the back-end to be able to setup the guest. While various parts of the setup can be delegated to the backend (for example config handling) this is a very piecemeal

Re: [virtio-dev] [RFC PATCH] docs/interop: define STANDALONE protocol feature for vhost-user

2023-07-07 Thread Stefano Garzarella
On Tue, Jul 04, 2023 at 04:02:42PM +0100, Alex Bennée wrote: Stefano Garzarella writes: On Tue, Jul 04, 2023 at 01:36:00PM +0100, Alex Bennée wrote: Currently QEMU has to know some details about the back-end to be able to setup the guest. While various parts of the setup can be delegated

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-05 Thread Stefano Garzarella
Hi Mark, On Wed, Jul 05, 2023 at 07:28:05AM -0500, Mark Kanda wrote: On 7/5/2023 2:15 AM, Stefano Garzarella wrote: This reverts commit 8cc5583abe6419e7faaebc9fbd109f34f4c850f2. That commit causes several problems in Linux as described in the BZ. In particular, after a while, other devices

[PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-05 Thread Stefano Garzarella
-by: Thomas Huth Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2176702 Cc: qemu-sta...@nongnu.org Cc: Mark Kanda Signed-off-by: Stefano Garzarella --- include/hw/scsi/scsi.h | 1 - hw/scsi/scsi-bus.c | 18 -- hw/scsi/virtio-scsi.c | 2 -- 3 files changed, 21 deletions

Re: [virtio-dev] [RFC PATCH] docs/interop: define STANDALONE protocol feature for vhost-user

2023-07-04 Thread Stefano Garzarella
On Tue, Jul 04, 2023 at 01:36:00PM +0100, Alex Bennée wrote: Currently QEMU has to know some details about the back-end to be able to setup the guest. While various parts of the setup can be delegated to the backend (for example config handling) this is a very piecemeal approach. This patch

Re: [PATCH v4] virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events.

2023-07-04 Thread Stefano Garzarella
Hi Mark, we have a bug [1] possibly related to this patch. I saw this Oracle Linux errata [2] where you reverted this patch, but there are no details. Do you think we should revert it upstream as well? Do you have any details about the problem it causes in Linux? [1]

Re: [PATCH v2] block/blkio: fix module_block.py parsing

2023-07-04 Thread Stefano Garzarella
: fd66dbd424f5 ("blkio: add libblkio block driver") Reported-by: Qing Wang Cc: Stefano Garzarella Signed-off-by: Stefan Hajnoczi --- v2: - Drop unnecessary backslashes [Stefano] --- block/blkio.c | 108 ++ 1 file changed, 56 inserti

Re: [PATCH] block/blkio: fix module_block.py parsing

2023-07-03 Thread Stefano Garzarella
: fd66dbd424f5 ("blkio: add libblkio block driver") Reported-by: Qing Wang Cc: Stefano Garzarella Signed-off-by: Stefan Hajnoczi --- block/blkio.c | 110 ++ 1 file changed, 57 insertions(+), 53 deletions(-) diff --git a/block/blkio.c b/blo

Re: [PATCH v3 5/6] block/linux-aio: convert to blk_io_plug_call() API

2023-05-31 Thread Stefano Garzarella
-by: Eric Blake --- include/block/raw-aio.h | 7 --- block/file-posix.c | 28 block/linux-aio.c | 41 +++-- 3 files changed, 11 insertions(+), 65 deletions(-) LGTM! Reviewed-by: Stefano Garzarella

[PATCH v5 0/2] block/blkio: support fd passing for virtio-blk-vhost-vdpa driver

2023-05-30 Thread Stefano Garzarella
-vhost-vdpa driver in libblkio 1.3.0 supports the new 'fd' property. Let's expose this to the user, so the management layer can pass the file descriptor of an already opened vhost-vdpa character device. This is useful especially when the device can only be accessed with certain privileges. Stefano

[PATCH v5 1/2] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-30 Thread Stefano Garzarella
we can handle fd passing from the management layer through the "/dev/fdset/N" special path. Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella --- Notes: v4: - modified commit description v3: - use qemu_open() on `path` to simplify libvirt code [Jonatho

[PATCH v5 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-30 Thread Stefano Garzarella
-by: Stefano Garzarella --- Notes: v5: - moved `features` to the object level to simplify libvirt code [Jonathon] - wrapped a line too long in the documentation [Markus] v4: - added this patch to allow libvirt to discover we support fdset [Markus] meson.build | 4 qapi

Re: [PATCH v2 5/6] block/linux-aio: convert to blk_io_plug_call() API

2023-05-29 Thread Stefano Garzarella
On Wed, May 24, 2023 at 03:36:34PM -0400, Stefan Hajnoczi wrote: On Wed, May 24, 2023 at 10:52:03AM +0200, Stefano Garzarella wrote: On Tue, May 23, 2023 at 01:12:59PM -0400, Stefan Hajnoczi wrote: > Stop using the .bdrv_co_io_plug() API because it is not multi-queue > block layer friendl

Re: [PATCH v4 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-29 Thread Stefano Garzarella
On Sat, May 27, 2023 at 07:56:13AM +0200, Markus Armbruster wrote: Stefano Garzarella writes: The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the fd passing through the new 'fd' property. Since now we are using qemu_open() on '@path' if the virtio-blk driver supports the fd

Re: [PATCH v4 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-29 Thread Stefano Garzarella
On Fri, May 26, 2023 at 04:20:14PM -0500, Jonathon Jongsma wrote: On 5/26/23 10:03 AM, Stefano Garzarella wrote: The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the fd passing through the new 'fd' property. Since now we are using qemu_open() on '@path' if the virtio-blk driver

[PATCH v4 2/2] qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa

2023-05-26 Thread Stefano Garzarella
opened vhost-vdpa character device. This is useful especially when the device can only be accessed with certain privileges. Add the '@fdset' feature only when the virtio-blk-vhost-vdpa driver in libblkio supports it. Suggested-by: Markus Armbruster Signed-off-by: Stefano Garzarella --- Notes

[PATCH v4 0/2] block/blkio: support fd passing for virtio-blk-vhost-vdpa driver

2023-05-26 Thread Stefano Garzarella
the device can only be accessed with certain privileges. Stefano Garzarella (2): block/blkio: use qemu_open() to support fd passing for virtio-blk qapi: add '@fdset' feature for BlockdevOptionsVirtioBlkVhostVdpa meson.build | 4 qapi/block-core.json | 8 ++- block/blkio.c

[PATCH v4 1/2] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-26 Thread Stefano Garzarella
we can handle fd passing from the management layer through the "/dev/fdset/N" special path. Signed-off-by: Stefano Garzarella --- Notes: v4: - modified commit description v3: - use qemu_open() on `path` to simplify libvirt code [Jonathon] block/bl

Re: [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-26 Thread Stefano Garzarella
On Thu, May 25, 2023 at 08:30:03PM +0200, Markus Armbruster wrote: Stefan Hajnoczi writes: On Wed, May 17, 2023 at 09:19:26AM +0200, Stefano Garzarella wrote: CCing Markus for some advice. On Tue, May 16, 2023 at 11:04:21AM -0500, Jonathon Jongsma wrote: [...] > I need some

Re: [PATCH v2 07/10] hw/virtio/vhost-vsock: Include missing 'virtio/virtio-bus.h' header

2023-05-26 Thread Stefano Garzarella
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/virtio/vhost-vsock-common.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Stefano Garzarella

Re: [PATCH v2 05/10] hw/virtio: Introduce VHOST_VSOCK_COMMON symbol in Kconfig

2023-05-26 Thread Stefano Garzarella
Reviewed-by: Thomas Huth --- hw/virtio/Kconfig | 6 ++ hw/virtio/meson.build | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-24 Thread Stefano Garzarella
Gentle ping :-) On Wed, May 17, 2023 at 4:30 PM Stefan Hajnoczi wrote: > > On Wed, May 17, 2023 at 09:19:26AM +0200, Stefano Garzarella wrote: > > CCing Markus for some advice. > > > > On Tue, May 16, 2023 at 11:04:21AM -0500, Jonathon Jongsma wrote: > > > On 5/

Re: [PATCH v2 5/6] block/linux-aio: convert to blk_io_plug_call() API

2023-05-24 Thread Stefano Garzarella
On Tue, May 23, 2023 at 01:12:59PM -0400, Stefan Hajnoczi wrote: Stop using the .bdrv_co_io_plug() API because it is not multi-queue block layer friendly. Use the new blk_io_plug_call() API to batch I/O submission instead. Signed-off-by: Stefan Hajnoczi Reviewed-by: Eric Blake ---

Re: [PATCH v2 6/6] block: remove bdrv_co_io_plug() API

2023-05-24 Thread Stefano Garzarella
-- block/io.c | 37 3 files changed, 51 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH v2 4/6] block/io_uring: convert to blk_io_plug_call() API

2023-05-24 Thread Stefano Garzarella
- Removed whitespace hunk [Eric] --- include/block/raw-aio.h | 7 --- block/file-posix.c | 10 -- block/io_uring.c| 44 - block/trace-events | 5 ++--- 4 files changed, 19 insertions(+), 47 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH v2 3/6] block/blkio: convert to blk_io_plug_call() API

2023-05-24 Thread Stefano Garzarella
missing #include and fix blkio_unplug_fn() prototype [Stefano] --- block/blkio.c | 43 --- 1 file changed, 24 insertions(+), 19 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH v2 2/6] block/nvme: convert to blk_io_plug_call() API

2023-05-24 Thread Stefano Garzarella
unused nvme_process_completion_queue_plugged trace event [Stefano] --- block/nvme.c | 44 block/trace-events | 1 - 2 files changed, 12 insertions(+), 33 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH v2 1/6] block: add blk_io_plug_call() API

2023-05-24 Thread Stefano Garzarella
block/plug.c Reviewed-by: Stefano Garzarella

Re: [PATCH 1/6] block: add blk_io_plug_call() API

2023-05-24 Thread Stefano Garzarella
On Tue, May 23, 2023 at 11:47:08AM -0400, Stefan Hajnoczi wrote: On Fri, May 19, 2023 at 10:45:57AM +0200, Stefano Garzarella wrote: On Wed, May 17, 2023 at 06:10:17PM -0400, Stefan Hajnoczi wrote: > Introduce a new API for thread-local blk_io_plug() that does not > traverse the block

Re: [PATCH 3/6] block/blkio: convert to blk_io_plug_call() API

2023-05-19 Thread Stefano Garzarella
On Wed, May 17, 2023 at 06:10:19PM -0400, Stefan Hajnoczi wrote: Stop using the .bdrv_co_io_plug() API because it is not multi-queue block layer friendly. Use the new blk_io_plug_call() API to batch I/O submission instead. Signed-off-by: Stefan Hajnoczi --- block/blkio.c | 40

Re: [PATCH 2/6] block/nvme: convert to blk_io_plug_call() API

2023-05-19 Thread Stefano Garzarella
On Wed, May 17, 2023 at 06:10:18PM -0400, Stefan Hajnoczi wrote: Stop using the .bdrv_co_io_plug() API because it is not multi-queue block layer friendly. Use the new blk_io_plug_call() API to batch I/O submission instead. Signed-off-by: Stefan Hajnoczi --- block/nvme.c | 44

Re: [PATCH 1/6] block: add blk_io_plug_call() API

2023-05-19 Thread Stefano Garzarella
On Wed, May 17, 2023 at 06:10:17PM -0400, Stefan Hajnoczi wrote: Introduce a new API for thread-local blk_io_plug() that does not traverse the block graph. The goal is to make blk_io_plug() multi-queue friendly. Instead of having block drivers track whether or not we're in a plugged section,

Re: [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-17 Thread Stefano Garzarella
CCing Markus for some advice. On Tue, May 16, 2023 at 11:04:21AM -0500, Jonathon Jongsma wrote: On 5/15/23 5:10 AM, Stefano Garzarella wrote: On Thu, May 11, 2023 at 11:03:22AM -0500, Jonathon Jongsma wrote: On 5/11/23 4:15 AM, Stefano Garzarella wrote: The virtio-blk-vhost-vdpa driver

Re: [PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-15 Thread Stefano Garzarella
On Thu, May 11, 2023 at 11:03:22AM -0500, Jonathon Jongsma wrote: On 5/11/23 4:15 AM, Stefano Garzarella wrote: The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the new 'fd' property. Let's expose this to the user, so the management layer can pass the file descriptor of an already

[PATCH v3 0/1] block/blkio: support 'fd' option for virtio-blk-vhost-vdpa driver

2023-05-11 Thread Stefano Garzarella
descriptor of an already opened vhost-vdpa character device. This is useful especially when the device can only be accessed with certain privileges. Stefano Garzarella (1): block/blkio: use qemu_open() to support fd passing for virtio-blk block/blkio.c | 53

[PATCH v3 1/1] block/blkio: use qemu_open() to support fd passing for virtio-blk

2023-05-11 Thread Stefano Garzarella
privileges. If the libblkio virtio-blk driver supports fd passing, let's always use qemu_open() to open the `path`, so we can handle fd passing from the management layer through the "/dev/fdset/N" special path. Signed-off-by: Stefano Garzarella --- Notes: v3: - use qemu_open(

Re: [PATCH v2 0/2] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

2023-05-11 Thread Stefano Garzarella
On Wed, May 10, 2023 at 6:03 PM Jonathon Jongsma wrote: > > On 5/4/23 4:28 AM, Stefano Garzarella wrote: > > v2: > > - added patch 01 to use monitor_fd_param() in the blkio module > > - use monitor_fd_param() to parse the fd like vhost devices [Stefan] > > > &

[PATCH v2 2/2] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

2023-05-04 Thread Stefano Garzarella
privileges. Signed-off-by: Stefano Garzarella --- Notes: v2: - used monitor_fd_param() to parse the fd like vhost devices [Stefan] qapi/block-core.json | 6 - block/blkio.c| 53 +++- 2 files changed, 57 insertions(+), 2 deletions(-) diff

[PATCH v2 1/2] stubs/monitor: add monitor_fd_param()

2023-05-04 Thread Stefano Garzarella
The blkio block driver will use monitor_fd_param() to support file descriptor passing. This is possible in builds (e.g. softmmu) where the monitor API is available. Add the monitor_fd_param() stub so tools and tests that link the block layer can build successfully. Signed-off-by: Stefano

[PATCH v2 0/2] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

2023-05-04 Thread Stefano Garzarella
' property. Let's expose this to the user, so the management layer can pass the file descriptor of an already opened vhost-vdpa character device. This is useful especially when the device can only be accessed with certain privileges. Stefano Garzarella (2): stubs/monitor: add monitor_fd_param

Re: [PATCH] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

2023-05-04 Thread Stefano Garzarella
On Thu, May 4, 2023 at 9:38 AM Stefano Garzarella wrote: > > On Wed, May 3, 2023 at 5:57 PM Stefan Hajnoczi wrote: > > > > On Wed, May 03, 2023 at 11:15:56AM +0200, Stefano Garzarella wrote: > > > On Tue, May 02, 2023 at 03:02:32PM -0400, Stefan Hajnoczi wrote: > &g

Re: [PATCH] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

2023-05-04 Thread Stefano Garzarella
On Wed, May 3, 2023 at 5:57 PM Stefan Hajnoczi wrote: > > On Wed, May 03, 2023 at 11:15:56AM +0200, Stefano Garzarella wrote: > > On Tue, May 02, 2023 at 03:02:32PM -0400, Stefan Hajnoczi wrote: > > > On Tue, May 02, 2023 at 04:50:50PM +0200, Stefano Garzarella wrote: > &g

Re: [PATCH] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

2023-05-03 Thread Stefano Garzarella
On Tue, May 02, 2023 at 03:02:32PM -0400, Stefan Hajnoczi wrote: On Tue, May 02, 2023 at 04:50:50PM +0200, Stefano Garzarella wrote: The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the new 'fd' property. Let's expose this to the user, so the management layer can pass the file

[PATCH] block/blkio: add 'fd' option to virtio-blk-vhost-vdpa driver

2023-05-02 Thread Stefano Garzarella
privileges. Signed-off-by: Stefano Garzarella --- Notes: As an alternative we could support passing `/dev/fdset/N` via 'path', always opening the path with qemu_open() and passing the fd to the libblkio driver. I preferred to add a new parameter though, because the code is simpler

Re: [PATCH for 8.1 v2 5/6] vdpa: move CVQ isolation check to net_init_vhost_vdpa

2023-03-27 Thread Stefano Garzarella
On Thu, Mar 23, 2023 at 08:54:03PM +0100, Eugenio Pérez wrote: Evaluating it at start time instead of initialization time may make the guest capable of dynamically adding or removing migration blockers. Also, moving to initialization reduces the number of ioctls in the migration, reducing

Re: [PATCH for 8.1 v2 4/6] vdpa: return errno in vhost_vdpa_get_vring_group error

2023-03-27 Thread Stefano Garzarella
insertions(+) Reviewed-by: Stefano Garzarella diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 99904a0da7..4397c0d4b3 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -361,6 +361,14 @@ static NetClientInfo net_vhost_vdpa_info = { .check_peer_type = vhost_vdpa_check_peer_type

Re: [PATCH for 8.1 v2 2/6] vdpa: add vhost_vdpa_reset_status_fd

2023-03-27 Thread Stefano Garzarella
ASID isolation. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 1 + hw/virtio/vhost-vdpa.c | 58 +++--- 2 files changed, 41 insertions(+), 18 deletions(-) Reviewed-by: Stefano Garzarella diff --git a/include/hw/virtio/vhost-vdpa.h b/include

Re: [PATCH for 8.1 v2 1/6] vdpa: Remove status in reset tracing

2023-03-27 Thread Stefano Garzarella
-by: Stefano Garzarella diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index bc6bad23d5..bbabea18f3 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -716,7 +716,7 @@ static int vhost_vdpa_reset_device(struct vhost_dev *dev) uint8_t status = 0; ret

Re: [RFC PATCH for 8.1 5/6] vdpa: move CVQ isolation check to net_init_vhost_vdpa

2023-03-23 Thread Stefano Garzarella
On Wed, Mar 22, 2023 at 07:04:03PM +0100, Eugenio Perez Martin wrote: On Wed, Mar 22, 2023 at 3:27 PM Stefano Garzarella wrote: On Fri, Mar 17, 2023 at 03:55:41PM +0100, Eugenio Pérez wrote: >Evaluating it at start time instead of initialization time may make the >guest capable of dynam

Re: [RFC PATCH for 8.1 4/6] vdpa: return errno in vhost_vdpa_get_vring_group error

2023-03-23 Thread Stefano Garzarella
On Wed, Mar 22, 2023 at 06:38:21PM +0100, Eugenio Perez Martin wrote: On Wed, Mar 22, 2023 at 3:26 PM Stefano Garzarella wrote: On Fri, Mar 17, 2023 at 03:55:40PM +0100, Eugenio Pérez wrote: >We need to tell in the caller, as some errors are expected in a normal >workflow. In part

Re: [RFC PATCH for 8.1 2/6] vdpa: add vhost_vdpa_reset_status_fd

2023-03-23 Thread Stefano Garzarella
On Wed, Mar 22, 2023 at 06:36:39PM +0100, Eugenio Perez Martin wrote: On Wed, Mar 22, 2023 at 3:24 PM Stefano Garzarella wrote: On Fri, Mar 17, 2023 at 03:55:38PM +0100, Eugenio Pérez wrote: >This allows to reset a vhost-vdpa device from external subsystems like >vhost-net. It i

Re: [RFC PATCH for 8.1 5/6] vdpa: move CVQ isolation check to net_init_vhost_vdpa

2023-03-22 Thread Stefano Garzarella
On Fri, Mar 17, 2023 at 03:55:41PM +0100, Eugenio Pérez wrote: Evaluating it at start time instead of initialization time may make the guest capable of dynamically adding or removing migration blockers. Also, moving to initialization reduces the number of ioctls in the migration, reducing

Re: [RFC PATCH for 8.1 4/6] vdpa: return errno in vhost_vdpa_get_vring_group error

2023-03-22 Thread Stefano Garzarella
On Fri, Mar 17, 2023 at 03:55:40PM +0100, Eugenio Pérez wrote: We need to tell in the caller, as some errors are expected in a normal workflow. In particular, parent drivers in recent kernels with VHOST_BACKEND_F_IOTLB_ASID may not support vring groups. In that case, -ENOTSUP is returned.

Re: [RFC PATCH for 8.1 3/6] vdpa: add vhost_vdpa_set_dev_features_fd

2023-03-22 Thread Stefano Garzarella
/virtio/vhost-vdpa.h | 1 + hw/virtio/vhost-vdpa.c | 20 +--- 2 files changed, 14 insertions(+), 7 deletions(-) Reviewed-by: Stefano Garzarella

Re: [RFC PATCH for 8.1 2/6] vdpa: add vhost_vdpa_reset_status_fd

2023-03-22 Thread Stefano Garzarella
On Fri, Mar 17, 2023 at 03:55:38PM +0100, Eugenio Pérez wrote: This allows to reset a vhost-vdpa device from external subsystems like vhost-net. It is used in subsequent patches to negotiate features and probe for CVQ ASID isolation. Signed-off-by: Eugenio Pérez ---

Re: [RFC PATCH for 8.1 1/6] vdpa: Remove status in reset tracing

2023-03-22 Thread Stefano Garzarella
On Fri, Mar 17, 2023 at 03:55:37PM +0100, Eugenio Pérez wrote: It is always 0 and it is not useful to route call through file descriptor. I didn't get the second part of the sentence (after "and"), anyway the patch LGTM: Reviewed-by: Stefano Garzarella Signed-off-by: Eugenio Pér

Re: [RFC PATCH v2 00/25] Virtio Sound card Implementation

2023-02-22 Thread Stefano Garzarella
Hi Shreyansh, On Fri, Feb 11, 2022 at 11:18 PM Shreyansh Chouhan wrote: > > The second RFC for implementing the VirtIO Sound card as described in > the virtio specs. Sorry for the absence of activity on this. Thanks for starting working on virtio-sound device for QEMU! I'm interested in

Re: Call for GSoC and Outreachy project ideas for summer 2023

2023-02-17 Thread Stefano Garzarella
On Fri, Feb 17, 2023 at 11:53:03AM -0500, Stefan Hajnoczi wrote: On Fri, 17 Feb 2023 at 11:23, Stefano Garzarella wrote: Hi Stefan, On Fri, Jan 27, 2023 at 10:17:40AM -0500, Stefan Hajnoczi wrote: >Dear QEMU, KVM, and rust-vmm communities, >QEMU will apply for Google Summer of Cod

<    1   2   3   4   5   6   7   8   9   10   >