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