Command to set shadow virtqueue mode. Signed-off-by: Eugenio Pérez <epere...@redhat.com> --- qapi/net.json | 22 ++++++++++++++++++++++ net/vhost-vdpa.c | 6 ++++++ 2 files changed, 28 insertions(+)
diff --git a/qapi/net.json b/qapi/net.json index 7fab2e7cd8..b191b6787b 100644 --- a/qapi/net.json +++ b/qapi/net.json @@ -79,6 +79,28 @@ { 'command': 'netdev_del', 'data': {'id': 'str'}, 'allow-preconfig': true } +## +# @x-vhost-set-shadow-vq: +# +# Use vhost shadow virtqueue. +# +# @name: the device name of the VirtIO device +# +# @set: true to use the alternate shadow VQ notifications +# +# Returns: Always error, since SVQ is not implemented at the moment. +# +# Since: 6.2 +# +# Example: +# +# -> { "execute": "x-vhost-set-shadow-vq", +# "arguments": { "name": "virtio-net", "set": false } } +# +## +{ 'command': 'x-vhost-set-shadow-vq', 'data': {'name': 'str', 'set': 'bool'}, + 'if': 'CONFIG_VHOST_VDPA' } + ## # @NetLegacyNicOptions: # diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 49ab322511..3b360da27d 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -18,6 +18,7 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include "qapi/error.h" +#include "qapi/qapi-commands-net.h" #include <linux/vhost.h> #include <sys/ioctl.h> #include <err.h> @@ -301,3 +302,8 @@ err: return -1; } + +void qmp_x_vhost_set_shadow_vq(const char *name, bool set, Error **errp) +{ + error_setg(errp, "Shadow virtqueue still not implemented"); +} -- 2.27.0