mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
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>
This commit is contained in:
parent
4d0cf552d3
commit
44866521bd
3 changed files with 154 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue