[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 08/10] vhost: Add x-vhost-enable-shadow-vq qmp
From: |
Eugenio Pérez |
Subject: |
[RFC 08/10] vhost: Add x-vhost-enable-shadow-vq qmp |
Date: |
Fri, 29 Jan 2021 21:54:13 +0100 |
Command to enable shadow virtqueue looks like:
{ "execute": "x-vhost-enable-shadow-vq", "arguments": { "name": "dev0",
"enable": true } }
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
---
qapi/net.json | 23 +++++++++++++++++++++++
hw/virtio/vhost.c | 6 ++++++
2 files changed, 29 insertions(+)
diff --git a/qapi/net.json b/qapi/net.json
index c31748c87f..6170d69798 100644
--- a/qapi/net.json
+++ b/qapi/net.json
@@ -77,6 +77,29 @@
##
{ 'command': 'netdev_del', 'data': {'id': 'str'} }
+##
+# @x-vhost-enable-shadow-vq:
+#
+# Use vhost shadow virtqueue.
+#
+# @name: the device name of the virtual network adapter
+#
+# @enable: true to use he alternate shadow VQ notification path
+#
+# Returns: Error if failure, or 'no error' for success
+#
+# Since: 5.3
+#
+# Example:
+#
+# -> { "execute": "x-vhost_enable_shadow_vq", "arguments": {"enable": true} }
+# <- { "return": { "enabled" : true } }
+#
+##
+{ 'command': 'x-vhost-enable-shadow-vq',
+ 'data': {'name': 'str', 'enable': 'bool'},
+ 'if': 'defined(CONFIG_VHOST_KERNEL)' }
+
##
# @NetLegacyNicOptions:
#
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 040f68ff2e..42836e45f3 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -15,6 +15,7 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
+#include "qapi/qapi-commands-net.h"
#include "hw/virtio/vhost.h"
#include "qemu/atomic.h"
#include "qemu/range.h"
@@ -1841,3 +1842,8 @@ int vhost_net_set_backend(struct vhost_dev *hdev,
return -1;
}
+
+void qmp_x_vhost_enable_shadow_vq(const char *name, bool enable, Error **errp)
+{
+ error_setg(errp, "Shadow virtqueue still not implemented.");
+}
--
2.27.0
- [RFC 00/10] vDPA shadow virtqueue - notifications forwarding, Eugenio Pérez, 2021/01/29
- [RFC 01/10] virtio: Add virtqueue_set_handler, Eugenio Pérez, 2021/01/29
- [RFC 02/10] virtio: Add set_vq_handler, Eugenio Pérez, 2021/01/29
- [RFC 03/10] virtio: Add virtio_queue_get_idx, Eugenio Pérez, 2021/01/29
- [RFC 04/10] virtio: Add virtio_queue_host_notifier_status, Eugenio Pérez, 2021/01/29
- [RFC 05/10] vhost: Add vhost_dev_from_virtio, Eugenio Pérez, 2021/01/29
- [RFC 07/10] vhost: Add VhostShadowVirtqueue, Eugenio Pérez, 2021/01/29
- [RFC 06/10] vhost: Save masked_notifier state, Eugenio Pérez, 2021/01/29
- [RFC 08/10] vhost: Add x-vhost-enable-shadow-vq qmp,
Eugenio Pérez <=
- [RFC 10/10] vhost: Route host->guest notification through shadow virtqueue, Eugenio Pérez, 2021/01/29
- [RFC 09/10] vhost: Route guest->host notification through shadow virtqueue, Eugenio Pérez, 2021/01/29