44866521bd
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>
29 lines
636 B
C
29 lines
636 B
C
/*
|
|
* Copyright (c) 2017-2018 Intel Corporation
|
|
*
|
|
* This work is licensed under the terms of the GNU GPL, version 2.
|
|
* See the COPYING file in the top-level directory.
|
|
*/
|
|
|
|
#ifndef HW_VIRTIO_VHOST_USER_H
|
|
#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);
|
|
void vhost_user_cleanup(VhostUserState *user);
|
|
|
|
#endif
|