7 /* Generic structures common for any vhost based device. */
8 struct vhost_virtqueue
{
15 unsigned long long used_phys
;
18 unsigned long long ring_phys
;
22 typedef unsigned long vhost_log_chunk_t
;
23 #define VHOST_LOG_PAGE 0x1000
24 #define VHOST_LOG_BITS (8 * sizeof(vhost_log_chunk_t))
25 #define VHOST_LOG_CHUNK (VHOST_LOG_PAGE * VHOST_LOG_BITS)
29 CPUPhysMemoryClient client
;
31 struct vhost_memory
*mem
;
32 struct vhost_virtqueue
*vqs
;
34 unsigned long long features
;
35 unsigned long long acked_features
;
36 unsigned long long backend_features
;
39 vhost_log_chunk_t
*log
;
40 unsigned long long log_size
;
44 int vhost_dev_init(struct vhost_dev
*hdev
, int devfd
, bool force
);
45 void vhost_dev_cleanup(struct vhost_dev
*hdev
);
46 bool vhost_dev_query(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);
47 int vhost_dev_start(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);
48 void vhost_dev_stop(struct vhost_dev
*hdev
, VirtIODevice
*vdev
);