8 /* Generic structures common for any vhost based device. */
9 struct vhost_virtqueue
{
16 unsigned long long used_phys
;
19 unsigned long long ring_phys
;
23 typedef unsigned long vhost_log_chunk_t
;
24 #define VHOST_LOG_PAGE 0x1000
25 #define VHOST_LOG_BITS (8 * sizeof(vhost_log_chunk_t))
26 #define VHOST_LOG_CHUNK (VHOST_LOG_PAGE * VHOST_LOG_BITS)
30 MemoryListener memory_listener
;
32 struct vhost_memory
*mem
;
34 MemoryRegionSection
*mem_sections
;
35 struct vhost_virtqueue
*vqs
;
37 unsigned long long features
;
38 unsigned long long acked_features
;
39 unsigned long long backend_features
;
42 vhost_log_chunk_t
*log
;
43 unsigned long long log_size
;
47 int vhost_dev_init(struct vhost_dev
*hdev
, int devfd
, bool force
);
48 void vhost_dev_cleanup(struct vhost_dev
*hdev
);
49 bool vhost_dev_query(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);
50 int vhost_dev_start(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);
51 void vhost_dev_stop(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);
52 int vhost_dev_enable_notifiers(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);
53 void vhost_dev_disable_notifiers(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);