2020-05-22 15:25:10 +03:00
|
|
|
/*
|
|
|
|
* Parent class for vhost-vsock devices
|
|
|
|
*
|
|
|
|
* Copyright 2015-2020 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or
|
|
|
|
* (at your option) any later version. See the COPYING file in the
|
|
|
|
* top-level directory.
|
|
|
|
*/
|
|
|
|
|
2022-05-06 16:49:09 +03:00
|
|
|
#ifndef QEMU_VHOST_VSOCK_COMMON_H
|
|
|
|
#define QEMU_VHOST_VSOCK_COMMON_H
|
2020-05-22 15:25:10 +03:00
|
|
|
|
2024-02-05 10:47:07 +03:00
|
|
|
#include "qapi/qapi-types-common.h"
|
2020-05-22 15:25:10 +03:00
|
|
|
#include "hw/virtio/virtio.h"
|
|
|
|
#include "hw/virtio/vhost.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2020-05-22 15:25:10 +03:00
|
|
|
|
|
|
|
#define TYPE_VHOST_VSOCK_COMMON "vhost-vsock-common"
|
2020-09-16 21:25:19 +03:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(VHostVSockCommon, VHOST_VSOCK_COMMON)
|
2020-05-22 15:25:10 +03:00
|
|
|
|
|
|
|
enum {
|
|
|
|
VHOST_VSOCK_SAVEVM_VERSION = 0,
|
|
|
|
|
|
|
|
VHOST_VSOCK_QUEUE_SIZE = 128,
|
|
|
|
};
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct VHostVSockCommon {
|
2020-05-22 15:25:10 +03:00
|
|
|
VirtIODevice parent;
|
|
|
|
|
|
|
|
struct vhost_virtqueue vhost_vqs[2];
|
|
|
|
struct vhost_dev vhost_dev;
|
|
|
|
|
|
|
|
VirtQueue *event_vq;
|
|
|
|
VirtQueue *recv_vq;
|
|
|
|
VirtQueue *trans_vq;
|
|
|
|
|
|
|
|
QEMUTimer *post_load_timer;
|
2021-09-21 19:16:42 +03:00
|
|
|
|
|
|
|
/* features */
|
|
|
|
OnOffAuto seqpacket;
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2020-05-22 15:25:10 +03:00
|
|
|
|
|
|
|
int vhost_vsock_common_start(VirtIODevice *vdev);
|
|
|
|
void vhost_vsock_common_stop(VirtIODevice *vdev);
|
|
|
|
int vhost_vsock_common_pre_save(void *opaque);
|
|
|
|
int vhost_vsock_common_post_load(void *opaque, int version_id);
|
2022-04-01 16:23:18 +03:00
|
|
|
void vhost_vsock_common_realize(VirtIODevice *vdev);
|
2020-05-22 15:25:10 +03:00
|
|
|
void vhost_vsock_common_unrealize(VirtIODevice *vdev);
|
2021-09-21 19:16:42 +03:00
|
|
|
uint64_t vhost_vsock_common_get_features(VirtIODevice *vdev, uint64_t features,
|
|
|
|
Error **errp);
|
2020-05-22 15:25:10 +03:00
|
|
|
|
2022-05-06 16:49:09 +03:00
|
|
|
#endif /* QEMU_VHOST_VSOCK_COMMON_H */
|