qemu/contrib
Stefan Hajnoczi 6f5fd83788 libvhost-user: support many virtqueues
Currently libvhost-user is hardcoded to at most 8 virtqueues.  The
device backend should decide the number of virtqueues, not
libvhost-user.  This is important for multiqueue device backends where
the guest driver needs an accurate number of virtqueues.

This change breaks libvhost-user and libvhost-user-glib API stability.
There is no stability guarantee yet, so make this change now and update
all in-tree library users.

This patch touches up vhost-user-blk, vhost-user-gpu, vhost-user-input,
vhost-user-scsi, and vhost-user-bridge.  If the device has a fixed
number of queues that exact number is used.  Otherwise the previous
default of 8 virtqueues is used.

vu_init() and vug_init() can now fail if malloc() returns NULL.  I
considered aborting with an error in libvhost-user but it should be safe
to instantiate new vhost-user instances at runtime without risk of
terminating the process.  Therefore callers need to handle the vu_init()
failure now.

vhost-user-blk and vhost-user-scsi duplicate virtqueue index checks that
are already performed by libvhost-user.  This code would need to be
modified to use max_queues but remove it completely instead since it's
redundant.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190626074815.19994-3-stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-07-04 17:00:32 -04:00
..
elf2dmp Clean up a few header guard symbols 2019-06-12 13:20:20 +02:00
gitdm contrib: gitdm: add a mapping for Janus Technologies 2019-03-12 19:31:29 +00:00
ivshmem-client Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
ivshmem-server Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
libvhost-user libvhost-user: support many virtqueues 2019-07-04 17:00:32 -04:00
rdmacm-mux Use #include "..." for our own headers, <...> for others 2019-05-13 08:58:55 +02:00
systemd contrib: add systemd unit files 2017-12-20 22:29:26 +01:00
vhost-user-blk libvhost-user: support many virtqueues 2019-07-04 17:00:32 -04:00
vhost-user-gpu libvhost-user: support many virtqueues 2019-07-04 17:00:32 -04:00
vhost-user-input libvhost-user: support many virtqueues 2019-07-04 17:00:32 -04:00
vhost-user-scsi libvhost-user: support many virtqueues 2019-07-04 17:00:32 -04:00