xref: /openbmc/qemu/include/hw/virtio/vhost-user.h (revision 56534930b5cd3a6c7259cfeba69f08ba28c8f62a)
1 /*
2  * Copyright (c) 2017-2018 Intel Corporation
3  *
4  * This work is licensed under the terms of the GNU GPL, version 2.
5  * See the COPYING file in the top-level directory.
6  */
7 
8 #ifndef HW_VIRTIO_VHOST_USER_H
9 #define HW_VIRTIO_VHOST_USER_H
10 
11 #include "chardev/char-fe.h"
12 #include "hw/virtio/virtio.h"
13 
14 typedef struct VhostUserHostNotifier {
15     struct rcu_head rcu;
16     MemoryRegion mr;
17     void *addr;
18     void *unmap_addr;
19 } VhostUserHostNotifier;
20 
21 typedef struct VhostUserState {
22     CharBackend *chr;
23     VhostUserHostNotifier notifier[VIRTIO_QUEUE_MAX];
24     int memory_slots;
25     bool supports_config;
26 } VhostUserState;
27 
28 bool vhost_user_init(VhostUserState *user, CharBackend *chr, Error **errp);
29 void vhost_user_cleanup(VhostUserState *user);
30 
31 #endif
32