-by: Stefano Garzarella
---
v2:
- documented @share's default right where it's defined [Markus]
v1: https://patchew.org/QEMU/20240523133302.103858-1-sgarz...@redhat.com/
---
qapi/qom.json | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/qapi/qom.json b/qapi/qom.json
index
On Tue, Jun 04, 2024 at 04:58:49PM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
On Mon, Jun 03, 2024 at 11:34:10AM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
The default value of the @share option of the @MemoryBackendProperties
eally depends on the backend type
Some QOM properties are associated with ObjectTypes that already
depend on CONFIG_* switches. So to avoid generating dead code,
let's also make the definition of those properties dependent on
the corresponding CONFIG_*.
Suggested-by: Markus Armbruster
Signed-off-by: Stefano Garzarella
---
qapi
On Mon, Jun 03, 2024 at 11:42:35AM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
On Wed, May 29, 2024 at 04:50:20PM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
shm_open() creates and opens a new POSIX shared memory object.
A POSIX shared memory object allows
On Mon, Jun 03, 2024 at 11:34:10AM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
The default value of the @share option of the @MemoryBackendProperties
eally depends on the backend type, so let's document it explicitly and
add the default value where it was missing.
Cc: David
On Wed, May 29, 2024 at 02:49:28PM GMT, Halil Pasic wrote:
On Tue, 28 May 2024 17:32:26 +0200
Stefano Garzarella wrote:
>1) The uses is explicitly asking for a vhost device and giving the user
>a non vhost device is not an option.
I didn't get this point :-( can you elaborat
On Wed, May 29, 2024 at 04:50:20PM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
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 external processes
On Mon, May 27, 2024 at 01:27:10PM GMT, Halil Pasic wrote:
On Thu, 16 May 2024 10:39:42 +0200
Stefano Garzarella wrote:
[..]
>---
>
>This is a minimal fix, that follows the current patterns in the
>codebase, and not necessarily the best one.
Yeah, I did something similar
).
Acked-by: Thomas Huth
Acked-by: Stefan Hajnoczi
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Reviewed-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
v6
- removed `share=on` since it's the default [David]
---
tests/qtest/vhost-user-blk-test.c | 2 +-
1 file
`memory-backend-shm` can be used with vhost-user devices, so let's
add a new test case for it.
Acked-by: Thomas Huth
Acked-by: Stefan Hajnoczi
Reviewed-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-test.c | 23 +++
1 file changed, 23
anonymous memory such as memfd.
Acked-by: David Hildenbrand
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
v5
- fixed documentation in qapi/qom.json and qemu-options.hx [Markus]
v4
- fail if we find "share=off" in shm_backend_memory_alloc() [David]
v3
- enriched comm
-Daudé
Signed-off-by: Stefano Garzarella
---
v6:
- reverted v5 changes since we can't move O_DSYNC and O_DIRECT in osdep
[Daniel, failing tests on Windows]
v5:
- O_DSYNC and O_DIRECT definition are now in osdep [Phil]
- commit updated since we moved out all code changes
v4:
- moved using of "
is not able to properly handle these
messages.
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Reviewed-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 11 +++
1 file changed, 11 insertions
.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)
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
v5:
- fixed typos in the commit d
-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index 22bea0c775..a11afd1960 100644
--- a/subprojects/libvhost-user/libvhost-user.c
-by: Stefano Garzarella
---
contrib/vhost-user-blk/vhost-user-blk.c | 9 +
contrib/vhost-user-input/main.c | 16
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/contrib/vhost-user-blk/vhost-user-blk.c
b/contrib/vhost-user-blk/vhost-user-blk.c
index
-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
v3:
- avoiding setting fd non-blocking for messages where we have memory fd
(Eric)
---
util/vhost-user-server.c | 12
1 file changed, 12 insertions(+)
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
host.socket
Branch pushed (and CI started) at
https://gitlab.com/sgarzarella/qemu/-/tree/macos-vhost-user?ref_type=heads
Thanks,
Stefano
Stefano Garzarella (12):
libvhost-user: set msg.msg_control to NULL when it is empty
libvhost-user: fail vu_message_write() if sendmsg() is failing
libvhost-us
Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Reviewed-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
meson.build| 1 -
hw/net/vhost_net.c | 5 +
hw/block/Kconfig | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index
-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index a879149fef..22bea0c775 100644
--- a/subprojects/libvhost
(struct sockaddr_un).
So let's follow the last advice and simplify the code as well.
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Reviewed-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
contrib/vhost-user-blk/vhost-user-blk.c | 4
On Thu, May 23, 2024 at 04:55:18PM GMT, Stefano Garzarella wrote:
These defines are also useful for vhost-user-blk when it is compiled
in some POSIX systems that do not define them, so let's move them to
“qemu/osdep.h”.
Suggested-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
On Thu, May 23, 2024 at 05:06:00PM GMT, David Hildenbrand wrote:
On 23.05.24 16:55, Stefano Garzarella wrote:
`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
On Thu, May 23, 2024 at 04:14:48PM GMT, Daniel P. Berrangé wrote:
On Thu, May 23, 2024 at 04:55:18PM +0200, Stefano Garzarella wrote:
These defines are also useful for vhost-user-blk when it is compiled
in some POSIX systems that do not define them, so let's move them to
“qemu/osdep.h
Let's replace the calls to le*toh() and htole*() with qemu/bswap.h
helpers to make the code more portable.
Suggested-by: Philippe Mathieu-Daudé
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
contrib/vhost
(struct sockaddr_un).
So let's follow the last advice and simplify the code as well.
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
contrib/vhost-user-blk/vhost-user-blk.c | 4 +---
1 file changed, 1 insertion
`memory-backend-shm` can be used with vhost-user devices, so let's
add a new test case for it.
Acked-by: Thomas Huth
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-test.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/tests
These defines are also useful for vhost-user-blk when it is compiled
in some POSIX systems that do not define them, so let's move them to
“qemu/osdep.h”.
Suggested-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
---
include/qemu/osdep.h | 14 ++
block/file-posix.c
Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
meson.build| 1 -
hw/net/vhost_net.c | 5 +
hw/block/Kconfig | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index a9de71d450..5a6f7a36eb 100644
anonymous memory such as memfd.
Acked-by: David Hildenbrand
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
v5
- fixed documentation in qapi/qom.json and qemu-options.hx [Markus]
v4
- fail if we find "share=off" in shm_backend_memory_alloc() [David]
v3
- enriched comm
-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-blk-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qtest/vhost-user-blk-test.c
b/tests/qtest/vhost-user-blk-test.c
index 117b9acd10..e945f6abf2 100644
--- a/tests/qtest/vhost
Previous patches made the vhost-user-blk application and the
vhost-user-server.c dependency buildable for any POSIX system.
Acked-by: Stefan Hajnoczi
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
---
v5:
- O_DSYNC and O_DIRECT
a/qemu/-/tree/macos-vhost-user?ref_type=heads
Thanks,
Stefano
Stefano Garzarella (13):
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 F_INFLIGHT_SHMFD if memfd is not supported
vhost-user-se
-off-by: Stefano Garzarella
---
v3:
- avoiding setting fd non-blocking for messages where we have memory fd
(Eric)
---
util/vhost-user-server.c | 12
1 file changed, 12 insertions(+)
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index 3bfb1ad3ec..b19229074a 100644
is not able to properly handle these
messages.
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/subprojects
.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)
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
v5:
- fixed typos in the commit d
to wrong parameters, but the frontend
still sent the payload which the backend incorrectly interpreted
as a wrong header.
Reviewed-by: Daniel P. Berrangé
Reviewed-by: Philippe Mathieu-Daudé
Tested-by: Philippe Mathieu-Daudé
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
subprojects/libvhost-user/libvhost-user.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/subprojects/libvhost-user/libvhost-user.c
b/subprojects/libvhost-user/libvhost-user.c
index a879149fef..22bea0c775 100644
--- a/subprojects/libvhost
The default value of the @share option of the @MemoryBackendProperties
eally depends on the backend type, so let's document it explicitly and
add the default value where it was missing.
Cc: David Hildenbrand
Suggested-by: Markus Armbruster
Signed-off-by: Stefano Garzarella
---
I followed how
ank you for raising this discussion!
Regards,
Halil
---
hw/virtio/vhost-vsock-common.c | 1 +
1 file changed, 1 insertion(+)
This patch LGTM, but as I mention we should fix other devices as well,
but maybe we can do with the common macro you suggested in another
patch.
Reviewed-by: Stefano G
On Wed, May 08, 2024 at 01:59:33PM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
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 external processes
On Wed, May 08, 2024 at 12:32:08PM GMT, Philippe Mathieu-Daudé wrote:
On 8/5/24 09:44, Stefano Garzarella wrote:
Let's make the code more portable by 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
On Wed, May 08, 2024 at 12:36:30PM GMT, Philippe Mathieu-Daudé wrote:
On 8/5/24 09:44, Stefano Garzarella wrote:
The vhost-user protocol is not really Linux-specific so let's enable
libvhost-user for any POSIX system.
Compiling it on macOS and FreeBSD some problems came up:
- avoid to include
On Wed, May 08, 2024 at 12:39:33PM GMT, Philippe Mathieu-Daudé wrote:
On 8/5/24 09:44, 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 memfd.
VHOST_USER_GET_INFLIGHT_FD
On Wed, May 08, 2024 at 01:13:09PM GMT, Marc-André Lureau wrote:
Hi
On Wed, May 8, 2024 at 11:50 AM Stefano Garzarella wrote:
Hi Roman,
On Tue, May 07, 2024 at 11:20:50PM GMT, Roman Kiryanov wrote:
>Hi Stefano,
>
>On Tue, May 7, 2024 at 1:10 AM Stefano Garzarella wrote:
On Wed, May 08, 2024 at 09:57:13AM GMT, Daniel P. Berrangé wrote:
On Wed, May 08, 2024 at 09:44:45AM +0200, Stefano Garzarella wrote:
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
Hi Roman,
On Tue, May 07, 2024 at 11:20:50PM GMT, Roman Kiryanov wrote:
Hi Stefano,
On Tue, May 7, 2024 at 1:10 AM Stefano Garzarella wrote:
I have no experience with Windows, but what we need for vhost-user is:
- AF_UNIX and be able to send file descriptors using ancillary data
(i.e
(struct sockaddr_un).
So let's follow the last advice and simplify the code as well.
Reviewed-by: Philippe Mathieu-Daudé
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
`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 changed
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
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
. 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 setting fd non
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 a11afd1960
`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-user
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
---
meson.build
Let's replace the calls to le*toh() and htole*() with qemu/bswap.h
helpers to make the code more portable.
Suggested-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
---
contrib/vhost-user-blk/vhost-user-blk.c | 9 +
contrib/vhost-user-input/main.c | 16
Let's make the code more portable by 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 Garzarella
---
v4:
- moved using of "qemu/bswap.h" API in
anonymous memory such as memfd.
Acked-by: David Hildenbrand
Signed-off-by: Stefano Garzarella
---
v4
- fail if we find "share=off" in shm_backend_memory_alloc() [David]
v3
- enriched commit message and documentation to highlight that we
want to mimic memfd (David)
---
docs/system/dev
e 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 | 2 +-
subprojects/libvhost-user/libvh
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
-device vhost-user-blk-pci,num-queues=1,chardev=char0 \
-chardev socket,id=char0,path=/tmp/vhost.socket
Branch pushed (and CI started) at
https://gitlab.com/sgarzarella/qemu/-/tree/macos-vhost-user?ref_type=heads
Thanks,
Stefano
Stefano Garzarella (12):
libvhost-user: set msg.msg_control to NUL
Hi,
sorry for the delay, but I have been away most of last month.
On Thu, Apr 18, 2024 at 10:34:43AM GMT, Daniel P. Berrangé wrote:
On Wed, Apr 17, 2024 at 12:31:41PM -0700, Roman Kiryanov wrote:
Hi Daniel,
thank you for looking into this. I checked how VHOST_USER_VSOCK and it
refers to the
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
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.125332-1-sgarz
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
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
other sy
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 a11afd1960
`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-user
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
---
meson.build
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
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 Garzarella
---
m
. 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 setting fd non
tarted) 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 F_INFLIGHT_SHMFD if
e 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 | 2 +-
subprojects/libvhost-user/libvh
(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-user-blk
`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 changed
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
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 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
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.
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
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 really
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 memfd
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
`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-user
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 changed, 5 insertions
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 a11afd1960
-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
---
meson.build
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
libvhost-user:
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
(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-user-blk
e 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 | 2 +-
subprojects/libvhost-user/libvh
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 Garzarella
---
m
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
`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 changed
://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.com/
v2
On Wed, Mar 20, 2024 at 12:18:14PM +0800, Jason Wang wrote:
On Mon, Mar 18, 2024 at 4:27 PM Stefano Garzarella wrote:
On Mon, Mar 18, 2024 at 12:31:59PM +0800, Jason Wang wrote:
>On Fri, Mar 15, 2024 at 4:23 PM Stefano Garzarella wrote:
>>
>> On Thu, Mar 14, 2024 at 11:17:01
On Tue, Feb 27, 2024 at 02:50:08PM +, Roy Hopkins wrote:
In order to add support for parsing IGVM files for secure virtual
machines, a the path to an IGVM file needs to be specified as
part of the guest configuration. It makes sense to add this to
the ConfidentialGuestSupport object as this
Hi Roy,
thanks for this series!
On Tue, Feb 27, 2024 at 02:50:06PM +, Roy Hopkins wrote:
Hi everyone,
This initial patch series submission adds the capability to configure
confidential guests using files that conform to the Independent Guest Virtual
Machine (IGVM) file format. The series
On Mon, Mar 18, 2024 at 12:31:59PM +0800, Jason Wang wrote:
On Fri, Mar 15, 2024 at 4:23 PM Stefano Garzarella wrote:
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() cou
1 - 100 of 1212 matches
Mail list logo