summary refs log tree commit diff stats
path: root/include/hw/virtio
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.bie@intel.com>2018-05-24 18:33:34 +0800
committerMichael S. Tsirkin <mst@redhat.com>2018-05-24 21:14:11 +0300
commit44866521bd6ea8e5152a87664dea1eee90c9438b (patch)
tree5fbb2d5030f33c7a9aa9a9b408b7d63154ed95d7 /include/hw/virtio
parent4d0cf552d3a9585f380e8abdc313e4d416a56aa0 (diff)
downloadfocaccia-qemu-44866521bd6ea8e5152a87664dea1eee90c9438b.tar.gz
focaccia-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/hw/virtio')
-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);