MAINTAINERS: Make section QOM cover hw/core/*bus.c as well
[qemu/armbru.git] / include / hw / virtio / vhost-vsock-common.h
blobf8b4aaae007ca8ba37b6c2d377fc9d2a27c7c657
1 /*
2 * Parent class for vhost-vsock devices
4 * Copyright 2015-2020 Red Hat, Inc.
6 * This work is licensed under the terms of the GNU GPL, version 2 or
7 * (at your option) any later version. See the COPYING file in the
8 * top-level directory.
9 */
11 #ifndef _QEMU_VHOST_VSOCK_COMMON_H
12 #define _QEMU_VHOST_VSOCK_COMMON_H
14 #include "hw/virtio/virtio.h"
15 #include "hw/virtio/vhost.h"
17 #define TYPE_VHOST_VSOCK_COMMON "vhost-vsock-common"
18 #define VHOST_VSOCK_COMMON(obj) \
19 OBJECT_CHECK(VHostVSockCommon, (obj), TYPE_VHOST_VSOCK_COMMON)
21 enum {
22 VHOST_VSOCK_SAVEVM_VERSION = 0,
24 VHOST_VSOCK_QUEUE_SIZE = 128,
27 typedef struct {
28 VirtIODevice parent;
30 struct vhost_virtqueue vhost_vqs[2];
31 struct vhost_dev vhost_dev;
33 VirtQueue *event_vq;
34 VirtQueue *recv_vq;
35 VirtQueue *trans_vq;
37 QEMUTimer *post_load_timer;
38 } VHostVSockCommon;
40 int vhost_vsock_common_start(VirtIODevice *vdev);
41 void vhost_vsock_common_stop(VirtIODevice *vdev);
42 int vhost_vsock_common_pre_save(void *opaque);
43 int vhost_vsock_common_post_load(void *opaque, int version_id);
44 void vhost_vsock_common_realize(VirtIODevice *vdev, const char *name);
45 void vhost_vsock_common_unrealize(VirtIODevice *vdev);
47 #endif /* _QEMU_VHOST_VSOCK_COMMON_H */