Hi,
starting from this commit 69e1c14aa2 ("virtio: core: vq reset feature
negotation support"), vhost-user-vsock and vhost-vsock fails while
setting the device features, because VIRTIO_F_RING_RESET is not masked.
I'm not sure vsock is the only one affected.
We could fix in two ways:
1) Masking
On Fri, Nov 18, 2022 at 3:32 PM Stefano Garzarella wrote:
>
> Hi,
> starting from this commit 69e1c14aa2 ("virtio: core: vq reset feature
> negotation support"), vhost-user-vsock and vhost-vsock fails while
> setting the device features, because VIRTIO_F_RING_RESET is
On Mon, Nov 21, 2022 at 02:07:41AM -0500, Michael S. Tsirkin wrote:
On Mon, Nov 21, 2022 at 02:17:02PM +0800, Jason Wang wrote:
On Sun, Nov 20, 2022 at 1:19 AM Michael S. Tsirkin wrote:
>
> On Fri, Nov 18, 2022 at 03:32:56PM +0100, Stefano Garzarella wrote:
> > Hi,
> >
: vq reset feature negotation support")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1318
Signed-off-by: Stefano Garzarella
---
To prevent this problem in the future, perhaps we should provide a function
(e.g. vhost_device_get_features) where we go to mask all non-device-specific
re we disable vrings.
[1] https://gitlab.com/virtio-fs/virtiofsd
[2]
https://github.com/rust-vmm/vhost/blob/240fc2966/crates/vhost-user-backend/src/event_loop.rs#L217
Fixes: 02b61f38d3 ("hw/virtio: incorporate backend features in features")
Reported-by: German Maglione
Tested-by: Germ
On Tue, Nov 22, 2022 at 07:01:38PM +0100, Eugenio Perez Martin wrote:
On Tue, Nov 22, 2022 at 4:13 AM Jason Wang wrote:
On Mon, Nov 21, 2022 at 6:11 PM Stefano Garzarella wrote:
>
> Commit 69e1c14aa2 ("virtio: core: vq reset feature negotation support")
> enabled VIR
On Thu, Nov 24, 2022 at 01:50:19AM -0500, Michael S. Tsirkin wrote:
On Thu, Nov 24, 2022 at 12:19:25AM +, Raphael Norwitz wrote:
> On Nov 23, 2022, at 8:16 AM, Stefano Garzarella wrote:
>
> Commit 02b61f38d3 ("hw/virtio: incorporate backend features in features")
&g
On Thu, Nov 24, 2022 at 01:36:29PM -0500, Stefan Hajnoczi wrote:
On Wed, Nov 23, 2022 at 02:16:30PM +0100, Stefano Garzarella wrote:
Commit 02b61f38d3 ("hw/virtio: incorporate backend features in features")
properly negotiates VHOST_USER_F_PROTOCOL_FEATURES with the vhost-user
backe
Bennée
Cc: Stefano Garzarella
Cc: "Michael S. Tsirkin"
Cc: Stefan Hajnoczi
---
v2
- dropped DISCUSS and commentary
- separated protocol section for clarity
- updated working on vhost->backend_features
- made clear guest_features was the written state
---
include/hw/virtio/
On Wed, Nov 30, 2022 at 04:03:28PM -0500, Stefan Hajnoczi wrote:
On Fri, Nov 25, 2022 at 09:12:43AM +0100, Stefano Garzarella wrote:
On Thu, Nov 24, 2022 at 01:36:29PM -0500, Stefan Hajnoczi wrote:
> On Wed, Nov 23, 2022 at 02:16:30PM +0100, Stefano Garzarella wrote:
> > Commit 02b61f
On Thu, Dec 01, 2022 at 04:49:37PM -0500, Michael S. Tsirkin wrote:
On Thu, Dec 01, 2022 at 12:21:21PM +, Alex Bennée wrote:
"Michael S. Tsirkin" writes:
> On Thu, Dec 01, 2022 at 10:14:39AM +, Alex Bennée wrote:
>> Do you think rust-vmm's vhost crates have enough of the state
>> mana
with vDPA
perhaps we can have one software stack to maintain for both HW and
software accelerators.
Thanks,
Stefano
[1]
https://kvmforum2021.sched.com/event/ke3a/vdpa-blk-unified-hardware-and-software-offload-for-virtio-blk-stefano-garzarella-red-hat
[2] https://gitlab.com/libblkio/libblkio
[3
On Thu, Jul 28, 2022 at 7:28 AM Andrey Zhadchenko
wrote:
> On 7/27/22 16:06, Stefano Garzarella wrote:
> > On Tue, Jul 26, 2022 at 04:15:48PM +0200, Denis V. Lunev wrote:
> >> On 26.07.2022 15:51, Michael S. Tsirkin wrote:
> >>> On Mon, Jul 25, 2022 at 11:55:26PM
-dataplane.c | 33 +
1 file changed, 25 insertions(+), 8 deletions(-)
Reviewed-by: 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
_open() to support fd 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/blo
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 Garza
, 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
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
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 the
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
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 s
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
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.
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
block/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
ssing, let`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,
rt fd 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 inse
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() if it
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 Garzare
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
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
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
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
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(B
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
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 Linux as des
to wrong parameters, but the frontend
still sent the payload which the backend incorrectly interpreted
as a wrong header.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost
From: Stefano Garzarella
On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if
the `struct msghdr` has the field `msg_controllen` set to 0, but
`msg_control` is not NULL.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1
-device vhost-user-blk-pci,num-queues=1,chardev=char0 \
-chardev socket,id=char0,path=/tmp/vhost.socket
Thanks,
Stefano
Stefano Garzarella (9):
libvhost-user: set msg.msg_control to NULL when it is empty
libvhost-user: fail vu_message_write() if sendmsg() is failing
libvhost-user:
From: Stefano Garzarella
On macOS passing `-s /tmp/vhost.socket` parameter to the vhost-user-blk
application, the bind was done on `/tmp/vhost.socke` pathname,
missing the last character.
This sounds like one of the portability problems described in the
unix(7) manpage:
Pathname sockets
end is not able to properly handle these
messages.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index
From: Stefano Garzarella
In vhost-user-server we set all fd received from the other peer
in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.)
if we fail, it's not really a problem, because we don't use these
fd with blocking operations, but only to map memory.
In the
Let's make the code more portable by using the "qemu/bswap.h" API
and adding defines from block/file-posix.c to support O_DIRECT in
other systems (e.g. macOS).
vhost-user-server.c is a dependency, let's enable it for any POSIX
system.
Signed-off-by: Stefano Garzarel
The vhost-user protocol is not really Linux-specific so let's enable
vhost-user frontends for any POSIX system.
In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux
specific header, let's define it for other systems as well.
Signed-off-by: Stefano Garzarella
---
If we
(e.g. /dev/shm) available
as in macOS.
Signed-off-by: Stefano Garzarella
---
I am not sure this is the best way to support shm_open() in QEMU.
Other solutions I had in mind were:
- create a new memory-backend-shm
- extend memory-backend-memfd to use shm_open() on systems where memfd is
not ava
es from include/qemu/memfd.h to make the code works
on FreeBSD where MFD_ALLOW_SEALING is defined
- define MAP_NORESERVE if it's not defined (e.g. on FreeBSD)
Signed-off-by: Stefano Garzarella
---
meson.build | 2 +-
subprojects/libvhost-user/libvhost-user.h
I just noticed that I forgot to add RFC tag and fix Author to match
SOB in some patches, sorry!
Stefano
On Wed, Feb 28, 2024 at 12:48 PM Stefano Garzarella wrote:
>
> The vhost-user protocol is not really Linux-specific, so let's try support
> QEMU's frontends and backends
Hi Sahil,
On Sun, Feb 25, 2024 at 10:38 PM Sahil wrote:
>
> Hi,
>
> My name is Sahil and I go by the pseudonym 'valdaarhun' on Github. I have
> never contributed to QEMU before but I have used it a few times as an end
> user. I developed an interest in virtualization during my internship at
> VMw
On Wed, Feb 28, 2024 at 01:01:55PM +0100, David Hildenbrand wrote:
On 28.02.24 12:47, Stefano Garzarella wrote:
Add a new `shm` bool option for `-object memory-backend-file`.
When this option is set to true, the POSIX shm_open(3) is used instead
of open(2).
So a file will not be created in
On Wed, Feb 28, 2024 at 12:08:37PM +, Daniel P. Berrangé wrote:
On Wed, Feb 28, 2024 at 12:47:59PM +0100, Stefano Garzarella wrote:
Add a new `shm` bool option for `-object memory-backend-file`.
When this option is set to true, the POSIX shm_open(3) is used instead
of open(2).
So a file
On Wed, Feb 28, 2024 at 01:32:17PM +0100, Markus Armbruster wrote:
Stefano Garzarella writes:
Add a new `shm` bool option for `-object memory-backend-file`.
When this option is set to true, the POSIX shm_open(3) is used instead
of open(2).
So a file will not be created in the filesystem
Reflow paragraph following commit a937b6aa73 ("qapi: Reformat doc
comments to conform to current conventions"): use 4 spaces indentation,
70 columns width, and two spaces to separate sentences.
Suggested-by: Markus Armbruster
Signed-off-by: Stefano Garzarella
---
qapi/qom
On Thu, Feb 29, 2024 at 11:28:37AM +0100, Markus Armbruster wrote:
Stefano Garzarella writes:
On Wed, Feb 28, 2024 at 01:32:17PM +0100, Markus Armbruster wrote:
Stefano Garzarella writes:
[...]
+# @shm: if true, shm_open(3) is used to create/open POSIX shared memory
+# object; if
ed to 4k would fail without this fix.
Suggested-by: Stefano Garzarella
Signed-off-by: Kevin Wolf
---
block/blkio.c | 3 +++
1 file changed, 3 insertions(+)
Thanks for fixinig this!
Reviewed-by: Stefano Garzarella
diff --git a/block/blkio.c b/block/blkio.c
index 0a0a6c0f5f..b989617608 1006
On Fri, Feb 02, 2024 at 02:25:21PM +0100, Kevin Wolf wrote:
VDUSE requires that virtqueues are first enabled before the DRIVER_OK
status flag is set; with the current API of the kernel module, it is
impossible to enable the opposite order in our block export code because
userspace is not notified
On Tue, Feb 06, 2024 at 10:47:40AM +0800, Jason Wang wrote:
On Mon, Feb 5, 2024 at 6:51 PM Stefano Garzarella wrote:
On Fri, Feb 02, 2024 at 02:25:21PM +0100, Kevin Wolf wrote:
>VDUSE requires that virtqueues are first enabled before the DRIVER_OK
>status flag is set; with the current
On Tue, Feb 6, 2024 at 9:31 AM Stefano Garzarella wrote:
>
> On Tue, Feb 06, 2024 at 10:47:40AM +0800, Jason Wang wrote:
> >On Mon, Feb 5, 2024 at 6:51 PM Stefano Garzarella
> >wrote:
> >>
> >> On Fri, Feb 02, 2024 at 02:25:21PM +0100, Kevin Wolf wrote:
>
On Wed, Feb 07, 2024 at 11:17:34AM +0800, Jason Wang wrote:
On Tue, Feb 6, 2024 at 4:31 PM Stefano Garzarella wrote:
On Tue, Feb 06, 2024 at 10:47:40AM +0800, Jason Wang wrote:
>On Mon, Feb 5, 2024 at 6:51 PM Stefano Garzarella wrote:
>>
>> On Fri, Feb 02, 2024 at 02:25:21
On Wed, Feb 07, 2024 at 04:05:29PM +0800, Cindy Lu wrote:
Jason Wang 于2024年2月7日周三 11:17写道:
On Tue, Feb 6, 2024 at 4:31 PM Stefano Garzarella wrote:
>
> On Tue, Feb 06, 2024 at 10:47:40AM +0800, Jason Wang wrote:
> >On Mon, Feb 5, 2024 at 6:51 PM Stefano Garzarella
wrote:
>
https://lore.kernel.org/virtualization/20240206145154.118044-1-sgarz...@redhat.com/T/#u
Signed-off-by: Stefano Garzarella
---
Note: This patch conflicts with [2], but the resolution is simple,
so for now I sent a patch for the current master, but I'll rebase
this patch if we merge the other one
On Wed, Feb 07, 2024 at 11:18:54AM +0100, Kevin Wolf wrote:
Am 06.02.2024 um 17:44 hat Eugenio Perez Martin geschrieben:
On Mon, Feb 5, 2024 at 2:49 PM Kevin Wolf wrote:
>
> Am 05.02.2024 um 13:22 hat Eugenio Perez Martin geschrieben:
> > On Fri, Feb 2, 2024 at 2:25 PM Kevin Wolf wrote:
> > >
y and as expected in my tests.
I don't know much about this code, but I didn't find anything wrong with
it. Thank you also for the great cleanup!
Acked-by: Stefano Garzarella
https://lore.kernel.org/virtualization/20240206145154.118044-1-sgarz...@redhat.com/T/#u
Acked-by: Eugenio Pérez
Acked-by: Jason Wang
Signed-off-by: Stefano Garzarella
---
Based-on: 20240315155949.86066-1-kw...@redhat.com
v1: https://patchew.org/QEMU/20240207092702.25242-1-sgarz...@redhat.co
`memory-backend-memfd` is available only on Linux while the new
`memory-backend-shm` can be used on any POSIX-compliant operating
system. Let's use it so we can run the test in multiple environments.
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-blk-test.c | 2 +-
1 file ch
to wrong parameters, but the frontend
still sent the payload which the backend incorrectly interpreted
as a wrong header.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost
Let's make the code more portable by using the "qemu/bswap.h" API
and adding defines from block/file-posix.c to support O_DIRECT in
other systems (e.g. macOS).
vhost-user-server.c is a dependency, let's enable it for any POSIX
system.
Signed-off-by: Stefano Garzarel
es from include/qemu/memfd.h to make the code works
on FreeBSD where MFD_ALLOW_SEALING is defined
- define MAP_NORESERVE if it's not defined (e.g. on FreeBSD)
Signed-off-by: Stefano Garzarella
---
meson.build | 2 +-
subprojects/libvhost-user/libvhost-user.h
(struct sockaddr_un).
So let's follow the last advice and simplify the code as well.
Signed-off-by: Stefano Garzarella
---
contrib/vhost-user-blk/vhost-user-blk.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c
b/contrib/vhost-use
On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if
the `struct msghdr` has the field `msg_controllen` set to 0, but
`msg_control` is not NULL.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a
-backend-memfd` is not available (Linux only), since shm_open()
should be provided by any POSIX-compliant operating system.
Signed-off-by: Stefano Garzarella
---
docs/system/devices/vhost-user.rst | 5 +-
qapi/qom.json | 17 +
backends/hostmem-shm.c | 118
The vhost-user protocol is not really Linux-specific so let's enable
vhost-user frontends for any POSIX system.
In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux
specific header, let's define it for other systems as well.
Signed-off-by: Stefano Garzarella
---
m
mp/vhost.socket
Branch pushed (and CI started) at
https://gitlab.com/sgarzarella/qemu/-/tree/macos-vhost-user?ref_type=heads
Thanks,
Stefano
Stefano Garzarella (11):
libvhost-user: set msg.msg_control to NULL when it is empty
libvhost-user: fail vu_message_write() if sendmsg() is failing
li
end is not able to properly handle these
messages.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index
, so let's just report a warning
instead of panicking if we fail to set some fd in non-blocking mode.
This for example occurs in macOS where setting shm_open() fd
non-blocking is failing (errno: 25).
Signed-off-by: Stefano Garzarella
---
util/vhost-user-server.c | 6 +-
1 file change
`memory-backend-shm` can be used with vhost-user devices, so let's
add a new test case for it.
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-test.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost
On Tue, Mar 26, 2024 at 03:36:52PM +0100, David Hildenbrand wrote:
On 26.03.24 15:34, Eric Blake wrote:
On Tue, Mar 26, 2024 at 02:39:27PM +0100, Stefano Garzarella wrote:
In vu_message_write() we use sendmsg() to send the message header,
then a write() to send the payload.
If sendmsg() fails
On Tue, Mar 26, 2024 at 09:36:54AM -0500, Eric Blake wrote:
On Tue, Mar 26, 2024 at 02:39:28PM +0100, Stefano Garzarella wrote:
libvhost-user will panic when receiving VHOST_USER_GET_INFLIGHT_FD
message if MFD_ALLOW_SEALING is not defined, since it's not able
to create a
On Tue, Mar 26, 2024 at 09:40:12AM -0500, Eric Blake wrote:
On Tue, Mar 26, 2024 at 02:39:29PM +0100, Stefano Garzarella wrote:
In vhost-user-server we set all fd received from the other peer
in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.)
if we fail, it's not rea
On Tue, Mar 26, 2024 at 03:45:52PM +0100, David Hildenbrand wrote:
+mode = 0;
+oflag = O_RDWR | O_CREAT | O_EXCL;
+backend_name = host_memory_backend_get_name(backend);
+
+/*
+ * Some operating systems allow creating anonymous POSIX shared memory
+ * objects (e.g. FreeBSD
Hi Yajun,
On Mon, Mar 25, 2024 at 10:54:13AM +, Yajun Wu wrote:
Hi experts,
With latest QEMU (8.2.90), we find two vhost-user-blk backend reconnect
failure scenarios:
Do you know if has it ever worked and so it's a regression, or have we
always had this problem?
Thanks,
Stefano
1. D
On Wed, Mar 27, 2024 at 12:51:51PM +0100, David Hildenbrand wrote:
On 27.03.24 11:23, Stefano Garzarella wrote:
On Tue, Mar 26, 2024 at 03:45:52PM +0100, David Hildenbrand wrote:
+mode = 0;
+oflag = O_RDWR | O_CREAT | O_EXCL;
+backend_name = host_memory_backend_get_name(backend
to wrong parameters, but the frontend
still sent the payload which the backend incorrectly interpreted
as a wrong header.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost
On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if
the `struct msghdr` has the field `msg_controllen` set to 0, but
`msg_control` is not NULL.
Reviewed-by: Eric Blake
Reviewed-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 1
es from include/qemu/memfd.h to make the code works
on FreeBSD where MFD_ALLOW_SEALING is defined
- define MAP_NORESERVE if it's not defined (e.g. on FreeBSD)
Signed-off-by: Stefano Garzarella
---
meson.build | 2 +-
subprojects/libvhost-user/libvhost-user.h
(struct sockaddr_un).
So let's follow the last advice and simplify the code as well.
Signed-off-by: Stefano Garzarella
---
contrib/vhost-user-blk/vhost-user-blk.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c
b/contrib/vhost-use
`memory-backend-memfd` is available only on Linux while the new
`memory-backend-shm` can be used on any POSIX-compliant operating
system. Let's use it so we can run the test in multiple environments.
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-blk-test.c | 2 +-
1 file ch
nch pushed (and CI started) at
https://gitlab.com/sgarzarella/qemu/-/tree/macos-vhost-user?ref_type=heads
Thanks,
Stefano
Stefano Garzarella (11):
libvhost-user: set msg.msg_control to NULL when it is empty
libvhost-user: fail vu_message_write() if sendmsg() is failing
libvhost-user: mask
l (e.g. in macOS
setting an fd returned by shm_open() non-blocking fails with errno
= ENOTTY).
So, let's avoid setting fd non-blocking for those messages that we
know carry memory fd (e.g. VHOST_USER_ADD_MEM_REG,
VHOST_USER_SET_MEM_TABLE).
Signed-off-by: Stefano Garzarella
---
v3:
- avoiding
Let's make the code more portable by using the "qemu/bswap.h" API
and adding defines from block/file-posix.c to support O_DIRECT in
other systems (e.g. macOS).
vhost-user-server.c is a dependency, let's enable it for any POSIX
system.
Signed-off-by: Stefano Garzarel
The vhost-user protocol is not really Linux-specific so let's enable
vhost-user frontends for any POSIX system.
In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux
specific header, let's define it for other systems as well.
Signed-off-by: Stefano Garzarella
---
m
anonymous memory such as memfd.
Signed-off-by: Stefano Garzarella
---
v3
- enriched commit message and documentation to highlight that we
want to mimic memfd (David)
---
docs/system/devices/vhost-user.rst | 5 +-
qapi/qom.json | 17 +
backends/hostmem-shm.c
`memory-backend-shm` can be used with vhost-user devices, so let's
add a new test case for it.
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-test.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost
end is not able to properly handle these
messages.
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index
On Thu, Apr 04, 2024 at 04:00:38PM +0200, Philippe Mathieu-Daudé wrote:
Hi Stefano,
Hi Phil!
On 4/4/24 14:23, Stefano Garzarella wrote:
Let's make the code more portable by using the "qemu/bswap.h" API
and adding defines from block/file-posix.c to support O_DIRECT in
oth
On Thu, Apr 04, 2024 at 04:09:34PM +0200, David Hildenbrand wrote:
On 04.04.24 14:23, Stefano Garzarella wrote:
shm_open() creates and opens a new POSIX shared memory object.
A POSIX shared memory object allows creating memory backend with an
associated file descriptor that can be shared with
FYI I'll be on PTO till May 2nd, I'll send the v4 when I'm back ASAP.
Thanks,
Stefano
On Thu, Apr 04, 2024 at 02:23:19PM +0200, Stefano Garzarella wrote:
v1: https://patchew.org/QEMU/20240228114759.44758-1-sgarz...@redhat.com/
v2: https://patchew.org/QEMU/20240326133936
On Mon, Apr 08, 2024 at 10:03:15AM +0200, David Hildenbrand wrote:
On 08.04.24 09:58, Stefano Garzarella wrote:
On Thu, Apr 04, 2024 at 04:09:34PM +0200, David Hildenbrand wrote:
On 04.04.24 14:23, Stefano Garzarella wrote:
shm_open() creates and opens a new POSIX shared memory object.
A
Gentle ping :-)
On Wed, Feb 7, 2024 at 10:27 AM Stefano Garzarella wrote:
>
> vhost_vdpa_set_vring_ready() could already fail, but if Linux's
> patch [1] will be merged, it may fail with more chance if
> userspace does not activate virtqueues befo
On Thu, Mar 14, 2024 at 11:17:01AM +0800, Jason Wang wrote:
On Wed, Feb 7, 2024 at 5:27 PM Stefano Garzarella wrote:
vhost_vdpa_set_vring_ready() could already fail, but if Linux's
patch [1] will be merged, it may fail with more chance if
userspace does not activate virtqueues b
1 - 100 of 1342 matches
Mail list logo