xref: /openbmc/qemu/include/hw/virtio/vhost-vsock.h (revision a9ded601)
1 /*
2  * Vhost vsock virtio device
3  *
4  * Copyright 2015 Red Hat, Inc.
5  *
6  * Authors:
7  *  Stefan Hajnoczi <stefanha@redhat.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2 or
10  * (at your option) any later version.  See the COPYING file in the
11  * top-level directory.
12  */
13 
14 #ifndef _QEMU_VHOST_VSOCK_H
15 #define _QEMU_VHOST_VSOCK_H
16 
17 #include "hw/virtio/virtio.h"
18 #include "hw/virtio/vhost.h"
19 
20 #define TYPE_VHOST_VSOCK "vhost-vsock-device"
21 #define VHOST_VSOCK(obj) \
22         OBJECT_CHECK(VHostVSock, (obj), TYPE_VHOST_VSOCK)
23 
24 typedef struct {
25     uint64_t guest_cid;
26     char *vhostfd;
27 } VHostVSockConf;
28 
29 typedef struct {
30     /*< private >*/
31     VirtIODevice parent;
32     VHostVSockConf conf;
33     struct vhost_virtqueue vhost_vqs[2];
34     struct vhost_dev vhost_dev;
35     VirtQueue *event_vq;
36     QEMUTimer *post_load_timer;
37 
38     /*< public >*/
39 } VHostVSock;
40 
41 #endif /* _QEMU_VHOST_VSOCK_H */
42