Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / virtio / vhost-vsock-common.h
blob75a74e8a9956af401df0a5be49d76d2498d24ecc
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 "qapi/qapi-types-common.h"
15 #include "hw/virtio/virtio.h"
16 #include "hw/virtio/vhost.h"
17 #include "qom/object.h"
19 #define TYPE_VHOST_VSOCK_COMMON "vhost-vsock-common"
20 OBJECT_DECLARE_SIMPLE_TYPE(VHostVSockCommon, VHOST_VSOCK_COMMON)
22 enum {
23 VHOST_VSOCK_SAVEVM_VERSION = 0,
25 VHOST_VSOCK_QUEUE_SIZE = 128,
28 struct VHostVSockCommon {
29 VirtIODevice parent;
31 struct vhost_virtqueue vhost_vqs[2];
32 struct vhost_dev vhost_dev;
34 VirtQueue *event_vq;
35 VirtQueue *recv_vq;
36 VirtQueue *trans_vq;
38 QEMUTimer *post_load_timer;
40 /* features */
41 OnOffAuto seqpacket;
44 int vhost_vsock_common_start(VirtIODevice *vdev);
45 void vhost_vsock_common_stop(VirtIODevice *vdev);
46 int vhost_vsock_common_pre_save(void *opaque);
47 int vhost_vsock_common_post_load(void *opaque, int version_id);
48 void vhost_vsock_common_realize(VirtIODevice *vdev);
49 void vhost_vsock_common_unrealize(VirtIODevice *vdev);
50 uint64_t vhost_vsock_common_get_features(VirtIODevice *vdev, uint64_t features,
51 Error **errp);
53 #endif /* QEMU_VHOST_VSOCK_COMMON_H */