On Wed, Jul 03, 2024 at 06:49:30PM GMT, Michael S. Tsirkin wrote:
On Tue, Jun 18, 2024 at 12:00:30PM +0200, Stefano Garzarella wrote:
As discussed with Michael and Markus [1], this version also includes the patch
on which v7 depended to simplify the merge in Michael's tree.
The series is all
).
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
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
`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
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-test.c | 23
anonymous memory such as memfd.
Acked-by: David Hildenbrand
Acked-by: Stefan Hajnoczi
Acked-by: Markus Armbruster (QAPI schema)
Signed-off-by: Stefano Garzarella
---
v8
- Fixed QAPI documentation about share option [Markus]
v7
- changed default value documentation for @share rebasing
-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 "
.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
---
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
(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
-by: Markus Armbruster
Signed-off-by: Stefano Garzarella
---
v2: https://patchew.org/QEMU/20240611130231.83152-1-sgarz...@redhat.com/
v1: https://patchew.org/QEMU/20240523133302.103858-1-sgarz...@redhat.com/
---
qapi/qom.json | 8 +++-
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git
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
-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
-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
-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
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
Stefano Garzarella (13):
qapi: clarify that the default is backend dependent
libv
On Mon, Jun 17, 2024 at 09:42:21AM GMT, Michael S. Tsirkin wrote:
On Mon, Jun 17, 2024 at 02:59:14PM +0200, Stefano Garzarella wrote:
On Mon, Jun 17, 2024 at 02:02:30PM GMT, Markus Armbruster wrote:
> Stefano Garzarella writes:
>
> > Hi Michael,
> >
> > On Wed, Jun 12
On Mon, Jun 17, 2024 at 02:02:30PM GMT, Markus Armbruster wrote:
Stefano Garzarella writes:
Hi Michael,
On Wed, Jun 12, 2024 at 03:01:28PM GMT, Stefano Garzarella wrote:
This series should be in a good shape, in which tree should we queue it?
@Micheal would your tree be okay?
Markus
Hi Michael,
On Wed, Jun 12, 2024 at 03:01:28PM GMT, Stefano Garzarella wrote:
This series should be in a good shape, in which tree should we queue it?
@Micheal would your tree be okay?
Markus suggested a small change to patch 10, so do you want me to resend
the whole series, or is it okay
On Wed, Jun 12, 2024 at 03:20:48PM 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
-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: 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
`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
Reviewed-by: Philippe Mathieu-Daudé
Signed-off-by: Stefano Garzarella
---
tests/qtest/vhost-user-test.c | 23
anonymous memory such as memfd.
Acked-by: David Hildenbrand
Acked-by: Stefan Hajnoczi
Signed-off-by: Stefano Garzarella
---
v7
- changed default value documentation for @share rebasing on
20240611130231.83152-1-sgarz...@redhat.com [Markus]
- used `memory-backend-shm` instead of `shm` and wrapped
).
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
.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
-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 "
-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
Ooops, wrong cover letter. I just resent the whole series.
Sorry for the confusion.
Stefano
On Wed, Jun 12, 2024 at 2:59 PM Stefano Garzarella wrote:
>
> This series should be in a good shape, in which tree should we queue it?
> @Micheal would your tree be okay?
>
> Th
-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
https://gitlab.com/sgarzarella/qemu/-/tree/macos-vhost-user?ref_type=heads
Based-on: 20240611130231.83152-1-sgarz...@redhat.com
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-user:
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
(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
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
https://gitlab.com/sgarzarella/qemu/-/tree/macos-vhost-user?ref_type=heads
Based-on: 20240611130231.83152-1-sgarz...@redhat.com
Stefano Garzarella (13):
qapi: clarify that the default is backend dependent
libvhost-user: set msg.msg_control to NULL when it is empty
libvhost-user: fail
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 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
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
).
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
-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
-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
(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
.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
---
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: 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
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
-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
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
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
(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
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
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
`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
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
.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: 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
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
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
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
-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
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
-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
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
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 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
. 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
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
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
`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
as
sizeof(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
`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
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
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
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 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
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
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
-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
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
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
as
sizeof(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
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
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
`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
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
. 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
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
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
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
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
1 - 100 of 559 matches
Mail list logo