vhost-user for input & GPU
v2 cover vhost-user for input & GPU
Hi,
vhost-user allows to drive a virtio device in a seperate process. After vhost-user-net, we have seen vhost-user-{scsi,blk,crypto} added more recently.
This series, initially proposed 2 years ago
(https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01905.html)
contributes with vhost-user-input and vhost-user-gpu.
Additionally, to factor out common code and ease the usage, a vhost-user-backend is introduced as an intermediary object between the backend and the qemu device.
You may start a vhost-user-gpu with virgl rendering in a separate process like this:
$ ./vhost-user-gpu -s vgpu.sock & $ qemu... -chardev socket,id=chr,path=vgpu.sock -object vhost-user-backend,id=vug,chardev=chr -device virtio-vga,virgl=true,vhost-user=vug
You may also specify the backend command and the arguments as part of vhost-user-backend qemu arguments. For example, to start a vhost-user-input backend on input device /dev/input/event19:
-object vhost-user-backend,id=vuid,cmd="vhost-user-input /dev/input/event19" -device virtio-input-host-pci,vhost-user=vuid
Feedback welcome,
RFCv2: (addressing some of Gerd comments digged in the archives)
- rebased, clean ups, various small fixes, update commit messages
- teach the vhost-user-backend to take a chardev
- add vhost-user-input-pci, instead of adding vhost code to virtio-input-host-pci
Marc-André Lureau (12):
chardev: avoid crash if no associated address
libvhost-user: exit by default on VHOST_USER_NONE
vhost-user: wrap some read/write with retry handling Add vhost-user-backend
vhost-user: split vhost_user_read()
vhost-user: add vhost_user_input_get_config()
libvhost-user: export vug_source_new
contrib: add vhost-user-input
Add vhost-input-pci
vhost-user: add vhost_user_gpu_set_socket() Add virtio-gpu vhost-user backend
contrib: add vhost-user-gpu
contrib/libvhost-user/libvhost-user-glib.h | 3 + contrib/libvhost-user/libvhost-user.h | 2 + contrib/vhost-user-gpu/virgl.h | 24 + contrib/vhost-user-gpu/vugpu.h | 152 ++++ hw/virtio/virtio-pci.h | 10 + include/hw/virtio/vhost-backend.h | 5 + include/hw/virtio/virtio-gpu.h | 9 + include/hw/virtio/virtio-input.h | 14 + include/sysemu/vhost-user-backend.h | 58 ++ include/ui/console.h | 1 + backends/vhost-user.c | 330 +++++++ chardev/char-socket.c | 7 +- contrib/libvhost-user/libvhost-user-glib.c | 15 +- contrib/libvhost-user/libvhost-user.c | 2 + contrib/vhost-user-gpu/main.c | 953 +++++++++++++++++++++ contrib/vhost-user-gpu/virgl.c | 537 ++++++++++++ contrib/vhost-user-input/main.c | 358 ++++++++ hw/display/vhost-gpu.c | 290 +++++++ hw/display/virtio-gpu-3d.c | 8 +- hw/display/virtio-gpu-pci.c | 5 + hw/display/virtio-gpu.c | 77 +- hw/display/virtio-vga.c | 5 + hw/input/vhost-user-input.c | 124 +++ hw/virtio/vhost-user.c | 112 ++- hw/virtio/virtio-pci.c | 20 + ui/spice-display.c | 3 +- vl.c | 3 +- MAINTAINERS | 1 + Makefile | 6 + Makefile.objs | 2 + backends/Makefile.objs | 4 + configure | 5 + contrib/vhost-user-gpu/Makefile.objs | 7 + contrib/vhost-user-input/Makefile.objs | 1 + docs/interop/vhost-user.txt | 6 + hw/display/Makefile.objs | 2 +- hw/input/Makefile.objs | 1 + 37 files changed, 3137 insertions(+), 25 deletions(-) create mode 100644 contrib/vhost-user-gpu/virgl.h create mode 100644 contrib/vhost-user-gpu/vugpu.h create mode 100644 include/sysemu/vhost-user-backend.h create mode 100644 backends/vhost-user.c create mode 100644 contrib/vhost-user-gpu/main.c create mode 100644 contrib/vhost-user-gpu/virgl.c create mode 100644 contrib/vhost-user-input/main.c create mode 100644 hw/display/vhost-gpu.c create mode 100644 hw/input/vhost-user-input.c create mode 100644 contrib/vhost-user-gpu/Makefile.objs create mode 100644 contrib/vhost-user-input/Makefile.objs
base-commit: c181ddaa176856b3cd2dfd12bbcf25fa9c884a97
Signature · 1 line
2.17.1.906.g10fd178552
RFC v2 1/12 chardev: avoid crash if no associated address
A socket chardev may not have associated address (when adding client fd manually for example). But on disconnect, updating socket filename expects an address and may lead to this crash:
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x0000555555d8c70c in SocketAddress_to_str (prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at /home/elmarco/src/qq/chardev/char-socket.c:388
388 switch (addr->type) {
(gdb) bt
#0 0x0000555555d8c70c in SocketAddress_to_str (prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at /home/elmarco/src/qq/chardev/char-socket.c:388 #1 0x0000555555d8c8aa in update_disconnected_filename (s=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:419 #2 0x0000555555d8c959 in tcp_chr_disconnect (chr=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:438 #3 0x0000555555d8cba1 in tcp_chr_hup (channel=0x555556b75690, cond=G_IO_HUP, opaque=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:482 #4 0x0000555555da596e in qio_channel_fd_source_dispatch (source=0x555556bb68b0, callback=0x555555d8cb58 <tcp_chr_hup>, user_data=0x555556b1ed00) at /home/elmarco/src/qq/io/channel-watch.c:84
--- chardev/char-socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
chardev/char-socket.c +5 -2
@@ -416,8 +416,11 @@ static void update_disconnected_filename(SocketChardev *s)Chardev *chr =CHARDEV (s);g_free (chr->filename); - chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, - s->is_listen, s->is_telnet); + chr->filename =NULL ; +if (s->addr) { + chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, + s->is_listen, s->is_telnet); + } }/* NB may be called even if tcp_chr_connect has not been
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 01/12] chardev: avoid crash if no associated address
Quoted 24 lines · Marc-André Lureau
A socket chardev may not have associated address (when adding client fd manually for example). But on disconnect, updating socket filename expects an address and may lead to this crash:
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x0000555555d8c70cinSocketAddress_to_str(prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at/home/elmarco/src/qq/chardev/char-socket.c:388
388 switch (addr->type) {
(gdb) bt#0 0x0000555555d8c70c in SocketAddress_to_str (prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at /home/elmarco/src/qq/chardev/char-socket.c:388 #1 0x0000555555d8c8aa in update_disconnected_filename (s=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:419 #2 0x0000555555d8c959 in tcp_chr_disconnect (chr=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:438 #3 0x0000555555d8cba1 in tcp_chr_hup (channel=0x555556b75690, cond=G_IO_HUP, opaque=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:482 #4 0x0000555555da596e in qio_channel_fd_source_dispatch (source=0x555556bb68b0, callback=0x555555d8cb58 <tcp_chr_hup>, user_data=0x555556b1ed00) at /home/elmarco/src/qq/io/channel-watch.c:84Signed-off-by Marc-André Lureau <[email protected]>--- chardev/char-socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)chardev/char-socket.c +0
-0
chardev/char-socket.c static void update_disconnected_filename(SocketChardev *s) · line 420
Quoted 7 lines
chardev/char-socket.c +2
-2@@ -416,8 +416,11 @@ static void update_disconnected_filename(SocketChardev *s)Chardev *chr =CHARDEV (s);g_free (chr->filename); - chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, - s->is_listen, s->is_telnet); + chr->filename =NULL ; +if (s->addr) {
Isn't it more robust to add this check in SocketAddress_to_str()?
static char *SocketAddress_to_str(const char *prefix, SocketAddress
*addr,
bool is_listen, bool is_telnet)
{
if (!addr) {
return NULL;
}
switch (addr->type) {
...Quoted 7 lines
chardev/char-socket.c +3
-0+ chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, + s->is_listen, s->is_telnet); + } }/* NB may be called even if tcp_chr_connect has not been
Re: [Qemu-devel] [RFC v2 01/12] chardev: avoid crash if no associated address
Quoted 27 lines · Philippe Mathieu-Daudé
Quoted 26 lines · Marc-André Lureau
A socket chardev may not have associated address (when adding client fd manually for example). But on disconnect, updating socket filename expects an address and may lead to this crash:
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x0000555555d8c70cinSocketAddress_to_str(prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at/home/elmarco/src/qq/chardev/char-socket.c:388
388 switch (addr->type) {
(gdb) bt#0 0x0000555555d8c70c in SocketAddress_to_str (prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at /home/elmarco/src/qq/chardev/char-socket.c:388 #1 0x0000555555d8c8aa in update_disconnected_filename (s=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:419 #2 0x0000555555d8c959 in tcp_chr_disconnect (chr=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:438 #3 0x0000555555d8cba1 in tcp_chr_hup (channel=0x555556b75690, cond=G_IO_HUP, opaque=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:482 #4 0x0000555555da596e in qio_channel_fd_source_dispatch (source=0x555556bb68b0, callback=0x555555d8cb58 <tcp_chr_hup>, user_data=0x555556b1ed00) at /home/elmarco/src/qq/io/channel-watch.c:84Signed-off-by Marc-André Lureau <[email protected]>--- chardev/char-socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)chardev/char-socket.c +0
-0@@ -416,8 +416,11 @@ static void update_disconnected_filename(SocketChardev *s)Chardev *chr =CHARDEV (s);
Quoted 7 lines
chardev/char-socket.c static void update_disconnected_filename(SocketChardev *s) · line 420
Quoted 5 lines
chardev/char-socket.c +2
-2g_free (chr->filename); - chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, - s->is_listen, s->is_telnet); + chr->filename =NULL ; +if (s->addr) {Isn't it more robust to add this check in
SocketAddress_to_str()?
IMHO that just shifts the problem elsewhere - currently SocketAddress_to_str is assumed to return non-NULL, or to abort(). Shifting the check means it can now return NULL, so there's every chance the caller will now reference the NULL pointer that's returned.
Quoted 19 lines
static char *SocketAddress_to_str(const char *prefix, SocketAddress
*addr,bool is_listen, bool is_telnet) { if (!addr) { return NULL; } switch (addr->type) { ...Quoted 7 lines
chardev/char-socket.c +3
-0+ chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, + s->is_listen, s->is_telnet); + } }/* NB may be called even if tcp_chr_connect has not been
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [Qemu-devel] [RFC v2 01/12] chardev: avoid crash if no associated address
In reply to Marc-André LureauQuoted 25 lines · Marc-André Lureau
A socket chardev may not have associated address (when adding client fd manually for example). But on disconnect, updating socket filename expects an address and may lead to this crash:
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x0000555555d8c70cinSocketAddress_to_str(prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at/home/elmarco/src/qq/chardev/char-socket.c:388
388 switch (addr->type) {
(gdb) bt#0 0x0000555555d8c70c in SocketAddress_to_str (prefix=0x555556043062 "disconnected:", addr=0x0, is_listen=false, is_telnet=false) at /home/elmarco/src/qq/chardev/char-socket.c:388 #1 0x0000555555d8c8aa in update_disconnected_filename (s=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:419 #2 0x0000555555d8c959 in tcp_chr_disconnect (chr=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:438 #3 0x0000555555d8cba1 in tcp_chr_hup (channel=0x555556b75690, cond=G_IO_HUP, opaque=0x555556b1ed00) at /home/elmarco/src/qq/chardev/char-socket.c:482 #4 0x0000555555da596e in qio_channel_fd_source_dispatch (source=0x555556bb68b0, callback=0x555555d8cb58 <tcp_chr_hup>, user_data=0x555556b1ed00) at /home/elmarco/src/qq/io/channel-watch.c:84Signed-off-by Marc-André Lureau <[email protected]>--- chardev/char-socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)chardev/char-socket.c +0
-0@@ -416,8 +416,11 @@ static void update_disconnected_filename(SocketChardev *s)Chardev *chr =CHARDEV (s);
chardev/char-socket.c static void update_disconnected_filename(SocketChardev *s) · line 424
Quoted 10 lines
chardev/char-socket.c +5
-2g_free (chr->filename); - chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, - s->is_listen, s->is_telnet); + chr->filename =NULL ; +if (s->addr) { + chr->filename =SocketAddress_to_str ("disconnected:" , s->addr, + s->is_listen, s->is_telnet); + } }
This will mean 'chr->filename' as NULL, which means other code using this field may get NULL - especially the monitor looks like it will printf() passing a NULL, which is a crash on some platforms. So I think you need an else clause that will set it to some dummy value.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
RFC v2 2/12 libvhost-user: exit by default on VHOST_USER_NONE
In reply to Marc-André LureauSince commit 2566378d6d13bf4d28c7770bdbda5f7682594bbe, libvhost-user no longer panics on disconnect (rc == 0), and instead silently ignores an invalid VHOST_USER_NONE message.
Without extra work from the API user, this will simply busy-loop on HUP events. The obvious thing to do is to exit(0) instead, while additional or different work can be done by overriding iface->process_msg().
--- contrib/libvhost-user/libvhost-user.c | 2 ++ 1 file changed, 2 insertions(+)
contrib/libvhost-user/libvhost-user.c +2 -0
@@ -1220,6 +1220,8 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg)case VHOST_USER_SET_CONFIG :return vu_set_config (dev, vmsg);case VHOST_USER_NONE : +/* if you need processing before exit, override iface->process_msg */ +exit (0 );break ;case VHOST_USER_POSTCOPY_ADVISE :return vu_set_postcopy_advise (dev, vmsg);
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 02/12] libvhost-user: exit by default on VHOST_USER_NONE
Quoted 19 lines · Marc-André Lureau
Since commit
2566378d6d13bf4d28c7770bdbda5f7682594bbe, libvhost-user no longer panics on disconnect (rc == 0), and instead silently ignores an invalidVHOST_USER_NONEmessage.Without extra work from the API user, this will simply busy-loop on HUP events. The obvious thing to do is to exit(0) instead, while additional or different work can be done by overriding
iface->process_msg().Signed-off-by Marc-André Lureau <[email protected]>--- contrib/libvhost-user/libvhost-user.c | 2 ++ 1 file changed, 2 insertions(+)contrib/libvhost-user/libvhost-user.c +0
-0
contrib/libvhost-user/libvhost-user.c vu_process_message(VuDev *dev, VhostUserMsg *vmsg) · line 1225
Quoted 6 lines
contrib/libvhost-user/libvhost-user.c +2
-0@@ -1220,6 +1220,8 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg)case VHOST_USER_SET_CONFIG :return vu_set_config (dev, vmsg);case VHOST_USER_NONE : +/* if you need processing before exit, override iface->process_msg */ +exit (0 );break ;
Remove the 'break'?
Quoted 3 lines
contrib/libvhost-user/libvhost-user.c +0
-0case VHOST_USER_POSTCOPY_ADVISE :return vu_set_postcopy_advise (dev, vmsg);
RFC v2 3/12 vhost-user: wrap some read/write with retry handling
In reply to Marc-André Lureau--- hw/virtio/vhost-user.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
hw/virtio/vhost-user.c +12 -3
@@ -869,7 +869,10 @@ static void slave_read(void *opaque) iov.iov_base = &hdr; iov.iov_len =VHOST_USER_HDR_SIZE ; - size =recvmsg (u->slave_fd, &msgh,0 ); +do { + size =recvmsg (u->slave_fd, &msgh,0 ); + }while (size <0 && (errno ==EINTR || errno ==EAGAIN )); +if (size !=VHOST_USER_HDR_SIZE ) {error_report ("Failed to read from slave." ); goto err;
@@ -898,7 +901,10 @@ static void slave_read(void *opaque) }/* Read payload */ - size =read (u->slave_fd, &payload, hdr.size); +do { + size =read (u->slave_fd, &payload, hdr.size); + }while (size <0 && (errno ==EINTR || errno ==EAGAIN )); +if (size != hdr.size) {error_report ("Failed to read payload from slave." ); goto err;
@@ -941,7 +947,10 @@ static void slave_read(void *opaque) iovec[1 ].iov_base = &payload; iovec[1 ].iov_len = hdr.size; - size =writev (u->slave_fd, iovec,ARRAY_SIZE (iovec)); +do { + size =writev (u->slave_fd, iovec,ARRAY_SIZE (iovec)); + }while (size <0 && (errno ==EINTR || errno ==EAGAIN )); +if (size !=VHOST_USER_HDR_SIZE + hdr.size) {error_report ("Failed to send msg reply to slave." ); goto err;
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 03/12] vhost-user: wrap some read/write with retry handling
Quoted 1 line · Marc-André Lureau
Signed-off-by Marc-André Lureau <[email protected]>
Quoted 45 lines
--- hw/virtio/vhost-user.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)hw/virtio/vhost-user.c +12
-3@@ -869,7 +869,10 @@ static void slave_read(void *opaque) iov.iov_base = &hdr; iov.iov_len =VHOST_USER_HDR_SIZE ; - size =recvmsg (u->slave_fd, &msgh,0 ); +do { + size =recvmsg (u->slave_fd, &msgh,0 ); + }while (size <0 && (errno ==EINTR || errno ==EAGAIN )); +if (size !=VHOST_USER_HDR_SIZE ) {error_report ("Failed to read from slave." ); goto err;@@ -898,7 +901,10 @@ static void slave_read(void *opaque) }/* Read payload */ - size =read (u->slave_fd, &payload, hdr.size); +do { + size =read (u->slave_fd, &payload, hdr.size); + }while (size <0 && (errno ==EINTR || errno ==EAGAIN )); +if (size != hdr.size) {error_report ("Failed to read payload from slave." ); goto err;@@ -941,7 +947,10 @@ static void slave_read(void *opaque) iovec[1 ].iov_base = &payload; iovec[1 ].iov_len = hdr.size; - size =writev (u->slave_fd, iovec,ARRAY_SIZE (iovec)); +do { + size =writev (u->slave_fd, iovec,ARRAY_SIZE (iovec)); + }while (size <0 && (errno ==EINTR || errno ==EAGAIN )); +if (size !=VHOST_USER_HDR_SIZE + hdr.size) {error_report ("Failed to send msg reply to slave." ); goto err;
RFC v2 4/12 Add vhost-user-backend
In reply to Marc-André LureauCreate a vhost-user-backend object that holds a connection to a vhost-user backend and can be referenced from virtio devices that support it. See later patches for input & gpu usage.
A chardev can be specified to communicate with the vhost-user backend,
ex: -chardev socket,id=char0,path=/tmp/foo.sock -object vhost-user-backend,id=vuid,chardev=char0.
Alternatively, an executable with its arguments may be given as 'cmd' property, ex: -object vhost-user-backend,id=vui,cmd="./vhost-user-input /dev/input..". The executable is then spawn and, by convention, the vhost-user socket is passed as fd=3. It may be considered a security breach to allow creating processes that may execute arbitrary executables, so this may be restricted to some known executables (via signature etc) or directory.
--- include/sysemu/vhost-user-backend.h | 58 +++++ backends/vhost-user.c | 330 ++++++++++++++++++++++++++++ vl.c | 3 +- backends/Makefile.objs | 4 + 4 files changed, 394 insertions(+), 1 deletion(-) create mode 100644 include/sysemu/vhost-user-backend.h create mode 100644 backends/vhost-user.c
include/sysemu/vhost-user-backend.h new file +58 -0
@@ -0,0 +1,58 @@ +/* +* QEMU vhost-user backend +* +* Copyright (C) 2018 Red Hat Inc +* +* Authors: +* Marc-André Lureau <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ +#ifndef QEMU_VHOST_USER_BACKEND_H +#define QEMU_VHOST_USER_BACKEND_H + +#include "qom/object.h" +#include "exec/memory.h" +#include "qemu/option.h" +#include "qemu/bitmap.h" +#include "hw/virtio/vhost.h" +#include "chardev/char-fe.h" +#include "io/channel.h" + +#define TYPE_VHOST_USER_BACKEND "vhost-user-backend" +#define VHOST_USER_BACKEND (obj) \ + OBJECT_CHECK(VhostUserBackend, (obj), TYPE_VHOST_USER_BACKEND) +#define VHOST_USER_BACKEND_GET_CLASS (obj) \ + OBJECT_GET_CLASS(VhostUserBackendClass, (obj), TYPE_VHOST_USER_BACKEND) +#define VHOST_USER_BACKEND_CLASS (klass) \ + OBJECT_CLASS_CHECK(VhostUserBackendClass, (klass), TYPE_VHOST_USER_BACKEND) + +typedef struct VhostUserBackend VhostUserBackend ; +typedef struct VhostUserBackendClass VhostUserBackendClass ; + +struct VhostUserBackendClass { +ObjectClass parent_class; +}; + +struct VhostUserBackend { +/* private */ +Object parent; + +char *cmd; +char *chr_name; + +CharBackend chr; +struct vhost_dev dev; +QIOChannel *child; +VirtIODevice *vdev; +bool started; +bool completed; +}; + +int vhost_user_backend_dev_init (VhostUserBackend *b,VirtIODevice *vdev, +unsigned nvqs,Error **errp); +void vhost_user_backend_start (VhostUserBackend *b); +void vhost_user_backend_stop (VhostUserBackend *b); + +#endif
backends/vhost-user.c new file +330 -0
330 lines not on this page · raw message
vl.c +2 -1
@@ -2833,7 +2833,8 @@ static bool object_create_initial(const char *type) }#if defined(CONFIG_VHOST_USER ) && defined(CONFIG_LINUX ) -if (g_str_equal (type,"cryptodev-vhost-user" )) { +if (g_str_equal (type,"cryptodev-vhost-user" ) || +g_str_equal (type,"vhost-user-backend" )) {return false; }#endif
backends/Makefile.objs +4 -0
@@ -16,3 +16,7 @@ common-obj-$(call land,$(CONFIG_VHOST_USER),$(CONFIG_LINUX)) += \ endif common-obj-$(CONFIG_LINUX) += hostmem-memfd.o + +ifdef CONFIG_LINUX +common-obj-$(CONFIG_VIRTIO) += vhost-user.o +endif
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 04/12] Add vhost-user-backend
Quoted 8 lines · Marc-André Lureau
Create a vhost-user-backend object that holds a connection to a vhost-user backend and can be referenced from virtio devices that support it. See later patches for input & gpu usage.
A chardev can be specified to communicate with the vhost-user backend,
ex: -chardev socket,id=char0,path=/tmp/foo.sock -object vhost-user-backend,id=vuid,chardev=char0.
Quoted 8 lines
Alternatively, an executable with its arguments may be given as 'cmd' property, ex: -object vhost-user-backend,id=vui,cmd="./vhost-user-input
/dev/input..". The executable is then spawn and, by convention, the vhost-user socket is passed as fd=3. It may be considered a security breach to allow creating processes that may execute arbitrary executables, so this may be restricted to some known executables (via signature etc) or directory.
Passing a binary and args as a string blob.....
Quoted 21 lines
backends/vhost-user.c new file +21
-0+static int +vhost_user_backend_spawn_cmd (VhostUserBackend *b,int vhostfd,Error **errp) +{ +int devnull =open ("/dev/null" ,O_RDWR ); +pid_t pid; + +assert (!b->child); + +if (!b->cmd) { +error_setg_errno (errp, errno,"Missing cmd property" ); +return -1 ; + } +if (devnull <0 ) { +error_setg_errno (errp, errno,"Unable to open /dev/null" ); +return -1 ; + } + + pid =qemu_fork (errp); +if (pid <0 ) { +close (devnull); +return -1 ;
backends/vhost-user.c line 165
Quoted 10 lines
backends/vhost-user.c new file +10
-0+ } + +if (pid ==0 ) {/* child */ +int fd, maxfd =sysconf (_SC_OPEN_MAX); + +dup2 (devnull,STDIN_FILENO ); +dup2 (devnull,STDOUT_FILENO ); +dup2 (vhostfd,3 ); + +signal (SIGINT ,SIG_IGN );
Why ignore SIGINT ? Surely we want this extra process to be killed someone ctrl-c's the parent QEMU.
backends/vhost-user.c line 171
Quoted 6 lines
backends/vhost-user.c new file +6
-0+ +for (fd =4 ; fd < maxfd; fd++) { +close (fd); + } + +execlp ("/bin/sh" ,"sh" ,"-c" , b->cmd,NULL );
...which is then interpreted by the shell is a recipe for security flaws. There needs to be a way to pass the command + arguments to QEMU as an argv[] we can directly exec without involving the shell.
backends/vhost-user.c line 175
Quoted 4 lines
backends/vhost-user.c new file +4
-0+_exit (1 ); + } + + b->child =QIO_CHANNEL (qio_channel_command_new_pid (devnull, devnull, pid));
Overall this method overall duplicates much of the qio_channel_command_new_argv(), though you do have a few differences.
I'd prefer if we could make qio_channel_command_new_argv more flexible to handle these extra needs though.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [Qemu-devel] [RFC v2 04/12] Add vhost-user-backend
Hi
Quoted 46 lines · Daniel P. Berrangé
Quoted 8 lines · Marc-André Lureau
Create a vhost-user-backend object that holds a connection to a vhost-user backend and can be referenced from virtio devices that support it. See later patches for input & gpu usage.
A chardev can be specified to communicate with the vhost-user backend,
ex: -chardev socket,id=char0,path=/tmp/foo.sock -object vhost-user-backend,id=vuid,chardev=char0.Quoted 8 lines
Alternatively, an executable with its arguments may be given as 'cmd' property, ex: -object vhost-user-backend,id=vui,cmd="./vhost-user-input
/dev/input..". The executable is then spawn and, by convention, the vhost-user socket is passed as fd=3. It may be considered a security breach to allow creating processes that may execute arbitrary executables, so this may be restricted to some known executables (via signature etc) or directory.Passing a binary and args as a string blob.....
Quoted 26 lines
backends/vhost-user.c new file +26
-0+static int +vhost_user_backend_spawn_cmd (VhostUserBackend *b,int vhostfd,Error **errp) +{ +int devnull =open ("/dev/null" ,O_RDWR ); +pid_t pid; + +assert (!b->child); + +if (!b->cmd) { +error_setg_errno (errp, errno,"Missing cmd property" ); +return -1 ; + } +if (devnull <0 ) { +error_setg_errno (errp, errno,"Unable to open /dev/null" ); +return -1 ; + } + + pid =qemu_fork (errp); +if (pid <0 ) { +close (devnull); +return -1 ; + } + +if (pid ==0 ) {/* child */ +int fd, maxfd =sysconf (_SC_OPEN_MAX); +
Quoted 8 lines
backends/vhost-user.c line 165
Quoted 5 lines
backends/vhost-user.c new file +5
-0+dup2 (devnull,STDIN_FILENO ); +dup2 (devnull,STDOUT_FILENO ); +dup2 (vhostfd,3 ); + +signal (SIGINT ,SIG_IGN );Why ignore SIGINT ? Surely we want this extra process to be killed someone ctrl-c's the parent QEMU.
leftover, removed
Quoted 13 lines
backends/vhost-user.c line 171
Quoted 7 lines
backends/vhost-user.c new file +6
-0+ +for (fd =4 ; fd < maxfd; fd++) { +close (fd); + } + +execlp ("/bin/sh" ,"sh" ,"-c" , b->cmd,NULL );...which is then interpreted by the shell is a recipe for security flaws. There needs to be a way to pass the command + arguments to QEMU as an argv[] we can directly exec without involving the shell.
For now, I use g_shell_parse_argv(). Do you have a better idea?
Quoted 11 lines
backends/vhost-user.c line 175
Quoted 4 lines
backends/vhost-user.c new file +4
-0+_exit (1 ); + } + + b->child =QIO_CHANNEL (qio_channel_command_new_pid (devnull, devnull, pid));Overall this method overall duplicates much of the
qio_channel_command_new_argv(), though you do have a few differences.I'd prefer if we could make
qio_channel_command_new_argvmore flexible to handle these extra needs though.
Ok I added a pre-exec callback for the extra dup2() & close().
Thanks,
Signature · 1 line
Marc-André Lureau
Re: [Qemu-devel] [RFC v2 04/12] Add vhost-user-backend
Quoted 74 lines · Marc-André Lureau
Hi
Quoted 46 lines · Daniel P. Berrangé
Quoted 8 lines · Marc-André Lureau
Create a vhost-user-backend object that holds a connection to a vhost-user backend and can be referenced from virtio devices that support it. See later patches for input & gpu usage.
A chardev can be specified to communicate with the vhost-user backend,
ex: -chardev socket,id=char0,path=/tmp/foo.sock -object vhost-user-backend,id=vuid,chardev=char0.Quoted 8 lines
Alternatively, an executable with its arguments may be given as 'cmd' property, ex: -object vhost-user-backend,id=vui,cmd="./vhost-user-input
/dev/input..". The executable is then spawn and, by convention, the vhost-user socket is passed as fd=3. It may be considered a security breach to allow creating processes that may execute arbitrary executables, so this may be restricted to some known executables (via signature etc) or directory.Passing a binary and args as a string blob.....
Quoted 26 lines
backends/vhost-user.c new file +26
-0+static int +vhost_user_backend_spawn_cmd (VhostUserBackend *b,int vhostfd,Error **errp) +{ +int devnull =open ("/dev/null" ,O_RDWR ); +pid_t pid; + +assert (!b->child); + +if (!b->cmd) { +error_setg_errno (errp, errno,"Missing cmd property" ); +return -1 ; + } +if (devnull <0 ) { +error_setg_errno (errp, errno,"Unable to open /dev/null" ); +return -1 ; + } + + pid =qemu_fork (errp); +if (pid <0 ) { +close (devnull); +return -1 ; + } + +if (pid ==0 ) {/* child */ +int fd, maxfd =sysconf (_SC_OPEN_MAX); +Quoted 8 lines
backends/vhost-user.c line 165
Quoted 5 lines
backends/vhost-user.c new file +5
-0+dup2 (devnull,STDIN_FILENO ); +dup2 (devnull,STDOUT_FILENO ); +dup2 (vhostfd,3 ); + +signal (SIGINT ,SIG_IGN );Why ignore SIGINT ? Surely we want this extra process to be killed someone ctrl-c's the parent QEMU.
leftover, removed
Quoted 13 lines
backends/vhost-user.c line 171
Quoted 7 lines
backends/vhost-user.c new file +6
-0+ +for (fd =4 ; fd < maxfd; fd++) { +close (fd); + } + +execlp ("/bin/sh" ,"sh" ,"-c" , b->cmd,NULL );...which is then interpreted by the shell is a recipe for security flaws. There needs to be a way to pass the command + arguments to QEMU as an argv[] we can directly exec without involving the shell.
Quoted 1 line
For now, I use
g_shell_parse_argv(). Do you have a better idea?
Accept individual args at the cli level is far preferrable - we don't want anything to be parsing shell strings:
vhost-user-backend,id=vui,binary=/sbin/vhost-user-input,arg=/dev/input,arg=foo,arg=bar
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Re: [Qemu-devel] [RFC v2 04/12] Add vhost-user-backend
Hi
Quoted 75 lines · Daniel P. Berrangé
Quoted 74 lines · Marc-André Lureau
Hi
Quoted 46 lines · Daniel P. Berrangé
Quoted 8 lines · Marc-André Lureau
Create a vhost-user-backend object that holds a connection to a vhost-user backend and can be referenced from virtio devices that support it. See later patches for input & gpu usage.
A chardev can be specified to communicate with the vhost-user backend,
ex: -chardev socket,id=char0,path=/tmp/foo.sock -object vhost-user-backend,id=vuid,chardev=char0.Quoted 8 lines
Alternatively, an executable with its arguments may be given as 'cmd' property, ex: -object vhost-user-backend,id=vui,cmd="./vhost-user-input
/dev/input..". The executable is then spawn and, by convention, the vhost-user socket is passed as fd=3. It may be considered a security breach to allow creating processes that may execute arbitrary executables, so this may be restricted to some known executables (via signature etc) or directory.Passing a binary and args as a string blob.....
Quoted 26 lines
backends/vhost-user.c new file +26
-0+static int +vhost_user_backend_spawn_cmd (VhostUserBackend *b,int vhostfd,Error **errp) +{ +int devnull =open ("/dev/null" ,O_RDWR ); +pid_t pid; + +assert (!b->child); + +if (!b->cmd) { +error_setg_errno (errp, errno,"Missing cmd property" ); +return -1 ; + } +if (devnull <0 ) { +error_setg_errno (errp, errno,"Unable to open /dev/null" ); +return -1 ; + } + + pid =qemu_fork (errp); +if (pid <0 ) { +close (devnull); +return -1 ; + } + +if (pid ==0 ) {/* child */ +int fd, maxfd =sysconf (_SC_OPEN_MAX); +Quoted 8 lines
backends/vhost-user.c line 165
Quoted 5 lines
backends/vhost-user.c new file +5
-0+dup2 (devnull,STDIN_FILENO ); +dup2 (devnull,STDOUT_FILENO ); +dup2 (vhostfd,3 ); + +signal (SIGINT ,SIG_IGN );Why ignore SIGINT ? Surely we want this extra process to be killed someone ctrl-c's the parent QEMU.
leftover, removed
Quoted 13 lines
backends/vhost-user.c line 171
Quoted 7 lines
backends/vhost-user.c new file +6
-0+ +for (fd =4 ; fd < maxfd; fd++) { +close (fd); + } + +execlp ("/bin/sh" ,"sh" ,"-c" , b->cmd,NULL );...which is then interpreted by the shell is a recipe for security flaws. There needs to be a way to pass the command + arguments to QEMU as an argv[] we can directly exec without involving the shell.
Quoted 6 lines
Quoted 1 line
For now, I use
g_shell_parse_argv(). Do you have a better idea?Accept individual args at the cli level is far preferrable - we don't want anything to be parsing shell strings:
vhost-user-backend,id=vui,binary=/sbin/vhost-user-input,arg=/dev/input,arg=foo,arg=bar
Object arguments are populated in a dictionary. Only the last value specified is used.
g_shell_parse_argv() isn't that scary imho. But if there is a blacklist of functions, it would be worth to have them listed somewhere.
Re: [Qemu-devel] [RFC v2 04/12] Add vhost-user-backend
Quoted 80 lines · Marc-André Lureau
Hi
Quoted 77 lines · Daniel P. Berrangé
Quoted 75 lines · Marc-André Lureau
Hi
Quoted 46 lines · Daniel P. Berrangé
Quoted 8 lines · Marc-André Lureau
Create a vhost-user-backend object that holds a connection to a vhost-user backend and can be referenced from virtio devices that support it. See later patches for input & gpu usage.
A chardev can be specified to communicate with the vhost-user backend,
ex: -chardev socket,id=char0,path=/tmp/foo.sock -object vhost-user-backend,id=vuid,chardev=char0.Quoted 8 lines
Alternatively, an executable with its arguments may be given as 'cmd' property, ex: -object vhost-user-backend,id=vui,cmd="./vhost-user-input
/dev/input..". The executable is then spawn and, by convention, the vhost-user socket is passed as fd=3. It may be considered a security breach to allow creating processes that may execute arbitrary executables, so this may be restricted to some known executables (via signature etc) or directory.Passing a binary and args as a string blob.....
Quoted 26 lines
backends/vhost-user.c new file +26
-0+static int +vhost_user_backend_spawn_cmd (VhostUserBackend *b,int vhostfd,Error **errp) +{ +int devnull =open ("/dev/null" ,O_RDWR ); +pid_t pid; + +assert (!b->child); + +if (!b->cmd) { +error_setg_errno (errp, errno,"Missing cmd property" ); +return -1 ; + } +if (devnull <0 ) { +error_setg_errno (errp, errno,"Unable to open /dev/null" ); +return -1 ; + } + + pid =qemu_fork (errp); +if (pid <0 ) { +close (devnull); +return -1 ; + } + +if (pid ==0 ) {/* child */ +int fd, maxfd =sysconf (_SC_OPEN_MAX); +Quoted 8 lines
backends/vhost-user.c line 165
Quoted 5 lines
backends/vhost-user.c new file +5
-0+dup2 (devnull,STDIN_FILENO ); +dup2 (devnull,STDOUT_FILENO ); +dup2 (vhostfd,3 ); + +signal (SIGINT ,SIG_IGN );Why ignore SIGINT ? Surely we want this extra process to be killed someone ctrl-c's the parent QEMU.
leftover, removed
Quoted 13 lines
backends/vhost-user.c line 171
Quoted 7 lines
backends/vhost-user.c new file +6
-0+ +for (fd =4 ; fd < maxfd; fd++) { +close (fd); + } + +execlp ("/bin/sh" ,"sh" ,"-c" , b->cmd,NULL );...which is then interpreted by the shell is a recipe for security flaws. There needs to be a way to pass the command + arguments to QEMU as an argv[] we can directly exec without involving the shell.
For now, I use
g_shell_parse_argv(). Do you have a better idea?
Quoted 7 lines
Quoted 4 lines
Accept individual args at the cli level is far preferrable - we don't want anything to be parsing shell strings:
vhost-user-backend,id=vui,binary=/sbin/vhost-user-input,arg=/dev/input,arg=foo,arg=bar
Object arguments are populated in a dictionary. Only the last value specified is used.
Sigh, yes, this goes back to -object not having a full syntax for non-scalar properties.
The quickest short term solution to this is to get the support for "-object json:..." working probably, then it will be just as expressive as QMP's object_add.
Quoted 3 lines
g_shell_parse_argv()isn't that scary imho. But if there is a blacklist of functions, it would be worth to have them listed somewhere.
We don't want to be using shell at all - we are going to be directly passing the binary to execve(), so shell won't be involved. The g_shell_parse_argv() is not simply splitting a string based on whitespace, it is intepreting shell quoting rules, comments and more. IOW, it is mangling args we'll be passing to execve() based on shell rules that we're not intending to be using. It is simply wrong to use g_shell_parse_argv() for this.
Regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
RFC v2 5/12 vhost-user: split vhost_user_read()
In reply to Marc-André LureauSplit vhost_user_read(), so only header can be read with vhost_user_read_header().
--- hw/virtio/vhost-user.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)
hw/virtio/vhost-user.c +19 -8
@@ -196,7 +196,7 @@ static bool ioeventfd_enabled(void)return kvm_enabled () &&kvm_eventfds_enabled (); } -static int vhost_user_read (struct vhost_dev *dev,VhostUserMsg *msg) +static int vhost_user_read_header (struct vhost_dev *dev,VhostUserMsg *msg) {struct vhost_user *u = dev->opaque;CharBackend *chr = u->chr;
@@ -207,7 +207,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)if (r != size) {error_report ("Failed to read msg header. Read %d instead of %d." " Original request %d." , r, size, msg->hdr.request); - goto fail; +return -1 ; }/* validate received flags */
@@ -215,7 +215,21 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)error_report ("Failed to read msg header." " Flags 0x%x instead of 0x%x." , msg->hdr.flags,VHOST_USER_REPLY_MASK |VHOST_USER_VERSION ); - goto fail; +return -1 ; + } + +return 0 ; +} + +static int vhost_user_read (struct vhost_dev *dev,VhostUserMsg *msg) +{ +struct vhost_user *u = dev->opaque; +CharBackend *chr = u->chr; +uint8_t *p = (uint8_t *) msg; +int r, size; + +if (vhost_user_read_header (dev, msg) <0 ) { +return -1 ; }/* validate message size is sane */
@@ -223,7 +237,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)error_report ("Failed to read msg header." " Size %d exceeds the maximum %zu." , msg->hdr.size,VHOST_USER_PAYLOAD_SIZE ); - goto fail; +return -1 ; }if (msg->hdr.size) {
@@ -233,14 +247,11 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)if (r != size) {error_report ("Failed to read msg payload." " Read %d instead of %d." , r, msg->hdr.size); - goto fail; +return -1 ; } }return 0 ; - -fail: -return -1 ; } static int process_message_reply(struct vhost_dev *dev,
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 05/12] vhost-user: split vhost_user_read()
Quoted 13 lines · Marc-André Lureau
Split
vhost_user_read(), so only header can be read withvhost_user_read_header().Signed-off-by Marc-André Lureau <[email protected]>--- hw/virtio/vhost-user.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)hw/virtio/vhost-user.c +0
-0
hw/virtio/vhost-user.c static bool ioeventfd_enabled(void) · line 199
Quoted 5 lines
hw/virtio/vhost-user.c +1
-1@@ -196,7 +196,7 @@ static bool ioeventfd_enabled(void)return kvm_enabled () &&kvm_eventfds_enabled (); } -static int vhost_user_read (struct vhost_dev *dev,VhostUserMsg *msg) +static int vhost_user_read_header (struct vhost_dev *dev,VhostUserMsg *msg)
Can this be simply:
static int vhost_user_read_header(CharBackend *chr, VhostUserMsg *msg) ?
Quoted 61 lines
hw/virtio/vhost-user.c +18
-7{struct vhost_user *u = dev->opaque;CharBackend *chr = u->chr;@@ -207,7 +207,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)if (r != size) {error_report ("Failed to read msg header. Read %d instead of %d." " Original request %d." , r, size, msg->hdr.request); - goto fail; +return -1 ; }/* validate received flags */ @@ -215,7 +215,21 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)error_report ("Failed to read msg header." " Flags 0x%x instead of 0x%x." , msg->hdr.flags,VHOST_USER_REPLY_MASK |VHOST_USER_VERSION ); - goto fail; +return -1 ; + } + +return 0 ; +} + +static int vhost_user_read (struct vhost_dev *dev,VhostUserMsg *msg) +{ +struct vhost_user *u = dev->opaque; +CharBackend *chr = u->chr; +uint8_t *p = (uint8_t *) msg; +int r, size; + +if (vhost_user_read_header (dev, msg) <0 ) { +return -1 ; }/* validate message size is sane */ @@ -223,7 +237,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)error_report ("Failed to read msg header." " Size %d exceeds the maximum %zu." , msg->hdr.size,VHOST_USER_PAYLOAD_SIZE ); - goto fail; +return -1 ; }if (msg->hdr.size) {@@ -233,14 +247,11 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)if (r != size) {error_report ("Failed to read msg payload." " Read %d instead of %d." , r, msg->hdr.size); - goto fail; +return -1 ; } }return 0 ; - -fail: -return -1 ; } static int process_message_reply(struct vhost_dev *dev,
Re: [Qemu-devel] [RFC v2 05/12] vhost-user: split vhost_user_read()
Hi
Quoted 17 lines · Philippe Mathieu-Daudé
Quoted 16 lines · Marc-André Lureau
Split
vhost_user_read(), so only header can be read withvhost_user_read_header().Signed-off-by Marc-André Lureau <[email protected]>--- hw/virtio/vhost-user.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)hw/virtio/vhost-user.c +0
-0@@ -196,7 +196,7 @@ static bool ioeventfd_enabled(void)return kvm_enabled () &&kvm_eventfds_enabled (); }
Quoted 6 lines
hw/virtio/vhost-user.c static bool ioeventfd_enabled(void) · line 199
Quoted 2 lines
hw/virtio/vhost-user.c +1
-1-static int vhost_user_read (struct vhost_dev *dev,VhostUserMsg *msg) +static int vhost_user_read_header (struct vhost_dev *dev,VhostUserMsg *msg)Can this be simply:
static int
vhost_user_read_header(CharBackend *chr, VhostUserMsg *msg)?
It's more convenient and uniform with vhost_user_read() and friends if it takes vhost_dev as argument. You can also see in patch "vhost-user:
add vhost_user_input_get_config()" that vhost_user_read_header() is called fromwithout CharBackend* as variable in the caller.
Quoted 61 lines
Quoted 61 lines
hw/virtio/vhost-user.c +18
-7{struct vhost_user *u = dev->opaque;CharBackend *chr = u->chr;@@ -207,7 +207,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)if (r != size) {error_report ("Failed to read msg header. Read %d instead of %d." " Original request %d." , r, size, msg->hdr.request); - goto fail; +return -1 ; }/* validate received flags */ @@ -215,7 +215,21 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)error_report ("Failed to read msg header." " Flags 0x%x instead of 0x%x." , msg->hdr.flags,VHOST_USER_REPLY_MASK |VHOST_USER_VERSION ); - goto fail; +return -1 ; + } + +return 0 ; +} + +static int vhost_user_read (struct vhost_dev *dev,VhostUserMsg *msg) +{ +struct vhost_user *u = dev->opaque; +CharBackend *chr = u->chr; +uint8_t *p = (uint8_t *) msg; +int r, size; + +if (vhost_user_read_header (dev, msg) <0 ) { +return -1 ; }/* validate message size is sane */ @@ -223,7 +237,7 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)error_report ("Failed to read msg header." " Size %d exceeds the maximum %zu." , msg->hdr.size,VHOST_USER_PAYLOAD_SIZE ); - goto fail; +return -1 ; }if (msg->hdr.size) {@@ -233,14 +247,11 @@ static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg)if (r != size) {error_report ("Failed to read msg payload." " Read %d instead of %d." , r, msg->hdr.size); - goto fail; +return -1 ; } }return 0 ; - -fail: -return -1 ; } static int process_message_reply(struct vhost_dev *dev,
RFC v2 6/12 vhost-user: add vhost_user_input_get_config()
In reply to Marc-André LureauAsk vhost user input backend the list of virtio_input_config.
--- include/hw/virtio/vhost-backend.h | 4 +++ hw/virtio/vhost-user.c | 59 +++++++++++++++++++++++++++++++ docs/interop/vhost-user.txt | 6 ++++ 3 files changed, 69 insertions(+)
include/hw/virtio/vhost-backend.h +4 -0
@@ -12,6 +12,7 @@#define VHOST_BACKEND_H #include "exec/memory.h" +#include "standard-headers/linux/virtio_input.h" typedef enum VhostBackendType { VHOST_BACKEND_TYPE_NONE = 0,
@@ -156,4 +157,7 @@ int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev,int vhost_backend_handle_iotlb_msg (struct vhost_dev *dev,struct vhost_iotlb_msg *imsg); +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config); +#endif /* VHOST_BACKEND_H */
hw/virtio/vhost-user.c +59 -0
71 lines not on this page · raw message
docs/interop/vhost-user.txt +6 -0
@@ -744,6 +744,12 @@ Master message types was previously sent. The value returned is an error indication; 0 is success. + * VHOST_USER_INPUT_GET_CONFIG + + Slave payload: (struct virtio_input_config)* + + Ask vhost user input backend the list of virtio_input_config. + Slave message types -------------------
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 06/12] vhost-user: add vhost_user_input_get_config()
Quoted 1 line · * Marc-André Lureau ([email protected]) wrote:
Ask vhost user input backend the list of
virtio_input_config.
Why is this vhost-user specific; shouldn't the vhost-input behaviour be the same irrespective of if it's vhost-user or plain vhost?
Dave
Quoted 125 lines
Signed-off-by Marc-André Lureau <[email protected]>--- include/hw/virtio/vhost-backend.h | 4 +++ hw/virtio/vhost-user.c | 59 +++++++++++++++++++++++++++++++ docs/interop/vhost-user.txt | 6 ++++ 3 files changed, 69 insertions(+)include/hw/virtio/vhost-backend.h +4
-0@@ -12,6 +12,7 @@#define VHOST_BACKEND_H #include "exec/memory.h" +#include "standard-headers/linux/virtio_input.h" typedef enum VhostBackendType { VHOST_BACKEND_TYPE_NONE = 0,@@ -156,4 +157,7 @@ int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev,int vhost_backend_handle_iotlb_msg (struct vhost_dev *dev,struct vhost_iotlb_msg *imsg); +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config); +#endif /* VHOST_BACKEND_H */ hw/virtio/vhost-user.c +59
-0@@ -84,6 +84,7 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_ADVISE =28 ,VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 , +VHOST_USER_INPUT_GET_CONFIG , VHOST_USER_MAX } VhostUserRequest;@@ -324,6 +325,64 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg,return 0 ; } +static void *vhost_user_read_size (struct vhost_dev *dev,uint32_t size) +{ +struct vhost_user *u = dev->opaque; +CharBackend *chr = u->chr; +int r; +uint8_t *p =g_malloc (size); + + r =qemu_chr_fe_read_all (chr, p, size); +if (r != size) { +error_report ("Failed to read msg payload." +" Read %d instead of %d." , r, size); +return NULL ; + } + +return p; +} + +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config) +{ +void *p =NULL ; +VhostUserMsg msg = { + .hdr.request =VHOST_USER_INPUT_GET_CONFIG , + .hdr.flags =VHOST_USER_VERSION , + }; + +if (vhost_user_write (dev, &msg,NULL ,0 ) <0 ) { + goto err; + } + +if (vhost_user_read_header (dev, &msg) <0 ) { + goto err; + } + + p =vhost_user_read_size (dev, msg.hdr.size); +if (!p) { + goto err; + } + +if (msg.hdr.request !=VHOST_USER_INPUT_GET_CONFIG ) { +error_report ("Received unexpected msg type. Expected %d received %d" , +VHOST_USER_INPUT_GET_CONFIG , msg.hdr.request); + goto err; + } + +if (msg.hdr.size %sizeof (struct virtio_input_config )) { +error_report ("Invalid msg size" ); + goto err; + } + + *config = p; +return msg.hdr.size /sizeof (struct virtio_input_config ); + +err: +g_free (p); +return -1 ; +} +static int vhost_user_set_log_base (struct vhost_dev *dev,uint64_t base,struct vhost_log *log) {docs/interop/vhost-user.txt +6
-0@@ -744,6 +744,12 @@ Master message types was previously sent. The value returned is an error indication; 0 is success. + * VHOST_USER_INPUT_GET_CONFIG + + Slave payload: (struct virtio_input_config)* + + Ask vhost user input backend the list of virtio_input_config. + Slave message types -------------------Signature · 1 line
2.17.1.906.g10fd178552
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [Qemu-devel] [RFC v2 06/12] vhost-user: add vhost_user_input_get_config()
Hi
Quoted 6 lines · Dr. David Alan Gilbert
Quoted 1 line · * Marc-André Lureau ([email protected]) wrote:
Ask vhost user input backend the list of
virtio_input_config.Why is this vhost-user specific; shouldn't the vhost-input behaviour be the same irrespective of if it's vhost-user or plain vhost?
A similar message could be used for plain vhost, in some ioctl form. Here we are documenting vhost-user protocol only.
Thanks
Quoted 130 lines
Dave
Quoted 122 lines
Signed-off-by Marc-André Lureau <[email protected]>--- include/hw/virtio/vhost-backend.h | 4 +++ hw/virtio/vhost-user.c | 59 +++++++++++++++++++++++++++++++ docs/interop/vhost-user.txt | 6 ++++ 3 files changed, 69 insertions(+)include/hw/virtio/vhost-backend.h +4
-0@@ -12,6 +12,7 @@#define VHOST_BACKEND_H #include "exec/memory.h" +#include "standard-headers/linux/virtio_input.h" typedef enum VhostBackendType { VHOST_BACKEND_TYPE_NONE = 0,@@ -156,4 +157,7 @@ int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev,int vhost_backend_handle_iotlb_msg (struct vhost_dev *dev,struct vhost_iotlb_msg *imsg); +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config); +#endif /* VHOST_BACKEND_H */ hw/virtio/vhost-user.c +59
-0@@ -84,6 +84,7 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_ADVISE =28 ,VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 , +VHOST_USER_INPUT_GET_CONFIG , VHOST_USER_MAX } VhostUserRequest;@@ -324,6 +325,64 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg,return 0 ; } +static void *vhost_user_read_size (struct vhost_dev *dev,uint32_t size) +{ +struct vhost_user *u = dev->opaque; +CharBackend *chr = u->chr; +int r; +uint8_t *p =g_malloc (size); + + r =qemu_chr_fe_read_all (chr, p, size); +if (r != size) { +error_report ("Failed to read msg payload." +" Read %d instead of %d." , r, size); +return NULL ; + } + +return p; +} + +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config) +{ +void *p =NULL ; +VhostUserMsg msg = { + .hdr.request =VHOST_USER_INPUT_GET_CONFIG , + .hdr.flags =VHOST_USER_VERSION , + }; + +if (vhost_user_write (dev, &msg,NULL ,0 ) <0 ) { + goto err; + } + +if (vhost_user_read_header (dev, &msg) <0 ) { + goto err; + } + + p =vhost_user_read_size (dev, msg.hdr.size); +if (!p) { + goto err; + } + +if (msg.hdr.request !=VHOST_USER_INPUT_GET_CONFIG ) { +error_report ("Received unexpected msg type. Expected %d received %d" , +VHOST_USER_INPUT_GET_CONFIG , msg.hdr.request); + goto err; + } + +if (msg.hdr.size %sizeof (struct virtio_input_config )) { +error_report ("Invalid msg size" ); + goto err; + } + + *config = p; +return msg.hdr.size /sizeof (struct virtio_input_config ); + +err: +g_free (p); +return -1 ; +} +static int vhost_user_set_log_base (struct vhost_dev *dev,uint64_t base,struct vhost_log *log) {docs/interop/vhost-user.txt +6
-1@@ -744,6 +744,12 @@ Master message types was previously sent. The value returned is an error indication; 0 is success. + * VHOST_USER_INPUT_GET_CONFIG + + Slave payload: (struct virtio_input_config)* + + Ask vhost user input backend the list of virtio_input_config. + Slave message types ------------------- --Quoted 3 lines
2.17.1.906.g10fd178552
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [Qemu-devel] [RFC v2 06/12] vhost-user: add vhost_user_input_get_config()
Quoted 5 lines · * Marc-André Lureau ([email protected]) wrote:
Hi
Quoted 1 line · Dr. David Alan Gilbert
* Marc-André Lureau ([email protected]) wrote:
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Ask vhost user input backend the list of
virtio_input_config.Why is this vhost-user specific; shouldn't the vhost-input behaviour be the same irrespective of if it's vhost-user or plain vhost?
A similar message could be used for plain vhost, in some ioctl form. Here we are documenting vhost-user protocol only.
The vhost-user protocol seems to be mostly independent of the device it's carrying; for example I see there's a 'net_set_mtu' and 'send_rarp' but I don't think there's anything for disk storage; what are the cases whether these have to be done through a change to the vhost-user protocol as opposed to stuff carried over it?
Dave
Quoted 133 lines
Thanks
Quoted 130 lines
Dave
Quoted 122 lines
Signed-off-by Marc-André Lureau <[email protected]>--- include/hw/virtio/vhost-backend.h | 4 +++ hw/virtio/vhost-user.c | 59 +++++++++++++++++++++++++++++++ docs/interop/vhost-user.txt | 6 ++++ 3 files changed, 69 insertions(+)include/hw/virtio/vhost-backend.h +4
-0@@ -12,6 +12,7 @@#define VHOST_BACKEND_H #include "exec/memory.h" +#include "standard-headers/linux/virtio_input.h" typedef enum VhostBackendType { VHOST_BACKEND_TYPE_NONE = 0,@@ -156,4 +157,7 @@ int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev,int vhost_backend_handle_iotlb_msg (struct vhost_dev *dev,struct vhost_iotlb_msg *imsg); +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config); +#endif /* VHOST_BACKEND_H */ hw/virtio/vhost-user.c +59
-0@@ -84,6 +84,7 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_ADVISE =28 ,VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 , +VHOST_USER_INPUT_GET_CONFIG , VHOST_USER_MAX } VhostUserRequest;@@ -324,6 +325,64 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg,return 0 ; } +static void *vhost_user_read_size (struct vhost_dev *dev,uint32_t size) +{ +struct vhost_user *u = dev->opaque; +CharBackend *chr = u->chr; +int r; +uint8_t *p =g_malloc (size); + + r =qemu_chr_fe_read_all (chr, p, size); +if (r != size) { +error_report ("Failed to read msg payload." +" Read %d instead of %d." , r, size); +return NULL ; + } + +return p; +} + +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config) +{ +void *p =NULL ; +VhostUserMsg msg = { + .hdr.request =VHOST_USER_INPUT_GET_CONFIG , + .hdr.flags =VHOST_USER_VERSION , + }; + +if (vhost_user_write (dev, &msg,NULL ,0 ) <0 ) { + goto err; + } + +if (vhost_user_read_header (dev, &msg) <0 ) { + goto err; + } + + p =vhost_user_read_size (dev, msg.hdr.size); +if (!p) { + goto err; + } + +if (msg.hdr.request !=VHOST_USER_INPUT_GET_CONFIG ) { +error_report ("Received unexpected msg type. Expected %d received %d" , +VHOST_USER_INPUT_GET_CONFIG , msg.hdr.request); + goto err; + } + +if (msg.hdr.size %sizeof (struct virtio_input_config )) { +error_report ("Invalid msg size" ); + goto err; + } + + *config = p; +return msg.hdr.size /sizeof (struct virtio_input_config ); + +err: +g_free (p); +return -1 ; +} +static int vhost_user_set_log_base (struct vhost_dev *dev,uint64_t base,struct vhost_log *log) {docs/interop/vhost-user.txt +6
-1@@ -744,6 +744,12 @@ Master message types was previously sent. The value returned is an error indication; 0 is success. + * VHOST_USER_INPUT_GET_CONFIG + + Slave payload: (struct virtio_input_config)* + + Ask vhost user input backend the list of virtio_input_config. + Slave message types ------------------- --Quoted 3 lines
2.17.1.906.g10fd178552
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
Re: [Qemu-devel] [RFC v2 06/12] vhost-user: add vhost_user_input_get_config()
Hi
Quoted 12 lines · Dr. David Alan Gilbert
Quoted 11 lines · * Marc-André Lureau ([email protected]) wrote:
Hi
Quoted 6 lines · Dr. David Alan Gilbert
Quoted 1 line · * Marc-André Lureau ([email protected]) wrote:
Ask vhost user input backend the list of
virtio_input_config.Why is this vhost-user specific; shouldn't the vhost-input behaviour be the same irrespective of if it's vhost-user or plain vhost?
Quoted 8 lines
Quoted 2 lines
A similar message could be used for plain vhost, in some ioctl form. Here we are documenting vhost-user protocol only.
The vhost-user protocol seems to be mostly independent of the device it's carrying; for example I see there's a '
net_set_mtu' and 'send_rarp' but I don't think there's anything for disk storage; what are the cases whether these have to be done through a change to the vhost-user protocol as opposed to stuff carried over it?
It's necessary for whatever is out-of-band, like configuring the device, notifying of device/qemu events,... Thanks to virtio design, most of the messages are generic. But some of them are more specific (like here for input config, or later to hand over the gpu socket). The gpu socket/channel/protocol is seperated from "main" vhost-user protocol, because it's quite orthogonal to virtio/vhost: it's only used for the gpu/display updates, and it's driven by the backend.
I hope that answer your question.
Quoted 137 lines
Dave
Quoted 133 lines
Thanks
Quoted 130 lines
Dave
Quoted 122 lines
Signed-off-by Marc-André Lureau <[email protected]>--- include/hw/virtio/vhost-backend.h | 4 +++ hw/virtio/vhost-user.c | 59 +++++++++++++++++++++++++++++++ docs/interop/vhost-user.txt | 6 ++++ 3 files changed, 69 insertions(+)include/hw/virtio/vhost-backend.h +4
-0@@ -12,6 +12,7 @@#define VHOST_BACKEND_H #include "exec/memory.h" +#include "standard-headers/linux/virtio_input.h" typedef enum VhostBackendType { VHOST_BACKEND_TYPE_NONE = 0,@@ -156,4 +157,7 @@ int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev,int vhost_backend_handle_iotlb_msg (struct vhost_dev *dev,struct vhost_iotlb_msg *imsg); +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config); +#endif /* VHOST_BACKEND_H */ hw/virtio/vhost-user.c +59
-0@@ -84,6 +84,7 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_ADVISE =28 ,VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 , +VHOST_USER_INPUT_GET_CONFIG , VHOST_USER_MAX } VhostUserRequest;@@ -324,6 +325,64 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg,return 0 ; } +static void *vhost_user_read_size (struct vhost_dev *dev,uint32_t size) +{ +struct vhost_user *u = dev->opaque; +CharBackend *chr = u->chr; +int r; +uint8_t *p =g_malloc (size); + + r =qemu_chr_fe_read_all (chr, p, size); +if (r != size) { +error_report ("Failed to read msg payload." +" Read %d instead of %d." , r, size); +return NULL ; + } + +return p; +} + +int vhost_user_input_get_config (struct vhost_dev *dev, +struct virtio_input_config **config) +{ +void *p =NULL ; +VhostUserMsg msg = { + .hdr.request =VHOST_USER_INPUT_GET_CONFIG , + .hdr.flags =VHOST_USER_VERSION , + }; + +if (vhost_user_write (dev, &msg,NULL ,0 ) <0 ) { + goto err; + } + +if (vhost_user_read_header (dev, &msg) <0 ) { + goto err; + } + + p =vhost_user_read_size (dev, msg.hdr.size); +if (!p) { + goto err; + } + +if (msg.hdr.request !=VHOST_USER_INPUT_GET_CONFIG ) { +error_report ("Received unexpected msg type. Expected %d received %d" , +VHOST_USER_INPUT_GET_CONFIG , msg.hdr.request); + goto err; + } + +if (msg.hdr.size %sizeof (struct virtio_input_config )) { +error_report ("Invalid msg size" ); + goto err; + } + + *config = p; +return msg.hdr.size /sizeof (struct virtio_input_config ); + +err: +g_free (p); +return -1 ; +} +static int vhost_user_set_log_base (struct vhost_dev *dev,uint64_t base,struct vhost_log *log) {docs/interop/vhost-user.txt +6
-1@@ -744,6 +744,12 @@ Master message types was previously sent. The value returned is an error indication; 0 is success. + * VHOST_USER_INPUT_GET_CONFIG + + Slave payload: (struct virtio_input_config)* + + Ask vhost user input backend the list of virtio_input_config. + Slave message types ------------------- --Quoted 3 lines
2.17.1.906.g10fd178552
--
Dr. David Alan Gilbert / [email protected] / Manchester, UK--
Dr. David Alan Gilbert / [email protected] / Manchester, UK
RFC v2 7/12 libvhost-user: export vug_source_new
In reply to Marc-André LureauSimplify the creation of FD sources for other users.
--- contrib/libvhost-user/libvhost-user-glib.h | 3 +++ contrib/libvhost-user/libvhost-user-glib.c | 15 +++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-)
contrib/libvhost-user/libvhost-user-glib.h +3 -0
@@ -29,4 +29,7 @@ void vug_init(VugDev *dev, int socket, vu_panic_cb panic, const VuDevIface *iface);void vug_deinit (VugDev *dev); +GSource *vug_source_new (VugDev *dev,int fd,GIOCondition cond, +vu_watch_cb vu_cb,gpointer data); +#endif /* LIBVHOST_USER_GLIB_H */
contrib/libvhost-user/libvhost-user-glib.c +11 -4
@@ -69,8 +69,8 @@ static GSourceFuncs vug_src_funcs = { };static GSource * -vug_source_new (VuDev *dev,int fd,GIOCondition cond, -vu_watch_cb vu_cb,gpointer data) +_vug_source_new (VuDev *dev,int fd,GIOCondition cond, +vu_watch_cb vu_cb,gpointer data) {GSource *gsrc;VugSrc *src;
@@ -95,6 +95,13 @@ vug_source_new(VuDev *dev, int fd, GIOCondition cond,return gsrc; } +GSource * +vug_source_new (VugDev *dev,int fd,GIOCondition cond, +vu_watch_cb vu_cb,gpointer data) +{ +return _vug_source_new (&dev->parent, fd, cond, vu_cb, data); +} +static void set_watch (VuDev *vu_dev,int fd,int vu_evt,vu_watch_cb cb,void *pvt) {
@@ -106,7 +113,7 @@ set_watch(VuDev *vu_dev, int fd, int vu_evt, vu_watch_cb cb, void *pvt)g_assert (cb); dev =container_of (vu_dev, VugDev, parent); - src =vug_source_new (vu_dev, fd, vu_evt, cb, pvt); + src =_vug_source_new (vu_dev, fd, vu_evt, cb, pvt);g_hash_table_replace (dev->fdmap,GINT_TO_POINTER (fd), src); }
@@ -141,7 +148,7 @@ vug_init(VugDev *dev, int socket, dev->fdmap =g_hash_table_new_full (NULL ,NULL ,NULL , (GDestroyNotify ) g_source_destroy); - dev->src =vug_source_new (&dev->parent, socket,G_IO_IN , vug_watch,NULL ); + dev->src =_vug_source_new (&dev->parent, socket,G_IO_IN , vug_watch,NULL ); }void
Signature · 1 line
2.17.1.906.g10fd178552
RFC v2 8/12 contrib: add vhost-user-input
In reply to Marc-André LureauAdd a vhost-user input backend example, based on virtio-input-host device. It takes an evdev path as argument, and can be associated with a vhost-user-backend object, ex:
-object vhost-user-backend,id=vuid,cmd="vhost-user-input /dev/input/event0"
--- contrib/libvhost-user/libvhost-user.h | 1 + contrib/vhost-user-input/main.c | 358 +++++++++++++++++++++++++ Makefile | 3 + Makefile.objs | 1 + configure | 1 + contrib/vhost-user-input/Makefile.objs | 1 + 6 files changed, 365 insertions(+) create mode 100644 contrib/vhost-user-input/main.c create mode 100644 contrib/vhost-user-input/Makefile.objs
contrib/libvhost-user/libvhost-user.h +1 -0
@@ -89,6 +89,7 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_ADVISE =28 ,VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 , +VHOST_USER_INPUT_GET_CONFIG , VHOST_USER_MAX } VhostUserRequest;
contrib/vhost-user-input/main.c new file +358 -0
358 lines not on this page · raw message
Makefile +3 -0
@@ -420,6 +420,7 @@ dummy := $(call unnest-vars,, \ libvhost-user-obj-y \ vhost-user-scsi-obj-y \ vhost-user-blk-obj-y \ + vhost-user-input-obj-y \ qga-vss-dll-obj-y \ block-obj-y \ block-obj-m \
@@ -719,6 +720,8 @@ vhost-user-scsi$(EXESUF): $(vhost-user-scsi-obj-y) libvhost-user.a $(call LINK, $^) vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) libvhost-user.a $(call LINK, $^) +vhost-user-input$(EXESUF): $(vhost-user-input-obj-y) libvhost-user.a libqemuutil.a + $(call LINK, $^) module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak $(call quiet-command,$(PYTHON) $< $@ \
Makefile.objs +1 -0
@@ -193,6 +193,7 @@ vhost-user-scsi.o-cflags := $(LIBISCSI_CFLAGS) vhost-user-scsi.o-libs := $(LIBISCSI_LIBS) vhost-user-scsi-obj-y = contrib/vhost-user-scsi/ vhost-user-blk-obj-y = contrib/vhost-user-blk/ +vhost-user-input-obj-y = contrib/vhost-user-input/ ###################################################################### trace-events-subdirs =
configure +1 -0
@@ -5532,6 +5532,7 @@ if test "$want_tools" = "yes" ; then fi if [ "$ivshmem" = "yes" ]; then tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools" + tools="vhost-user-input\$(EXESUF) $tools" fi fi if test "$softmmu" = yes ; then
contrib/vhost-user-input/Makefile.objs new file +1 -0
@@ -0,0 +1 @@ +vhost-user-input-obj-y = main.o
Signature · 1 line
2.17.1.906.g10fd178552
RFC v2 9/12 Add vhost-input-pci
In reply to Marc-André LureauUse a vhost-user input backend. Usage:
-object vhost-user-backend,id=vuid -device vhost-input-pci,vhost-user=vuid
--- hw/virtio/virtio-pci.h | 10 +++ include/hw/virtio/virtio-input.h | 14 ++++ hw/input/vhost-user-input.c | 124 +++++++++++++++++++++++++++++++ hw/virtio/virtio-pci.c | 20 +++++ MAINTAINERS | 1 + hw/input/Makefile.objs | 1 + 6 files changed, 170 insertions(+) create mode 100644 hw/input/vhost-user-input.c
hw/virtio/virtio-pci.h +10 -0
@@ -54,6 +54,7 @@ typedef struct VirtIORngPCI VirtIORngPCI;typedef struct VirtIOInputPCI VirtIOInputPCI ;typedef struct VirtIOInputHIDPCI VirtIOInputHIDPCI ;typedef struct VirtIOInputHostPCI VirtIOInputHostPCI ; +typedef struct VHostUserInputPCI VHostUserInputPCI ;typedef struct VirtIOGPUPCI VirtIOGPUPCI ;typedef struct VHostVSockPCI VHostVSockPCI ;typedef struct VirtIOCryptoPCI VirtIOCryptoPCI ;
@@ -376,6 +377,15 @@ struct VirtIOInputHostPCI {#endif +#define TYPE_VHOST_USER_INPUT_PCI "vhost-user-input-pci" +#define VHOST_USER_INPUT_PCI (obj) \ + OBJECT_CHECK(VHostUserInputPCI, (obj), TYPE_VHOST_USER_INPUT_PCI) + +struct VHostUserInputPCI { +VirtIOPCIProxy parent_obj; +VHostUserInput vhi; +}; +/* * virtio-gpu-pci: This extends VirtioPCIProxy. */
include/hw/virtio/virtio-input.h +14 -0
@@ -2,6 +2,7 @@#define QEMU_VIRTIO_INPUT_H #include "ui/input.h" +#include "sysemu/vhost-user-backend.h" /* ----------------------------------------------------------------- */ /* virtio input protocol */
@@ -42,11 +43,18 @@ typedef struct virtio_input_event virtio_input_event;#define VIRTIO_INPUT_HOST_GET_PARENT_CLASS (obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HOST) +#define TYPE_VHOST_USER_INPUT "vhost-user-input" +#define VHOST_USER_INPUT (obj) \ + OBJECT_CHECK(VHostUserInput, (obj), TYPE_VHOST_USER_INPUT) +#define VHOST_USER_INPUT_GET_PARENT_CLASS (obj) \ + OBJECT_GET_PARENT_CLASS(obj, TYPE_VHOST_USER_INPUT) +typedef struct VirtIOInput VirtIOInput ;typedef struct VirtIOInputClass VirtIOInputClass ;typedef struct VirtIOInputConfig VirtIOInputConfig ;typedef struct VirtIOInputHID VirtIOInputHID ;typedef struct VirtIOInputHost VirtIOInputHost ; +typedef struct VHostUserInput VHostUserInput ;struct VirtIOInputConfig {virtio_input_config config;
@@ -98,6 +106,12 @@ struct VirtIOInputHost {int fd; }; +struct VHostUserInput { +VirtIOInput parent_obj; + +VhostUserBackend *vhost; +}; +void virtio_input_send (VirtIOInput *vinput,virtio_input_event *event);void virtio_input_init_config (VirtIOInput *vinput,virtio_input_config *config);
hw/input/vhost-user-input.c new file +124 -0
124 lines not on this page · raw message
hw/virtio/virtio-pci.c +20 -0
@@ -2646,6 +2646,25 @@ static const TypeInfo virtio_host_pci_info = { };#endif +static void vhost_input_pci_initfn (Object *obj) +{ +VHostUserInputPCI *dev =VHOST_USER_INPUT_PCI (obj); + +virtio_instance_init_common (obj, &dev->vhi,sizeof (dev->vhi), +TYPE_VHOST_USER_INPUT ); + +object_property_add_alias (obj,"vhost-user" , +OBJECT (&dev->vhi),"vhost-user" , + &error_abort); +} + +static const TypeInfo vhost_input_pci_info = { + .name =TYPE_VHOST_USER_INPUT_PCI , + .parent =TYPE_VIRTIO_INPUT_PCI , + .instance_size =sizeof (VHostUserInputPCI), + .instance_init = vhost_input_pci_initfn, +}; +/* virtio-pci-bus */ static void virtio_pci_bus_new(VirtioBusState *bus, size_t bus_size,
@@ -2702,6 +2721,7 @@ static void virtio_pci_register_types(void)#ifdef CONFIG_LINUX type_register_static (&virtio_host_pci_info);#endif +type_register_static (&vhost_input_pci_info);type_register_static (&virtio_pci_bus_info);type_register_static (&virtio_pci_info);#ifdef CONFIG_VIRTFS
MAINTAINERS +1 -0
@@ -1202,6 +1202,7 @@ L: [email protected] virtio-input M: Gerd Hoffmann <[email protected]> S: Maintained +F: hw/input/vhost-user-input.c F: hw/input/virtio-input*.c F: include/hw/virtio/virtio-input.h
hw/input/Makefile.objs +1 -0
@@ -12,6 +12,7 @@ common-obj-$(CONFIG_VIRTIO) += virtio-input-hid.o ifeq ($(CONFIG_LINUX),y) common-obj-$(CONFIG_VIRTIO) += virtio-input-host.o endif +common-obj-$(CONFIG_VIRTIO) += vhost-user-input.o obj-$(CONFIG_MILKYMIST) += milkymist-softusb.o obj-$(CONFIG_PXA2XX) += pxa2xx_keypad.o
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 09/12] Add vhost-input-pci
Quoted 1 line
+#define
TYPE_VHOST_USER_INPUT_PCI"vhost-user-input-pci"
Patch $subject mismatch.
include/hw/virtio/virtio-input.h struct VirtIOInputHost { · line 113
Quoted 5 lines
include/hw/virtio/virtio-input.h +5
-0+struct VHostUserInput { +VirtIOInput parent_obj; + +VhostUserBackend *vhost; +};
Nothing input specific here ...
Quoted 4 lines
hw/input/vhost-user-input.c new file +4
-0+static void vhost_input_change_active (VirtIOInput *vinput) +{ +VHostUserInput *vhi =VHOST_USER_INPUT (vinput); +
hw/input/vhost-user-input.c line 66
Quoted 10 lines
hw/input/vhost-user-input.c new file +10
-0+if (!vhi->vhost) { +return ; + } + +if (vinput->active) { +vhost_user_backend_start (vhi->vhost); + }else { +vhost_user_backend_stop (vhi->vhost); + } +}
... and here ...
hw/input/vhost-user-input.c line 71
Quoted 4 lines
hw/input/vhost-user-input.c new file +4
-0+static const VMStateDescription vmstate_vhost_input = { + .name ="vhost-user-input" , + .unmigratable =1 , +};
... and here ...
hw/input/vhost-user-input.c line 93
Quoted 11 lines
hw/input/vhost-user-input.c new file +11
-0+static void vhost_input_is_busy (const Object *obj,const char *name, +Object *val,Error **errp) +{ +VHostUserInput *vhi =VHOST_USER_INPUT (obj); + +if (vhi->vhost) { +error_setg (errp,"can't use already busy vhost-user" ); + }else { +qdev_prop_allow_set_link_before_realize (obj, name, val, errp); + } +}
... likewise ...
So, maybe it makes sense to have a abstact base class for vhost-user devices? And possibly move the vhost-backend code to the base class then?
cheers,
Gerd
Re: [Qemu-devel] [RFC v2 09/12] Add vhost-input-pci
Hi
Quoted 11 lines · Gerd Hoffmann
Quoted 1 line
+#define
TYPE_VHOST_USER_INPUT_PCI"vhost-user-input-pci"Patch $subject mismatch.
include/hw/virtio/virtio-input.h struct VirtIOInputHost { · line 113
Quoted 5 lines
include/hw/virtio/virtio-input.h +5
-0+struct VHostUserInput { +VirtIOInput parent_obj; + +VhostUserBackend *vhost; +};Nothing input specific here ...
Except VirtIOInput
Quoted 17 lines
Quoted 5 lines
hw/input/vhost-user-input.c new file +4
-0+static void vhost_input_change_active (VirtIOInput *vinput) +{ +VHostUserInput *vhi =VHOST_USER_INPUT (vinput); +hw/input/vhost-user-input.c line 66
Quoted 10 lines
hw/input/vhost-user-input.c new file +10
-0+if (!vhi->vhost) { +return ; + } + +if (vinput->active) { +vhost_user_backend_start (vhi->vhost); + }else { +vhost_user_backend_stop (vhi->vhost); + } +}... and here ...
Except it's a VirtIOInputClass callback
Quoted 22 lines
hw/input/vhost-user-input.c line 71
Quoted 5 lines
hw/input/vhost-user-input.c new file +4
-0+static const VMStateDescription vmstate_vhost_input = { + .name ="vhost-user-input" , + .unmigratable =1 , +};... and here ...
hw/input/vhost-user-input.c line 93
Quoted 11 lines
hw/input/vhost-user-input.c new file +11
-0+static void vhost_input_is_busy (const Object *obj,const char *name, +Object *val,Error **errp) +{ +VHostUserInput *vhi =VHOST_USER_INPUT (obj); + +if (vhi->vhost) { +error_setg (errp,"can't use already busy vhost-user" ); + }else { +qdev_prop_allow_set_link_before_realize (obj, name, val, errp); + } +}... likewise ...
Quoted 3 lines
So, maybe it makes sense to have a abstact base class for vhost-user devices? And possibly move the vhost-backend code to the base class then?
The device inherits from virtio-input type. So we could somehow not expose -object vhost-user and instead have internal vhost-user object & properties aliased & duplicated on each -device vhost-user*. I would rather keep the -object solution, since it's somehow cleaner, more flexible and simpler to document that way. Or do you have a better idea?
Signature · 1 line
Marc-André Lureau
Re: [Qemu-devel] [RFC v2 09/12] Add vhost-input-pci
Quoted 15 lines · Marc-André Lureau
Hi
Quoted 11 lines · Gerd Hoffmann
Quoted 1 line
+#define
TYPE_VHOST_USER_INPUT_PCI"vhost-user-input-pci"Patch $subject mismatch.
include/hw/virtio/virtio-input.h struct VirtIOInputHost { · line 113
Quoted 5 lines
include/hw/virtio/virtio-input.h +5
-0+struct VHostUserInput { +VirtIOInput parent_obj; + +VhostUserBackend *vhost; +};Nothing input specific here ...
Quoted 1 line
Except VirtIOInput
Oops, missed that. Scratch the idea then.
cheers,
Gerd
RFC v2 10/12 vhost-user: add vhost_user_gpu_set_socket()
In reply to Marc-André LureauAdd a new vhost-user message to give a unix socket for gpu updates to a vhost-user backend.
Back when I started that work, I added a new GPU channel because the vhost-user protocol wasn't bidirectional. Since then, there is a vhost-user-slave channel for the slave to send requests to the master. We could extend it with GPU messages. However, the GPU protocol is quite orthogonal to vhost-user and may not need the same kind of stability guarantees, thus I recommend to have a new dedicated channel.
FIXME: document the GPU protocol.
--- contrib/libvhost-user/libvhost-user.h | 1 + include/hw/virtio/vhost-backend.h | 1 + hw/virtio/vhost-user.c | 11 +++++++++++ 3 files changed, 13 insertions(+)
contrib/libvhost-user/libvhost-user.h +1 -0
@@ -90,6 +90,7 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 ,VHOST_USER_INPUT_GET_CONFIG , +VHOST_USER_GPU_SET_SOCKET , VHOST_USER_MAX } VhostUserRequest;
include/hw/virtio/vhost-backend.h +1 -0
@@ -159,5 +159,6 @@ int vhost_backend_handle_iotlb_msg(struct vhost_dev *dev,int vhost_user_input_get_config (struct vhost_dev *dev,struct virtio_input_config **config); +int vhost_user_gpu_set_socket (struct vhost_dev *dev,int fd);#endif /* VHOST_BACKEND_H */
hw/virtio/vhost-user.c +11 -0
@@ -85,6 +85,7 @@ typedef enum VhostUserRequest {VHOST_USER_POSTCOPY_LISTEN =29 ,VHOST_USER_POSTCOPY_END =30 ,VHOST_USER_INPUT_GET_CONFIG , +VHOST_USER_GPU_SET_SOCKET , VHOST_USER_MAX } VhostUserRequest;
@@ -383,6 +384,16 @@ err:return -1 ; } +int vhost_user_gpu_set_socket (struct vhost_dev *dev,int fd) +{ +VhostUserMsg msg = { + .hdr.request =VHOST_USER_GPU_SET_SOCKET , + .hdr.flags =VHOST_USER_VERSION , + }; + +return vhost_user_write (dev, &msg, &fd,1 ); +} +static int vhost_user_set_log_base (struct vhost_dev *dev,uint64_t base,struct vhost_log *log) {
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 10/12] vhost-user: add vhost_user_gpu_set_socket()
Quoted 8 lines · Marc-André Lureau
Add a new vhost-user message to give a unix socket for gpu updates to a vhost-user backend.
Back when I started that work, I added a new GPU channel because the vhost-user protocol wasn't bidirectional. Since then, there is a vhost-user-slave channel for the slave to send requests to the master. We could extend it with GPU messages. However, the GPU protocol is quite orthogonal to vhost-user
Yes.
Quoted 2 lines
and may not need the same kind of
stability guarantees,
Why?
Quoted 4 lines
thus I recommend to have a new dedicated
channel.FIXME: document the GPU protocol.
Yes, please.
cheers,
Gerd
RFC v2 11/12 Add virtio-gpu vhost-user backend
In reply to Marc-André LureauAdd to virtio-gpu devices a "vhost-user" property. When set, the associated vhost-user backend is used to handle the virtio rings.
For now, a socketpair is created for the backend to share the rendering results with qemu via a simple VHOST_GPU protocol.
Example usage:
-object vhost-user-backend,id=vug,cmd="./vhost-user-gpu" -device virtio-vga,virgl=true,vhost-user=vug
--- include/hw/virtio/virtio-gpu.h | 9 + include/ui/console.h | 1 + hw/display/vhost-gpu.c | 290 +++++++++++++++++++++++++++++++++ hw/display/virtio-gpu-3d.c | 8 +- hw/display/virtio-gpu-pci.c | 5 + hw/display/virtio-gpu.c | 77 ++++++++- hw/display/virtio-vga.c | 5 + ui/spice-display.c | 3 +- hw/display/Makefile.objs | 2 +- 9 files changed, 393 insertions(+), 7 deletions(-) create mode 100644 hw/display/vhost-gpu.c
include/hw/virtio/virtio-gpu.h +9 -0
@@ -19,6 +19,7 @@#include "ui/console.h" #include "hw/virtio/virtio.h" #include "qemu/log.h" +#include "sysemu/vhost-user-backend.h" #include "standard-headers/linux/virtio_gpu.h" #define TYPE_VIRTIO_GPU "virtio-gpu-device"
@@ -88,6 +89,9 @@ struct virtio_gpu_ctrl_command { typedef struct VirtIOGPU { VirtIODevice parent_obj; + VhostUserBackend *vhost; + CharBackend vhost_chr; + QEMUBH *ctrl_bh; QEMUBH *cursor_bh; VirtQueue *ctrl_vq;
@@ -103,6 +107,7 @@ typedef struct VirtIOGPU { QTAILQ_HEAD(, virtio_gpu_ctrl_command) fenceq;struct virtio_gpu_scanout scanout[VIRTIO_GPU_MAX_SCANOUTS ]; +QemuDmaBuf dmabuf[VIRTIO_GPU_MAX_SCANOUTS ];struct virtio_gpu_requested_state req_state[VIRTIO_GPU_MAX_SCANOUTS ];struct virtio_gpu_conf conf;
@@ -171,4 +176,8 @@ void virtio_gpu_virgl_reset(VirtIOGPU *g);void virtio_gpu_gl_block (void *opaque,bool block);int virtio_gpu_virgl_init (VirtIOGPU *g);int virtio_gpu_virgl_get_num_capsets (VirtIOGPU *g); + +/* vhost-gpu.c */ +int vhost_gpu_init (VirtIOGPU *g,Error **errp); +#endif
include/ui/console.h +1 -0
@@ -186,6 +186,7 @@ struct QemuDmaBuf {uint32_t stride;uint32_t fourcc;uint32_t texture; +bool y0_top; }; typedef struct DisplayChangeListenerOps {
hw/display/vhost-gpu.c new file +290 -0
290 lines not on this page · raw message
hw/display/virtio-gpu-3d.c +6 -2
@@ -614,9 +614,13 @@ void virtio_gpu_gl_block(void *opaque, bool block) g->renderer_blocked--; }assert (g->renderer_blocked >=0 ); -if (g->renderer_blocked ==0 ) { -virtio_gpu_process_cmdq (g); +if (g->vhost && g->enable) { +uint32_t ok;/*unblock renderer */ +qemu_chr_fe_write (&g->vhost_chr, (uint8_t *)&ok,sizeof (ok)); + }else { +virtio_gpu_process_cmdq (g); + } } }
hw/display/virtio-gpu-pci.c +5 -0
@@ -18,6 +18,7 @@#include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-pci.h" #include "hw/virtio/virtio-gpu.h" +#include "qapi/error.h" static Property virtio_gpu_pci_properties[] = {DEFINE_VIRTIO_GPU_PCI_PROPERTIES (VirtIOPCIProxy),
@@ -67,6 +68,10 @@ static void virtio_gpu_initfn(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VIRTIO_GPU ); + +object_property_add_alias (obj,"vhost-user" , +OBJECT (&dev->vdev),"vhost-user" , + &error_abort); }static const TypeInfo virtio_gpu_pci_info = {
hw/display/virtio-gpu.c +74 -3
124 lines not on this page · raw message
hw/display/virtio-vga.c +5 -0
@@ -201,6 +201,11 @@ static void virtio_vga_inst_initfn(Object *obj)virtio_instance_init_common (obj, &dev->vdev,sizeof (dev->vdev),TYPE_VIRTIO_GPU ); + +/* could eventually be included in qdev_alias_all_properties? */ +object_property_add_alias (obj,"vhost-user" , +OBJECT (&dev->vdev),"vhost-user" , + &error_abort); }static TypeInfo virtio_vga_info = {
ui/spice-display.c +2 -1
@@ -1048,7 +1048,8 @@ static void qemu_spice_gl_update(DisplayChangeListener *dcl,/* note: spice server will close the fd, so hand over a dup */ spice_qxl_gl_scanout (&ssd->qxl,dup (dmabuf->fd), dmabuf->width, dmabuf->height, - dmabuf->stride, dmabuf->fourcc, false); + dmabuf->stride, dmabuf->fourcc, + dmabuf->y0_top); }qemu_spice_gl_monitor_config (ssd,0 ,0 , dmabuf->width, dmabuf->height); ssd->guest_dmabuf_refresh = false;
hw/display/Makefile.objs +1 -1
@@ -36,7 +36,7 @@ obj-$(CONFIG_VGA) += vga.o common-obj-$(CONFIG_QXL) += qxl.o qxl-logger.o qxl-render.o -obj-$(CONFIG_VIRTIO) += virtio-gpu.o virtio-gpu-3d.o +obj-$(CONFIG_VIRTIO) += virtio-gpu.o virtio-gpu-3d.o vhost-gpu.o obj-$(CONFIG_VIRTIO_PCI) += virtio-gpu-pci.o obj-$(CONFIG_VIRTIO_VGA) += virtio-vga.o virtio-gpu.o-cflags := $(VIRGL_CFLAGS)
Signature · 1 line
2.17.1.906.g10fd178552
Re: [Qemu-devel] [RFC v2 11/12] Add virtio-gpu vhost-user backend
Quoted 5 lines · Marc-André Lureau
Add to virtio-gpu devices a "vhost-user" property. When set, the associated vhost-user backend is used to handle the virtio rings.
For now, a socketpair is created for the backend to share the rendering results with qemu via a simple
VHOST_GPUprotocol.
Why this isn't a separate device, like vhost-user-input-pci?
hw/display/vhost-gpu.c line 68
Quoted 8 lines
hw/display/vhost-gpu.c new file +8
-0+typedef struct VhostGpuUpdate { +uint32_t scanout_id; +uint32_t x; +uint32_t y; +uint32_t width; +uint32_t height; +uint8_t data[]; +} QEMU_PACKED VhostGpuUpdate;
Hmm, when designing a new protocol I think we can do better than just squeering the pixels into a tcp stream. Use shared memory instead? Due to vhost we are limited to linux anyway, so we might even consider stuff like dmabufs here.
cheers,
Gerd
Re: [Qemu-devel] [RFC v2 11/12] Add virtio-gpu vhost-user backend
Hi
Quoted 8 lines · Gerd Hoffmann
Quoted 5 lines · Marc-André Lureau
Add to virtio-gpu devices a "vhost-user" property. When set, the associated vhost-user backend is used to handle the virtio rings.
For now, a socketpair is created for the backend to share the rendering results with qemu via a simple
VHOST_GPUprotocol.Why this isn't a separate device, like vhost-user-input-pci?
Ok, let's have vhost-user-gpu-pci and vhost-user-vga, inheriting from existing devices.
Quoted 5 lines
Quoted 5 lines
hw/display/vhost-gpu.c new file +5
-0+typedef struct VhostGpuUpdate { + uint32_t scanout_id; + uint32_t x; + uint32_t y; + uint32_t width;
Quoted 8 lines
hw/display/vhost-gpu.c line 68
Quoted 3 lines
hw/display/vhost-gpu.c new file +3
-0+uint32_t height; +uint8_t data[]; +}QEMU_PACKED VhostGpuUpdate;Hmm, when designing a new protocol I think we can do better than just squeering the pixels into a tcp stream. Use shared memory instead? Due to vhost we are limited to linux anyway, so we might even consider stuff like dmabufs here.
Well, my goal is not to invent a new spice or wayland protocol :) I don't care much about 2d performance at this point, more about 3d. Can we leave 2d improvements for another day? Beside, what would dmabuf bring us for 2d compared to shmem?
There seems to be a lot of overhead with the roundtrip vhost-user -> qemu -> spice worker -> spice client -> wayland/x11 -> gpu already (but this isn't necessarily so bad at 60fps or less). Ideally, I would like to bypass qemu & spice for local rendering, but I don't think wayland support that kind of nested window composition (at least tracking messages weston --nested doesn't show that kind of optimization).
FWIW, here are some Unigine Heaven 4.0 benchmarks (probably within +-10%):
qemu-gtk/egl+virtio-gpu: fps:2.6/ score: 64 qemu-gtk/egl+vhost-user-gpu: fps:12.9 / score: 329
spice+virtio-gpu: fps:2.8 / score: 70
spice+vhost-user-gpu: fps:12.1 / score: 304
That should give an extra motivation :)
Signature · 1 line
Marc-André Lureau
Re: [Qemu-devel] [RFC v2 11/12] Add virtio-gpu vhost-user backend
Quoted 44 lines · Marc-André Lureau
Hi
Quoted 8 lines · Gerd Hoffmann
Quoted 5 lines · Marc-André Lureau
Add to virtio-gpu devices a "vhost-user" property. When set, the associated vhost-user backend is used to handle the virtio rings.
For now, a socketpair is created for the backend to share the rendering results with qemu via a simple
VHOST_GPUprotocol.Why this isn't a separate device, like vhost-user-input-pci?
Ok, let's have vhost-user-gpu-pci and vhost-user-vga, inheriting from existing devices.
Quoted 5 lines
Quoted 5 lines
hw/display/vhost-gpu.c new file +5
-0+typedef struct VhostGpuUpdate { + uint32_t scanout_id; + uint32_t x; + uint32_t y; + uint32_t width;Quoted 8 lines
hw/display/vhost-gpu.c line 68
Quoted 3 lines
hw/display/vhost-gpu.c new file +3
-0+uint32_t height; +uint8_t data[]; +}QEMU_PACKED VhostGpuUpdate;Hmm, when designing a new protocol I think we can do better than just squeering the pixels into a tcp stream. Use shared memory instead? Due to vhost we are limited to linux anyway, so we might even consider stuff like dmabufs here.
Well, my goal is not to invent a new spice or wayland protocol :) I don't care much about 2d performance at this point, more about 3d. Can we leave 2d improvements for another day? Beside, what would dmabuf bring us for 2d compared to shmem?
There seems to be a lot of overhead with the roundtrip vhost-user -> qemu -> spice worker -> spice client -> wayland/x11 -> gpu already (but this isn't necessarily so bad at 60fps or less). Ideally, I would like to bypass qemu & spice for local rendering, but I don't think wayland support that kind of nested window composition (at least tracking messages weston --nested doesn't show that kind of optimization).
FWIW, here are some Unigine Heaven 4.0 benchmarks (probably within +-10%):
Quoted 8 lines
qemu-gtk/egl+virtio-gpu: fps:2.6/ score: 64 qemu-gtk/egl+vhost-user-gpu: fps:12.9 / score: 329
spice+virtio-gpu: fps:2.8 / score: 70
spice+vhost-user-gpu: fps:12.1 / score: 304That should give an extra motivation :)
(host is fps:31.1 / score:784
Signature · 1 line
Marc-André Lureau
Re: [Qemu-devel] [RFC v2 11/12] Add virtio-gpu vhost-user backend
In reply to Marc-André LureauQuoted 7 lines
Quoted 4 lines
Quoted 2 lines
For now, a socketpair is created for the backend to share the rendering results with qemu via a simple
VHOST_GPUprotocol.Why this isn't a separate device, like vhost-user-input-pci?
Ok, let's have vhost-user-gpu-pci and vhost-user-vga, inheriting from existing devices.
I'd tend to create separate devices instead of inheriting from the existing devices. Arn't the code paths more or less completely different? What code is shared between builtin and vhost-user versions of the devices?
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
hw/display/vhost-gpu.c new file +5
-0+typedef struct VhostGpuUpdate { + uint32_t scanout_id; + uint32_t x; + uint32_t y; + uint32_t width;Quoted 8 lines
hw/display/vhost-gpu.c line 68
Quoted 3 lines
hw/display/vhost-gpu.c new file +3
-0+uint32_t height; +uint8_t data[]; +}QEMU_PACKED VhostGpuUpdate;Hmm, when designing a new protocol I think we can do better than just squeering the pixels into a tcp stream. Use shared memory instead? Due to vhost we are limited to linux anyway, so we might even consider stuff like dmabufs here.
Quoted 4 lines
Well, my goal is not to invent a new spice or wayland protocol :) I don't care much about 2d performance at this point, more about 3d. Can we leave 2d improvements for another day? Beside, what would dmabuf bring us for 2d compared to shmem?
Well, you need dma-bufs for 3d anyway, so why not use them for 2d too? I don't think we need separate code paths for 2d vs. 3d updates.
Quoted 7 lines
There seems to be a lot of overhead with the roundtrip vhost-user -> qemu -> spice worker -> spice client -> wayland/x11 -> gpu already (but this isn't necessarily so bad at 60fps or less). Ideally, I would like to bypass qemu & spice for local rendering, but I don't think wayland support that kind of nested window composition (at least tracking messages weston --nested doesn't show that kind of optimization).
Yep, a direct vhost-user -> wayland path makes sense. Using dma-bufs for both 2d and 3d should simplify that too (again: one code path instead of two).
What do you mean with nested window composition?
cheers,
Gerd
RFC v2 12/12 contrib: add vhost-user-gpu
In reply to Marc-André LureauAdd a vhost-user gpu backend example, based on virtio-gpu/3d device. It is to be associated with a vhost-user-backend object, ex:
-object vhost-user-backend,id=vug,cmd="vhost-user-gpu"
TODO:
- add/check multi-head support
- add/check resize support
- add missing options, such as virgl=off,rendernode config, initial resolution etc..
- stop/crash & resume handling
- accelerated rendering/display to avoid the many round trips
--- contrib/vhost-user-gpu/virgl.h | 24 + contrib/vhost-user-gpu/vugpu.h | 152 +++++ contrib/vhost-user-gpu/main.c | 953 +++++++++++++++++++++++++++ contrib/vhost-user-gpu/virgl.c | 537 +++++++++++++++ Makefile | 3 + Makefile.objs | 1 + configure | 4 + contrib/vhost-user-gpu/Makefile.objs | 7 + 8 files changed, 1681 insertions(+) create mode 100644 contrib/vhost-user-gpu/virgl.h create mode 100644 contrib/vhost-user-gpu/vugpu.h create mode 100644 contrib/vhost-user-gpu/main.c create mode 100644 contrib/vhost-user-gpu/virgl.c create mode 100644 contrib/vhost-user-gpu/Makefile.objs
contrib/vhost-user-gpu/virgl.h new file +24 -0
@@ -0,0 +1,24 @@ +/* +* Virtio vhost-user GPU Device +* +* Copyright Red Hat, Inc. 2013-2018 +* +* Authors: +* Dave Airlie <[email protected]> +* Gerd Hoffmann <[email protected]> +* Marc-André Lureau <[email protected]> +* +* This work is licensed under the terms of the GNU GPL, version 2 or later. +* See the COPYING file in the top-level directory. +*/ +#ifndef VUGPU_VIRGL_H_ +#define VUGPU_VIRGL_H_ + +#include "vugpu.h" + +int vg_virgl_init (VuGpu *g); +void vg_virgl_process_cmd (VuGpu *vg,struct virtio_gpu_ctrl_command *cmd); +void vg_virgl_update_cursor_data (VuGpu *g,uint32_t resource_id, +gpointer data); + +#endif
contrib/vhost-user-gpu/vugpu.h new file +152 -0
152 lines not on this page · raw message
contrib/vhost-user-gpu/main.c new file +953 -0
953 lines not on this page · raw message
contrib/vhost-user-gpu/virgl.c new file +537 -0
537 lines not on this page · raw message
Makefile +3 -0
@@ -421,6 +421,7 @@ dummy := $(call unnest-vars,, \ vhost-user-scsi-obj-y \ vhost-user-blk-obj-y \ vhost-user-input-obj-y \ + vhost-user-gpu-obj-y \ qga-vss-dll-obj-y \ block-obj-y \ block-obj-m \
@@ -722,6 +723,8 @@ vhost-user-blk$(EXESUF): $(vhost-user-blk-obj-y) libvhost-user.a $(call LINK, $^) vhost-user-input$(EXESUF): $(vhost-user-input-obj-y) libvhost-user.a libqemuutil.a $(call LINK, $^) +vhost-user-gpu$(EXESUF): $(vhost-user-gpu-obj-y) $(libvhost-user-obj-y) libqemuutil.a libqemustub.a + $(call LINK, $^) module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak $(call quiet-command,$(PYTHON) $< $@ \
Makefile.objs +1 -0
@@ -194,6 +194,7 @@ vhost-user-scsi.o-libs := $(LIBISCSI_LIBS) vhost-user-scsi-obj-y = contrib/vhost-user-scsi/ vhost-user-blk-obj-y = contrib/vhost-user-blk/ vhost-user-input-obj-y = contrib/vhost-user-input/ +vhost-user-gpu-obj-y = contrib/vhost-user-gpu/ ###################################################################### trace-events-subdirs =
configure +4 -0
@@ -5533,6 +5533,7 @@ if test "$want_tools" = "yes" ; then if [ "$ivshmem" = "yes" ]; then tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools" tools="vhost-user-input\$(EXESUF) $tools" + tools="vhost-user-gpu\$(EXESUF) $tools" fi fi if test "$softmmu" = yes ; then
@@ -7141,6 +7142,9 @@ echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak done # for target in $targets +echo "PIXMAN_CFLAGS=$pixman_cflags" >> $config_host_mak +echo "PIXMAN_LIBS=$pixman_libs" >> $config_host_mak + if [ "$fdt" = "git" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi
contrib/vhost-user-gpu/Makefile.objs new file +7 -0
@@ -0,0 +1,7 @@ +vhost-user-gpu-obj-y = main.o virgl.o + +main.o-cflags := $(PIXMAN_CFLAGS) +main.o-libs := $(PIXMAN_LIBS) + +virgl.o-cflags := $(VIRGL_CFLAGS) +virgl.o-libs := $(VIRGL_LIBS)
Signature · 1 line
2.17.1.906.g10fd178552
This series failed docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
Hi,
This series failed docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally.
Type: series
Message-id: [email protected]
Subject: [Qemu-devel] [RFC v2 00/12] vhost-user for input & GPU
=== TEST SCRIPT BEGIN ===
#!/bin/bash
set -e
git submodule update --init dtc
# Let docker tests dump environment info
export SHOW_ENV=1
export J=8
time make docker-test-mingw@fedora
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 Switched to a new branch 'test'7e619ea0fc contrib: add vhost-user-gpua65b8cf410 Add virtio-gpu vhost-user backend 28ff828eb4 vhost-user: add vhost_user_gpu_set_socket() caa5a91d56 Add vhost-input-pcib1640c571e contrib: add vhost-user-input404d16b19b libvhost-user: export vug_source_new 6c2fba2e53 vhost-user: add vhost_user_input_get_config() fd2e0d8cf9 vhost-user: split vhost_user_read() 3ddd2476bb Add vhost-user-backendcfe338e0f1 vhost-user: wrap some read/write with retry handling 8bce1b48c3 libvhost-user: exit by default on VHOST_USER_NONE b249db152e chardev: avoid crash if no associated address
=== OUTPUT BEGIN ===
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-q1mu68mb/src/dtc'...
Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
BUILD fedora
make[1]: Entering directory '/var/tmp/patchew-tester-tmp-q1mu68mb/src'
GEN /var/tmp/patchew-tester-tmp-q1mu68mb/src/docker-src.2018-06-01-13.26.35.22520/qemu.tar
Cloning into '/var/tmp/patchew-tester-tmp-q1mu68mb/src/docker-src.2018-06-01-13.26.35.22520/qemu.tar.vroot'... done.
Your branch is up-to-date with 'origin/test'.
Submodule 'dtc' (git://git.qemu-project.org/dtc.git) registered for path 'dtc'
Cloning into '/var/tmp/patchew-tester-tmp-q1mu68mb/src/docker-src.2018-06-01-13.26.35.22520/qemu.tar.vroot/dtc'... Submodule path 'dtc': checked out 'e54388015af1fb4bf04d0bca99caba1074d9cc42'
Submodule 'ui/keycodemapdb' (git://git.qemu.org/keycodemapdb.git) registered for path 'ui/keycodemapdb' Cloning into '/var/tmp/patchew-tester-tmp-q1mu68mb/src/docker-src.2018-06-01-13.26.35.22520/qemu.tar.vroot/ui/keycodemapdb'... Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
COPY RUNNER
RUN test-mingw in qemu:fedora
Packages installed:
PyYAML-3.12-5.fc27.x86_64
SDL2-devel-2.0.7-2.fc27.x86_64
bc-1.07.1-3.fc27.x86_64
bison-3.0.4-8.fc27.x86_64
bluez-libs-devel-5.48-3.fc27.x86_64
brlapi-devel-0.6.6-8.fc27.x86_64
bzip2-1.0.6-24.fc27.x86_64
bzip2-devel-1.0.6-24.fc27.x86_64
ccache-3.3.6-1.fc27.x86_64
clang-5.0.1-5.fc27.x86_64
device-mapper-multipath-devel-0.7.1-9.git847cc43.fc27.x86_64
findutils-4.6.0-16.fc27.x86_64
flex-2.6.1-5.fc27.x86_64
gcc-7.3.1-5.fc27.x86_64
gcc-c++-7.3.1-5.fc27.x86_64
gettext-0.19.8.1-12.fc27.x86_64
git-2.14.3-3.fc27.x86_64
glib2-devel-2.54.3-2.fc27.x86_64
glusterfs-api-devel-3.12.7-1.fc27.x86_64
gnutls-devel-3.5.18-2.fc27.x86_64
gtk3-devel-3.22.26-2.fc27.x86_64
hostname-3.18-4.fc27.x86_64
libaio-devel-0.3.110-9.fc27.x86_64
libasan-7.3.1-5.fc27.x86_64
libattr-devel-2.4.47-21.fc27.x86_64
libcap-devel-2.25-7.fc27.x86_64
libcap-ng-devel-0.7.8-5.fc27.x86_64
libcurl-devel-7.55.1-10.fc27.x86_64
libfdt-devel-1.4.6-1.fc27.x86_64
libpng-devel-1.6.31-1.fc27.x86_64
librbd-devel-12.2.4-1.fc27.x86_64
libssh2-devel-1.8.0-5.fc27.x86_64
libubsan-7.3.1-5.fc27.x86_64
libusbx-devel-1.0.21-4.fc27.x86_64
libxml2-devel-2.9.7-1.fc27.x86_64
llvm-5.0.1-6.fc27.x86_64
lzo-devel-2.08-11.fc27.x86_64
make-4.2.1-4.fc27.x86_64
mingw32-SDL-1.2.15-9.fc27.noarch
mingw32-bzip2-1.0.6-9.fc27.noarch
mingw32-curl-7.54.1-2.fc27.noarch
mingw32-glib2-2.54.1-1.fc27.noarch
mingw32-gmp-6.1.2-2.fc27.noarch
mingw32-gnutls-3.5.13-2.fc27.noarch
mingw32-gtk2-2.24.31-4.fc27.noarch
mingw32-gtk3-3.22.16-1.fc27.noarch
mingw32-libjpeg-turbo-1.5.1-3.fc27.noarch
mingw32-libpng-1.6.29-2.fc27.noarch
mingw32-libssh2-1.8.0-3.fc27.noarch
mingw32-libtasn1-4.13-1.fc27.noarch
mingw32-nettle-3.3-3.fc27.noarch
mingw32-pixman-0.34.0-3.fc27.noarch
mingw32-pkg-config-0.28-9.fc27.x86_64
mingw64-SDL-1.2.15-9.fc27.noarch
mingw64-bzip2-1.0.6-9.fc27.noarch
mingw64-curl-7.54.1-2.fc27.noarch
mingw64-glib2-2.54.1-1.fc27.noarch
mingw64-gmp-6.1.2-2.fc27.noarch
mingw64-gnutls-3.5.13-2.fc27.noarch
mingw64-gtk2-2.24.31-4.fc27.noarch
mingw64-gtk3-3.22.16-1.fc27.noarch
mingw64-libjpeg-turbo-1.5.1-3.fc27.noarch
mingw64-libpng-1.6.29-2.fc27.noarch
mingw64-libssh2-1.8.0-3.fc27.noarch
mingw64-libtasn1-4.13-1.fc27.noarch
mingw64-nettle-3.3-3.fc27.noarch
mingw64-pixman-0.34.0-3.fc27.noarch
mingw64-pkg-config-0.28-9.fc27.x86_64
ncurses-devel-6.0-13.20170722.fc27.x86_64
nettle-devel-3.4-1.fc27.x86_64
nss-devel-3.36.0-1.0.fc27.x86_64
numactl-devel-2.0.11-5.fc27.x86_64
package libjpeg-devel is not installed
perl-5.26.1-403.fc27.x86_64
pixman-devel-0.34.0-4.fc27.x86_64
python3-3.6.2-13.fc27.x86_64
snappy-devel-1.1.4-5.fc27.x86_64
sparse-0.5.1-2.fc27.x86_64
spice-server-devel-0.14.0-1.fc27.x86_64
systemtap-sdt-devel-3.2-3.fc27.x86_64
tar-1.29-7.fc27.x86_64
usbredir-devel-0.7.1-5.fc27.x86_64
virglrenderer-devel-0.6.0-3.20170210git76b3da97b.fc27.x86_64
vte3-devel-0.36.5-5.fc27.x86_64
which-2.21-4.fc27.x86_64
xen-devel-4.9.1-5.fc27.x86_64
zlib-devel-1.2.11-4.fc27.x86_64
Environment variables:
TARGET_LIST=
PACKAGES=ccache gettext git tar PyYAML sparse flex bison python3 bzip2 hostname gcc gcc-c++ llvm clang make perl which bc findutils glib2-devel libaio-devel pixman-devel zlib-devel libfdt-devel libasan libubsan bluez-libs-devel brlapi-devel bzip2-devel device-mapper-multipath-devel glusterfs-api-devel gnutls-devel gtk3-devel libattr-devel libcap-devel libcap-ng-devel libcurl-devel libjpeg-devel libpng-devel librbd-devel libssh2-devel libusbx-devel libxml2-devel lzo-devel ncurses-devel nettle-devel nss-devel numactl-devel SDL2-devel snappy-devel spice-server-devel systemtap-sdt-devel usbredir-devel virglrenderer-devel vte3-devel xen-devel mingw32-pixman mingw32-glib2 mingw32-gmp mingw32-SDL mingw32-pkg-config mingw32-gtk2 mingw32-gtk3 mingw32-gnutls mingw32-nettle mingw32-libtasn1 mingw32-libjpeg-turbo mingw32-libpng mingw32-curl mingw32-libssh2 mingw32-bzip2 mingw64-pixman mingw64-glib2 mingw64-gmp mingw64-SDL mingw64-pkg-config mingw64-gtk2 mingw64-gtk3 mingw64-gnutls mingw64-nettle mingw64-libtasn1 mingw64-libjpeg-turbo mingw64-libpng mingw64-curl mingw64-libssh2 mingw64-bzip2
J=8
V=
HOSTNAME=1b9bd3175d30
DEBUG=
SHOW_ENV=1
PWD=/
HOME=/root
CCACHE_DIR=/var/tmp/ccache
DISTTAG=f27container
QEMU_CONFIGURE_OPTS=--python=/usr/bin/python3
FGC=f27
TEST_DIR=/tmp/qemu-test
SHLVL=1
FEATURES=mingw clang pyyaml asan dtc PATH=/usr/lib/ccache:/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin MAKEFLAGS= -j8
EXTRA_CONFIGURE_OPTS=
_=/usr/bin/env
Configure options:
--enable-werror --target-list=x86_64-softmmu,aarch64-softmmu --prefix=/tmp/qemu-test/install --python=/usr/bin/python3 --cross-prefix=x86_64-w64-mingw32- --enable-trace-backends=simple --enable-gnutls --enable-nettle --enable-curl --enable-vnc --enable-bzip2 --enable-guest-agent --with-sdlabi=1.2 --with-gtkabi=2.0
Install prefix /tmp/qemu-test/install BIOS directory /tmp/qemu-test/install firmware path /tmp/qemu-test/install/share/qemu-firmware binary directory /tmp/qemu-test/install
library directory /tmp/qemu-test/install/lib
module directory /tmp/qemu-test/install/lib
libexec directory /tmp/qemu-test/install/libexec
include directory /tmp/qemu-test/install/include
config directory /tmp/qemu-test/install
local state directory queried at runtime
Windows SDK no Source path /tmp/qemu-test/src GIT binary git GIT submodules C compiler x86_64-w64-mingw32-gcc Host C compiler cc C++ compiler x86_64-w64-mingw32-g++ Objective-C compiler clang ARFLAGS rv CFLAGS -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -g QEMU_CFLAGS -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/pixman-1 -I$(SRC_PATH)/dtc/libfdt -Werror -DHAS_LIBSSH2_SFTP_FSYNC -mms-bitfields -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/x86_64-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -m64 -mcx16 -mthreads -D__USE_MINGW_ANSI_STDIO=1 -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wexpansion-to-defined -Wendif-labels -Wno-shift-negative-value -Wno-missing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-strong -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/p11-kit-1 -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include -I/usr/x86_64-w64-mingw32/sys-root/mingw/include/libpng16 LDFLAGS -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase -Wl,--warn-common -m64 -g QEMU_LDFLAGS -L$(BUILD_DIR)/dtc/libfdt make make install install python /usr/bin/python3 -B smbd /usr/sbin/smbd module support no host CPU x86_64 host big endian no target list x86_64-softmmu aarch64-softmmu gprof enabled no sparse enabled no strip binaries yes profiler no static build no SDL support yes (1.2.15) GTK support yes (2.24.31) GTK GL support no VTE support no TLS priority NORMAL GNUTLS support yes GNUTLS rnd yes libgcrypt no libgcrypt kdf no nettle yes (3.3) nettle kdf yes libtasn1 yes curses support no virgl support no curl support yes mingw32 support yes Audio drivers dsound
Block whitelist (rw)
Block whitelist (ro)
VirtFS support no
Multipath support no
VNC support yes VNC SASL support no VNC JPEG support yes VNC PNG support yes xen support no brlapi support no bluez support no Documentation no PIE no vde support no netmap support no Linux AIO support no ATTR/XATTR support no Install blobs yes KVM support no HAX support yes HVF support no WHPX support no TCG support yes TCG debug enabled no TCG interpreter no malloc trim support no RDMA support no fdt support git membarrier no preadv support no fdatasync no madvise no posix_madvise no posix_memalign no
libcap-ng support no
vhost-net support no
vhost-crypto support no
vhost-scsi support no
vhost-vsock support no
vhost-user support no
Trace backends simple
Trace output file trace-<pid>
spice support no rbd support no xfsctl support no smartcard support no libusb no usb net redir no OpenGL support no OpenGL dmabufs no libiscsi support no libnfs support no
build guest agent yes
QGA VSS support no
QGA w32 disk info yes
QGA MSI support no
seccomp support no
coroutine backend win32
coroutine pool yes
debug stack usage no
crypto afalg no
GlusterFS support no
gcov gcov gcov enabled no TPM support yes libssh2 support yes TPM passthrough no TPM emulator no QOM debugging yes Live block migration yes lzo support no snappy support no bzip2 support yes NUMA host support no libxml2 no tcmalloc support no jemalloc support no
avx2 optimization yes
replication support yes
VxHS block device no
capstone no
WARNING: Use of GTK 2.0 is deprecated and will be removed in
WARNING: future releases. Please switch to using GTK 3.0
WARNING: Use of SDL 1.2 is deprecated and will be removed in
WARNING: future releases. Please switch to using SDL 2.0
GEN x86_64-softmmu/config-devices.mak.tmp GEN config-host.h GEN aarch64-softmmu/config-devices.mak.tmp GEN qemu-options.def GEN qapi-gen GEN trace/generated-tcg-tracers.h GEN trace/generated-helpers-wrappers.h GEN trace/generated-helpers.h GEN x86_64-softmmu/config-devices.mak GEN trace/generated-helpers.c GEN module_block.h GEN aarch64-softmmu/config-devices.mak GEN ui/input-keymap-atset1-to-qcode.c GEN ui/input-keymap-linux-to-qcode.c GEN ui/input-keymap-qcode-to-atset1.c GEN ui/input-keymap-qcode-to-atset2.c GEN ui/input-keymap-qcode-to-atset3.c GEN ui/input-keymap-qcode-to-linux.c GEN ui/input-keymap-qcode-to-qnum.c GEN ui/input-keymap-qcode-to-sun.c GEN ui/input-keymap-qnum-to-qcode.c GEN ui/input-keymap-usb-to-qcode.c GEN ui/input-keymap-win32-to-qcode.c GEN ui/input-keymap-x11-to-qcode.c GEN ui/input-keymap-xorgevdev-to-qcode.c GEN ui/input-keymap-xorgkbd-to-qcode.c GEN ui/input-keymap-xorgxquartz-to-qcode.c GEN ui/input-keymap-xorgxwin-to-qcode.c GEN tests/test-qapi-gen GEN trace-root.h GEN accel/kvm/trace.h GEN accel/tcg/trace.h GEN audio/trace.h GEN block/trace.h GEN chardev/trace.h GEN crypto/trace.h GEN hw/9pfs/trace.h GEN hw/acpi/trace.h GEN hw/alpha/trace.h GEN hw/arm/trace.h GEN hw/audio/trace.h GEN hw/block/trace.h GEN hw/block/dataplane/trace.h GEN hw/char/trace.h GEN hw/display/trace.h GEN hw/dma/trace.h GEN hw/hppa/trace.h GEN hw/i386/trace.h GEN hw/i386/xen/trace.h GEN hw/ide/trace.h GEN hw/input/trace.h GEN hw/intc/trace.h GEN hw/isa/trace.h GEN hw/mem/trace.h GEN hw/misc/trace.h GEN hw/misc/macio/trace.h GEN hw/net/trace.h GEN hw/nvram/trace.h GEN hw/pci/trace.h GEN hw/pci-host/trace.h GEN hw/ppc/trace.h GEN hw/rdma/trace.h GEN hw/rdma/vmw/trace.h GEN hw/s390x/trace.h GEN hw/scsi/trace.h GEN hw/sd/trace.h GEN hw/sparc/trace.h GEN hw/sparc64/trace.h GEN hw/timer/trace.h GEN hw/tpm/trace.h GEN hw/usb/trace.h GEN hw/vfio/trace.h GEN hw/virtio/trace.h GEN hw/xen/trace.h GEN io/trace.h GEN linux-user/trace.h GEN migration/trace.h GEN nbd/trace.h GEN net/trace.h GEN qapi/trace.h GEN qom/trace.h GEN scsi/trace.h GEN target/arm/trace.h GEN target/i386/trace.h GEN target/mips/trace.h GEN target/ppc/trace.h GEN target/s390x/trace.h GEN target/sparc/trace.h GEN ui/trace.h GEN util/trace.h GEN trace-root.c GEN accel/kvm/trace.c GEN accel/tcg/trace.c GEN audio/trace.c GEN block/trace.c GEN chardev/trace.c GEN crypto/trace.c GEN hw/9pfs/trace.c GEN hw/acpi/trace.c GEN hw/alpha/trace.c GEN hw/arm/trace.c GEN hw/audio/trace.c GEN hw/block/trace.c GEN hw/block/dataplane/trace.c GEN hw/char/trace.c GEN hw/display/trace.c GEN hw/dma/trace.c GEN hw/hppa/trace.c GEN hw/i386/trace.c GEN hw/i386/xen/trace.c GEN hw/ide/trace.c GEN hw/input/trace.c GEN hw/intc/trace.c GEN hw/isa/trace.c GEN hw/mem/trace.c GEN hw/misc/trace.c GEN hw/misc/macio/trace.c GEN hw/net/trace.c GEN hw/nvram/trace.c GEN hw/pci/trace.c GEN hw/pci-host/trace.c GEN hw/ppc/trace.c GEN hw/rdma/trace.c GEN hw/rdma/vmw/trace.c GEN hw/s390x/trace.c GEN hw/scsi/trace.c GEN hw/sd/trace.c GEN hw/sparc/trace.c GEN hw/sparc64/trace.c GEN hw/timer/trace.c GEN hw/tpm/trace.c GEN hw/usb/trace.c GEN hw/vfio/trace.c GEN hw/virtio/trace.c GEN hw/xen/trace.c GEN io/trace.c GEN linux-user/trace.c GEN migration/trace.c GEN nbd/trace.c GEN net/trace.c GEN qapi/trace.c GEN qom/trace.c GEN scsi/trace.c GEN target/arm/trace.c GEN target/i386/trace.c GEN target/mips/trace.c GEN target/ppc/trace.c GEN target/s390x/trace.c GEN target/sparc/trace.c GEN ui/trace.c GEN util/trace.c GEN config-all-devices.mak
DEP /tmp/qemu-test/src/dtc/tests/dumptrees.c
DEP /tmp/qemu-test/src/dtc/tests/trees.S
DEP /tmp/qemu-test/src/dtc/tests/testutils.c
DEP /tmp/qemu-test/src/dtc/tests/value-labels.c DEP /tmp/qemu-test/src/dtc/tests/asm_tree_dump.c DEP /tmp/qemu-test/src/dtc/tests/truncated_property.c DEP /tmp/qemu-test/src/dtc/tests/check_path.c
DEP /tmp/qemu-test/src/dtc/tests/overlay_bad_fixup.c DEP /tmp/qemu-test/src/dtc/tests/overlay.c
DEP /tmp/qemu-test/src/dtc/tests/subnode_iterate.c DEP /tmp/qemu-test/src/dtc/tests/property_iterate.c DEP /tmp/qemu-test/src/dtc/tests/integer-expressions.c DEP /tmp/qemu-test/src/dtc/tests/utilfdt_test.c DEP /tmp/qemu-test/src/dtc/tests/path_offset_aliases.c DEP /tmp/qemu-test/src/dtc/tests/add_subnode_with_nops.c DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_unordered.c DEP /tmp/qemu-test/src/dtc/tests/dtb_reverse.c DEP /tmp/qemu-test/src/dtc/tests/dtbs_equal_ordered.c DEP /tmp/qemu-test/src/dtc/tests/extra-terminating-null.c DEP /tmp/qemu-test/src/dtc/tests/incbin.c
DEP /tmp/qemu-test/src/dtc/tests/boot-cpuid.c
DEP /tmp/qemu-test/src/dtc/tests/phandle_format.c DEP /tmp/qemu-test/src/dtc/tests/path-references.c DEP /tmp/qemu-test/src/dtc/tests/references.c
DEP /tmp/qemu-test/src/dtc/tests/string_escapes.c DEP /tmp/qemu-test/src/dtc/tests/propname_escapes.c DEP /tmp/qemu-test/src/dtc/tests/appendprop2.c DEP /tmp/qemu-test/src/dtc/tests/appendprop1.c DEP /tmp/qemu-test/src/dtc/tests/del_node.c
DEP /tmp/qemu-test/src/dtc/tests/del_property.c DEP /tmp/qemu-test/src/dtc/tests/setprop.c
DEP /tmp/qemu-test/src/dtc/tests/set_name.c
DEP /tmp/qemu-test/src/dtc/tests/rw_tree1.c
DEP /tmp/qemu-test/src/dtc/tests/open_pack.c
DEP /tmp/qemu-test/src/dtc/tests/nopulate.c
DEP /tmp/qemu-test/src/dtc/tests/mangle-layout.c DEP /tmp/qemu-test/src/dtc/tests/move_and_save.c DEP /tmp/qemu-test/src/dtc/tests/sw_tree1.c
DEP /tmp/qemu-test/src/dtc/tests/nop_node.c
DEP /tmp/qemu-test/src/dtc/tests/nop_property.c DEP /tmp/qemu-test/src/dtc/tests/setprop_inplace.c DEP /tmp/qemu-test/src/dtc/tests/stringlist.c
DEP /tmp/qemu-test/src/dtc/tests/addr_size_cells.c DEP /tmp/qemu-test/src/dtc/tests/notfound.c
DEP /tmp/qemu-test/src/dtc/tests/sized_cells.c DEP /tmp/qemu-test/src/dtc/tests/char_literal.c DEP /tmp/qemu-test/src/dtc/tests/get_alias.c
DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_compatible.c DEP /tmp/qemu-test/src/dtc/tests/node_check_compatible.c DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_prop_value.c DEP /tmp/qemu-test/src/dtc/tests/node_offset_by_phandle.c DEP /tmp/qemu-test/src/dtc/tests/parent_offset.c DEP /tmp/qemu-test/src/dtc/tests/supernode_atdepth_offset.c DEP /tmp/qemu-test/src/dtc/tests/get_path.c
DEP /tmp/qemu-test/src/dtc/tests/get_phandle.c DEP /tmp/qemu-test/src/dtc/tests/getprop.c
DEP /tmp/qemu-test/src/dtc/tests/get_name.c
DEP /tmp/qemu-test/src/dtc/tests/path_offset.c DEP /tmp/qemu-test/src/dtc/tests/subnode_offset.c DEP /tmp/qemu-test/src/dtc/tests/find_property.c DEP /tmp/qemu-test/src/dtc/tests/root_node.c
DEP /tmp/qemu-test/src/dtc/tests/get_mem_rsv.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_overlay.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_addresses.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_empty_tree.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_strerror.c DEP /tmp/qemu-test/src/dtc/libfdt/fdt_rw.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt_sw.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt_wip.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt.c
DEP /tmp/qemu-test/src/dtc/libfdt/fdt_ro.c
DEP /tmp/qemu-test/src/dtc/util.c
DEP /tmp/qemu-test/src/dtc/fdtoverlay.c
DEP /tmp/qemu-test/src/dtc/fdtput.c
DEP /tmp/qemu-test/src/dtc/fdtget.c
DEP /tmp/qemu-test/src/dtc/fdtdump.c
LEX convert-dtsv0-lexer.lex.c
DEP /tmp/qemu-test/src/dtc/srcpos.c
BISON dtc-parser.tab.c
LEX dtc-lexer.lex.c
DEP /tmp/qemu-test/src/dtc/treesource.c
DEP /tmp/qemu-test/src/dtc/fstree.c
DEP /tmp/qemu-test/src/dtc/livetree.c
DEP /tmp/qemu-test/src/dtc/flattree.c
DEP /tmp/qemu-test/src/dtc/dtc.c
DEP /tmp/qemu-test/src/dtc/data.c
DEP /tmp/qemu-test/src/dtc/checks.c
DEP convert-dtsv0-lexer.lex.c
DEP dtc-parser.tab.c
DEP dtc-lexer.lex.c
CHK version_gen.h
UPD version_gen.h
DEP /tmp/qemu-test/src/dtc/util.c
CC libfdt/fdt.o
CC libfdt/fdt_ro.o
CC libfdt/fdt_wip.o
CC libfdt/fdt_sw.o
CC libfdt/fdt_strerror.o
CC libfdt/fdt_rw.o
CC libfdt/fdt_addresses.o
CC libfdt/fdt_empty_tree.o
CC libfdt/fdt_overlay.o
AR libfdt/libfdt.a
x86_64-w64-mingw32-ar: creating libfdt/libfdt.a
a - libfdt/fdt.o
a - libfdt/fdt_ro.o
a - libfdt/fdt_wip.o
a - libfdt/fdt_sw.o
a - libfdt/fdt_rw.o
a - libfdt/fdt_strerror.o
a - libfdt/fdt_empty_tree.o
a - libfdt/fdt_addresses.o
a - libfdt/fdt_overlay.o
RC version.o
GEN qga/qapi-generated/qapi-gen
CC qapi/qapi-builtin-types.o
CC qapi/qapi-types-block-core.o
CC qapi/qapi-types-char.o
CC qapi/qapi-types-common.o
CC qapi/qapi-types-crypto.o
CC qapi/qapi-types-block.o
CC qapi/qapi-types.o
CC qapi/qapi-types-introspect.o
CC qapi/qapi-types-job.o
CC qapi/qapi-types-migration.o
CC qapi/qapi-types-misc.o
CC qapi/qapi-types-net.o
CC qapi/qapi-types-rocker.o
CC qapi/qapi-types-run-state.o
CC qapi/qapi-types-sockets.o
CC qapi/qapi-types-tpm.o
CC qapi/qapi-types-trace.o
CC qapi/qapi-types-transaction.o
CC qapi/qapi-types-ui.o
CC qapi/qapi-builtin-visit.o
CC qapi/qapi-visit.o
CC qapi/qapi-visit-block-core.o
CC qapi/qapi-visit-block.o
CC qapi/qapi-visit-char.o
CC qapi/qapi-visit-common.o
CC qapi/qapi-visit-crypto.o
CC qapi/qapi-visit-introspect.o
CC qapi/qapi-visit-job.o
CC qapi/qapi-visit-migration.o
CC qapi/qapi-visit-misc.o
CC qapi/qapi-visit-net.o
CC qapi/qapi-visit-rocker.o
CC qapi/qapi-visit-run-state.o
CC qapi/qapi-visit-sockets.o
CC qapi/qapi-visit-tpm.o
CC qapi/qapi-visit-trace.o
CC qapi/qapi-visit-transaction.o
CC qapi/qapi-visit-ui.o
CC qapi/qapi-events.o
CC qapi/qapi-events-block-core.o
CC qapi/qapi-events-block.o
CC qapi/qapi-events-char.o
CC qapi/qapi-events-common.o
CC qapi/qapi-events-crypto.o
CC qapi/qapi-events-introspect.o
CC qapi/qapi-events-job.o
CC qapi/qapi-events-migration.o
CC qapi/qapi-events-misc.o
CC qapi/qapi-events-net.o
CC qapi/qapi-events-rocker.o
CC qapi/qapi-events-run-state.o
CC qapi/qapi-events-sockets.o
CC qapi/qapi-events-tpm.o
CC qapi/qapi-events-trace.o
CC qapi/qapi-events-transaction.o
CC qapi/qapi-events-ui.o
CC qapi/qapi-introspect.o
CC qapi/qapi-visit-core.o
CC qapi/qapi-dealloc-visitor.o
CC qapi/qobject-input-visitor.o
CC qapi/qobject-output-visitor.o
CC qapi/qmp-registry.o
CC qapi/qmp-dispatch.o
CC qapi/string-input-visitor.o
CC qapi/string-output-visitor.o
CC qapi/opts-visitor.o
CC qapi/qapi-clone-visitor.o
CC qapi/qmp-event.o
CC qapi/qapi-util.o
CC qobject/qnull.o
CC qobject/qnum.o
CC qobject/qstring.o
CC qobject/qdict.o
CC qobject/qlist.o
CC qobject/qbool.o
CC qobject/qlit.o
CC qobject/qjson.o
CC qobject/qobject.o
CC qobject/json-lexer.o
CC qobject/json-streamer.o
CC qobject/json-parser.o
CC trace/simple.o
CC trace/qmp.o
CC trace/control.o
CC util/osdep.o
CC util/cutils.o
CC util/unicode.o
CC util/qemu-timer-common.o
CC util/bufferiszero.o
CC util/lockcnt.o
CC util/aiocb.o
CC util/async.o
CC util/aio-wait.o
CC util/thread-pool.o
CC util/main-loop.o
CC util/qemu-timer.o
CC util/iohandler.o
CC util/aio-win32.o
CC util/event_notifier-win32.o
CC util/oslib-win32.o
CC util/qemu-thread-win32.o
CC util/envlist.o
CC util/path.o
CC util/module.o
CC util/host-utils.o
CC util/bitmap.o
CC util/bitops.o
CC util/hbitmap.o
CC util/fifo8.o
CC util/acl.o
CC util/cacheinfo.o
CC util/error.o
CC util/qemu-error.o
CC util/id.o
CC util/iov.o
CC util/qemu-config.o
CC util/qemu-sockets.o
CC util/uri.o
CC util/notify.o
CC util/qemu-option.o
CC util/qemu-progress.o
CC util/keyval.o
CC util/hexdump.o
CC util/uuid.o
CC util/crc32c.o
CC util/throttle.o
CC util/getauxval.o
CC util/readline.o
CC util/rcu.o
CC util/qemu-coroutine.o
CC util/qemu-coroutine-lock.o
CC util/qemu-coroutine-io.o
CC util/qemu-coroutine-sleep.o
CC util/coroutine-win32.o
CC util/buffer.o
CC util/timed-average.o
CC util/base64.o
CC util/log.o
CC util/pagesize.o
CC util/qdist.o
CC util/qht.o
CC util/range.o
CC util/stats64.o
CC util/systemd.o
CC util/iova-tree.o
CC trace-root.o
CC accel/kvm/trace.o
CC accel/tcg/trace.o
CC audio/trace.o
CC block/trace.o
CC chardev/trace.o
CC crypto/trace.o
CC hw/9pfs/trace.o
CC hw/acpi/trace.o
CC hw/alpha/trace.o
CC hw/arm/trace.o
CC hw/audio/trace.o
CC hw/block/trace.o
CC hw/block/dataplane/trace.o
CC hw/char/trace.o
CC hw/display/trace.o
CC hw/dma/trace.o
CC hw/hppa/trace.o
CC hw/i386/trace.o
CC hw/i386/xen/trace.o
CC hw/ide/trace.o
CC hw/input/trace.o
CC hw/intc/trace.o
CC hw/isa/trace.o
CC hw/mem/trace.o
CC hw/misc/trace.o
CC hw/misc/macio/trace.o
CC hw/net/trace.o
CC hw/nvram/trace.o
CC hw/pci/trace.o
CC hw/pci-host/trace.o
CC hw/ppc/trace.o
CC hw/rdma/trace.o
CC hw/rdma/vmw/trace.o
CC hw/s390x/trace.o
CC hw/scsi/trace.o
CC hw/sd/trace.o
CC hw/sparc/trace.o
CC hw/sparc64/trace.o
CC hw/timer/trace.o
CC hw/tpm/trace.o
CC hw/usb/trace.o
CC hw/vfio/trace.o
CC hw/virtio/trace.o
CC hw/xen/trace.o
CC io/trace.o
CC linux-user/trace.o
CC migration/trace.o
CC nbd/trace.o
CC net/trace.o
CC qapi/trace.o
CC qom/trace.o
CC scsi/trace.o
CC target/arm/trace.o
CC target/i386/trace.o
CC target/mips/trace.o
CC target/ppc/trace.o
CC target/s390x/trace.o
CC target/sparc/trace.o
CC ui/trace.o
CC util/trace.o
CC crypto/pbkdf-stub.o
CC stubs/arch-query-cpu-def.o
CC stubs/arch-query-cpu-model-expansion.o
CC stubs/arch-query-cpu-model-comparison.o
CC stubs/arch-query-cpu-model-baseline.o
CC stubs/bdrv-next-monitor-owned.o
CC stubs/blk-commit-all.o
CC stubs/blockdev-close-all-bdrv-states.o
CC stubs/clock-warp.o
CC stubs/cpu-get-clock.o
CC stubs/cpu-get-icount.o
CC stubs/dump.o
CC stubs/error-printf.o
CC stubs/fdset.o
CC stubs/gdbstub.o
CC stubs/get-vm-name.o
CC stubs/iothread.o
CC stubs/iothread-lock.o
CC stubs/is-daemonized.o
CC stubs/machine-init-done.o
CC stubs/migr-blocker.o
CC stubs/change-state-handler.o
CC stubs/monitor.o
CC stubs/notify-event.o
CC stubs/qtest.o
CC stubs/replay.o
CC stubs/runstate-check.o
CC stubs/set-fd-handler.o
CC stubs/slirp.o
CC stubs/sysbus.o
CC stubs/tpm.o
CC stubs/trace-control.o
CC stubs/uuid.o
CC stubs/vm-stop.o
CC stubs/fd-register.o
CC stubs/vmstate.o
CC stubs/qmp_memory_device.o
CC stubs/target-monitor-defs.o
CC stubs/target-get-monitor-def.o
CC stubs/pc_madt_cpu_entry.o
CC stubs/vmgenid.o
CC stubs/xen-common.o
CC stubs/xen-hvm.o
CC stubs/pci-host-piix.o
CC stubs/ram-block.o
GEN qemu-img-cmds.h
CC block.o
CC blockjob.o
CC job.o
CC qemu-io-cmds.o
CC replication.o
CC block/raw-format.o
CC block/qcow.o
CC block/vdi.o
CC block/cloop.o
CC block/vmdk.o
CC block/bochs.o
CC block/vpc.o
CC block/vvfat.o
CC block/dmg.o
CC block/qcow2.o
CC block/qcow2-refcount.o
CC block/qcow2-cluster.o
CC block/qcow2-snapshot.o
CC block/qcow2-cache.o
CC block/qcow2-bitmap.o
CC block/qed.o
CC block/qed-l2-cache.o
CC block/qed-table.o
CC block/qed-cluster.o
CC block/qed-check.o
CC block/vhdx.o
CC block/vhdx-endian.o
CC block/vhdx-log.o
CC block/quorum.o
CC block/parallels.o
CC block/blkdebug.o
CC block/blkverify.o
CC block/blkreplay.o
CC block/block-backend.o
CC block/snapshot.o
CC block/qapi.o
CC block/file-win32.o
CC block/win32-aio.o
CC block/null.o
CC block/mirror.o
CC block/commit.o
CC block/io.o
CC block/create.o
CC block/throttle-groups.o
CC block/nbd.o
CC block/nbd-client.o
CC block/sheepdog.o
CC block/accounting.o
CC block/dirty-bitmap.o
CC block/write-threshold.o
CC block/backup.o
CC block/replication.o
CC block/throttle.o
CC block/copy-on-read.o
CC block/crypto.o
CC nbd/server.o
CC nbd/client.o
CC nbd/common.o
CC scsi/utils.o
CC block/curl.o
CC block/ssh.o
CC block/dmg-bz2.o
CC crypto/init.o
CC crypto/hash.o
CC crypto/hash-nettle.o
CC crypto/hmac.o
CC crypto/hmac-nettle.o
CC crypto/aes.o
CC crypto/desrfb.o
CC crypto/cipher.o
CC crypto/tlscreds.o
CC crypto/tlscredsanon.o
CC crypto/tlscredsx509.o
CC crypto/tlssession.o
CC crypto/secret.o
CC crypto/random-gnutls.o
CC crypto/pbkdf.o
CC crypto/pbkdf-nettle.o
CC crypto/ivgen.o
CC crypto/ivgen-essiv.o
CC crypto/ivgen-plain.o
CC crypto/ivgen-plain64.o
CC crypto/afsplit.o
CC crypto/xts.o
CC crypto/block.o
CC crypto/block-qcow.o
CC crypto/block-luks.o
CC io/channel.o
CC io/channel-buffer.o
CC io/channel-command.o
CC io/channel-file.o
CC io/channel-socket.o
CC io/channel-tls.o
CC io/channel-watch.o
CC io/channel-websock.o
CC io/channel-util.o
CC io/dns-resolver.o
CC io/net-listener.o
CC io/task.o
CC qom/object.o
CC qom/container.o
CC qom/qom-qobject.o
CC qom/object_interfaces.o
CC qemu-io.o
CC blockdev.o
CC blockdev-nbd.o
CC bootdevice.o
CC iothread.o
CC job-qmp.o
CC qdev-monitor.o
CC os-win32.o
CC device-hotplug.o
CC bt-host.o
CC bt-vhci.o
CC dma-helpers.o
CC vl.o
CC tpm.o
CC device_tree.o
CC qapi/qapi-commands.o
CC qapi/qapi-commands-block-core.o
CC qapi/qapi-commands-block.o
CC qapi/qapi-commands-char.o
CC qapi/qapi-commands-common.o
CC qapi/qapi-commands-crypto.o
CC qapi/qapi-commands-introspect.o
CC qapi/qapi-commands-job.o
CC qapi/qapi-commands-misc.o
CC qapi/qapi-commands-migration.o
CC qapi/qapi-commands-net.o
CC qapi/qapi-commands-rocker.o
CC qapi/qapi-commands-run-state.o
CC qapi/qapi-commands-sockets.o
CC qapi/qapi-commands-tpm.o
CC qapi/qapi-commands-trace.o
CC qapi/qapi-commands-transaction.o
CC qapi/qapi-commands-ui.o
CC qmp.o
CC hmp.o
CC cpus-common.o
CC audio/audio.o
CC audio/noaudio.o
CC audio/wavaudio.o
CC audio/mixeng.o
CC audio/dsoundaudio.o
CC audio/audio_win_int.o
CC audio/wavcapture.o
CC backends/rng.o
CC backends/rng-egd.o
CC backends/tpm.o
CC backends/hostmem.o
CC backends/hostmem-ram.o
CC backends/cryptodev.o
CC backends/cryptodev-builtin.o
CC backends/cryptodev-vhost.o
CC block/stream.o
CC chardev/msmouse.o
CC chardev/wctablet.o
CC chardev/testdev.o
CC disas/arm.o
CXX disas/arm-a64.o
CC disas/i386.o
CXX disas/libvixl/vixl/utils.o
CXX disas/libvixl/vixl/compiler-intrinsics.o
CXX disas/libvixl/vixl/a64/instructions-a64.o
CXX disas/libvixl/vixl/a64/decoder-a64.o
CXX disas/libvixl/vixl/a64/disasm-a64.o
CC hw/acpi/core.o
CC hw/acpi/piix4.o
CC hw/acpi/pcihp.o
CC hw/acpi/ich9.o
CC hw/acpi/tco.o
CC hw/acpi/cpu_hotplug.o
CC hw/acpi/memory_hotplug.o
CC hw/acpi/cpu.o
CC hw/acpi/nvdimm.o
CC hw/acpi/vmgenid.o
CC hw/acpi/acpi_interface.o
CC hw/acpi/bios-linker-loader.o
CC hw/acpi/aml-build.o
CC hw/acpi/ipmi.o
CC hw/acpi/acpi-stub.o
CC hw/acpi/ipmi-stub.o
CC hw/audio/sb16.o
CC hw/audio/es1370.o
CC hw/audio/ac97.o
CC hw/audio/fmopl.o
CC hw/audio/adlib.o
CC hw/audio/gus.o
CC hw/audio/gusemu_hal.o
CC hw/audio/gusemu_mixer.o
CC hw/audio/cs4231a.o
CC hw/audio/intel-hda.o
CC hw/audio/hda-codec.o
CC hw/audio/pcspk.o
CC hw/audio/wm8750.o
CC hw/audio/pl041.o
CC hw/audio/lm4549.o
CC hw/audio/marvell_88w8618.o
CC hw/audio/soundhw.o
CC hw/block/block.o
CC hw/block/cdrom.o
CC hw/block/hd-geometry.o
CC hw/block/fdc.o
CC hw/block/m25p80.o
CC hw/block/nand.o
CC hw/block/pflash_cfi01.o
CC hw/block/pflash_cfi02.o
CC hw/block/ecc.o
CC hw/block/onenand.o
CC hw/block/nvme.o
CC hw/bt/core.o
CC hw/bt/l2cap.o
CC hw/bt/sdp.o
CC hw/bt/hci.o
CC hw/bt/hid.o
CC hw/bt/hci-csr.o
CC hw/char/ipoctal232.o
CC hw/char/parallel.o
CC hw/char/parallel-isa.o
CC hw/char/pl011.o
CC hw/char/serial.o
CC hw/char/serial-isa.o
CC hw/char/serial-pci.o
CC hw/char/virtio-console.o
CC hw/char/cadence_uart.o
CC hw/char/cmsdk-apb-uart.o
CC hw/char/debugcon.o
CC hw/char/imx_serial.o
CC hw/core/qdev.o
CC hw/core/qdev-properties.o
CC hw/core/bus.o
CC hw/core/reset.o
CC hw/core/qdev-fw.o
CC hw/core/fw-path-provider.o
CC hw/core/irq.o
CC hw/core/hotplug.o
CC hw/core/nmi.o
CC hw/core/stream.o
CC hw/core/ptimer.o
CC hw/core/machine.o
CC hw/core/sysbus.o
CC hw/core/loader.o
CC hw/core/qdev-properties-system.o
CC hw/core/register.o
CC hw/core/or-irq.o
CC hw/core/split-irq.o
CC hw/core/platform-bus.o
CC hw/cpu/core.o
CC hw/display/ads7846.o
CC hw/display/cirrus_vga.o
CC hw/display/pl110.o
CC hw/display/sii9022.o
CC hw/display/ssd0303.o
CC hw/display/ssd0323.o
CC hw/display/vga-pci.o
CC hw/display/bochs-display.o
CC hw/display/vga-isa.o
CC hw/display/vmware_vga.o
CC hw/display/blizzard.o
CC hw/display/exynos4210_fimd.o
CC hw/display/framebuffer.o
CC hw/display/tc6393xb.o
CC hw/dma/pl080.o
CC hw/dma/pl330.o
CC hw/dma/i8257.o
CC hw/dma/xilinx_axidma.o
CC hw/dma/xlnx-zynq-devcfg.o
CC hw/dma/xlnx-zdma.o
CC hw/gpio/max7310.o
CC hw/gpio/pl061.o
CC hw/gpio/zaurus.o
CC hw/gpio/gpio_key.o
CC hw/i2c/core.o
CC hw/i2c/smbus.o
CC hw/i2c/smbus_eeprom.o
CC hw/i2c/i2c-ddc.o
CC hw/i2c/versatile_i2c.o
CC hw/i2c/smbus_ich9.o
CC hw/i2c/pm_smbus.o
CC hw/i2c/bitbang_i2c.o
CC hw/i2c/exynos4210_i2c.o
CC hw/i2c/imx_i2c.o
CC hw/i2c/aspeed_i2c.o
CC hw/ide/core.o
CC hw/ide/atapi.o
CC hw/ide/qdev.o
CC hw/ide/pci.o
CC hw/ide/isa.o
CC hw/ide/piix.o
CC hw/ide/microdrive.o
CC hw/ide/ahci.o
CC hw/ide/ich.o
CC hw/ide/ahci-allwinner.o
CC hw/input/hid.o
CC hw/input/lm832x.o
CC hw/input/pckbd.o
CC hw/input/pl050.o
CC hw/input/ps2.o
CC hw/input/stellaris_input.o
CC hw/input/tsc2005.o
CC hw/input/virtio-input.o
CC hw/input/virtio-input-hid.o
CC hw/input/vhost-user-input.o
CC hw/intc/i8259_common.o
CC hw/intc/i8259.o
CC hw/intc/pl190.o
CC hw/intc/xlnx-pmu-iomod-intc.o
CC hw/intc/xlnx-zynqmp-ipi.o
CC hw/intc/imx_avic.o
CC hw/intc/imx_gpcv2.o
CC hw/intc/realview_gic.o
CC hw/intc/ioapic_common.o
CC hw/intc/arm_gic_common.o
CC hw/intc/arm_gic.o
CC hw/intc/arm_gicv2m.o
CC hw/intc/arm_gicv3_common.o
CC hw/intc/arm_gicv3.o
CC hw/intc/arm_gicv3_dist.o
CC hw/intc/arm_gicv3_redist.o
CC hw/intc/arm_gicv3_its_common.o
CC hw/intc/intc.o
CC hw/ipack/ipack.o
CC hw/ipack/tpci200.o
CC hw/ipmi/ipmi.o
CC hw/ipmi/ipmi_bmc_sim.o
CC hw/ipmi/ipmi_bmc_extern.o
CC hw/ipmi/isa_ipmi_bt.o
CC hw/ipmi/isa_ipmi_kcs.o
CC hw/isa/isa-bus.o
CC hw/isa/isa-superio.o
CC hw/isa/smc37c669-superio.o
CC hw/isa/apm.o
CC hw/mem/pc-dimm.o
CC hw/mem/memory-device.o
CC hw/mem/nvdimm.o
CC hw/misc/applesmc.o
CC hw/misc/max111x.o
CC hw/misc/tmp105.o
CC hw/misc/tmp421.o
CC hw/misc/debugexit.o
CC hw/misc/sga.o
CC hw/misc/pc-testdev.o
CC hw/misc/pci-testdev.o
CC hw/misc/edu.o
CC hw/misc/unimp.o
CC hw/misc/vmcoreinfo.o
CC hw/misc/arm_l2x0.o
CC hw/misc/arm_integrator_debug.o
/tmp/qemu-test/src/hw/input/vhost-user-input.c:16:10: fatal error: sys/ioctl.h: No such file or directory
#include <sys/ioctl.h>
^~~~~~~~~~~~~compilation terminated.
make: *** [/tmp/qemu-test/src/rules.mak:66: hw/input/vhost-user-input.o] Error 1
make: *** Waiting for unfinished jobs....
CC hw/misc/a9scu.o
Traceback (most recent call last):
File "./tests/docker/docker.py", line 407, in <module>
sys.exit(main())
File "./tests/docker/docker.py", line 404, in main
return args.cmdobj.run(args, argv)
File "./tests/docker/docker.py", line 261, in run
return Docker().run(argv, args.keep, quiet=args.quiet)
File "./tests/docker/docker.py", line 229, in run
quiet=quiet)
File "./tests/docker/docker.py", line 147, in _do_check
return subprocess.check_call(self._command + cmd, **kwargs)
File "/usr/lib64/python2.7/subprocess.py", line 186, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'run', '--label', 'com.qemu.instance.uuid=f5a60be865c011e8818752540069c830', '-u', '0', '--security-opt', 'seccomp=unconfined', '--rm', '--net=none', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=8', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/root/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-q1mu68mb/src/docker-src.2018-06-01-13.26.35.22520:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2 make[1]: *** [tests/docker/Makefile.include:129: docker-run] Error 1
make[1]: Leaving directory '/var/tmp/patchew-tester-tmp-q1mu68mb/src'
make: *** [tests/docker/Makefile.include:163: docker-run-test-mingw@fedora] Error 2
real 1m31.301s
user 0m4.561s
sys 0m3.852s
=== OUTPUT END ===
Test command exited with code: 2
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to [email protected]