summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTiwei Bie2018-05-24 12:33:34 +0200
committerMichael S. Tsirkin2018-05-24 20:14:11 +0200
commit44866521bd6ea8e5152a87664dea1eee90c9438b (patch)
tree5fbb2d5030f33c7a9aa9a9b408b7d63154ed95d7 /include
parentvhost-user: introduce shared vhost-user state (diff)
downloadqemu-44866521bd6ea8e5152a87664dea1eee90c9438b.tar.gz
qemu-44866521bd6ea8e5152a87664dea1eee90c9438b.tar.xz
qemu-44866521bd6ea8e5152a87664dea1eee90c9438b.zip
vhost-user: support registering external host notifiers
This patch introduces VHOST_USER_PROTOCOL_F_HOST_NOTIFIER. With this feature negotiated, vhost-user backend can register memory region based host notifiers. And it will allow the guest driver in the VM to notify the hardware accelerator at the vhost-user backend directly. Signed-off-by: Tiwei Bie <tiwei.bie@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/virtio/vhost-user.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/hw/virtio/vhost-user.h b/include/hw/virtio/vhost-user.h
index eb8bc0d90d..fd660393a0 100644
--- a/include/hw/virtio/vhost-user.h
+++ b/include/hw/virtio/vhost-user.h
@@ -9,9 +9,17 @@
#define HW_VIRTIO_VHOST_USER_H
#include "chardev/char-fe.h"
+#include "hw/virtio/virtio.h"
+
+typedef struct VhostUserHostNotifier {
+ MemoryRegion mr;
+ void *addr;
+ bool set;
+} VhostUserHostNotifier;
typedef struct VhostUserState {
CharBackend *chr;
+ VhostUserHostNotifier notifier[VIRTIO_QUEUE_MAX];
} VhostUserState;
VhostUserState *vhost_user_init(void);