aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2021-09-21 18:16:42 +0200
committerMichael S. Tsirkin <mst@redhat.com>2021-10-05 17:30:57 -0400
commit46ce017167d800c5d96104a88cfaed9949c4a3b6 (patch)
tree5bedeb120bd36db6d4a98cf1435eff101c34f5b1 /include
parentd6a9378f47515c6d70dbff4912c5740c98709880 (diff)
downloadqemu-46ce017167d800c5d96104a88cfaed9949c4a3b6.zip
qemu-46ce017167d800c5d96104a88cfaed9949c4a3b6.tar.gz
qemu-46ce017167d800c5d96104a88cfaed9949c4a3b6.tar.bz2
vhost-vsock: handle common features in vhost-vsock-common
virtio-vsock features, like VIRTIO_VSOCK_F_SEQPACKET, can be handled by vhost-vsock-common parent class. In this way, we can reuse the same code for all virtio-vsock backends (i.e. vhost-vsock, vhost-user-vsock). Let's move `seqpacket` property to vhost-vsock-common class, add vhost_vsock_common_get_features() used by children, and disable `seqpacket` for vhost-user-vsock device for machine types < 6.2. The behavior of vhost-vsock device doesn't change; vhost-user-vsock device now supports `seqpacket` property. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Message-Id: <20210921161642.206461-3-sgarzare@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/hw/virtio/vhost-vsock-common.h5
-rw-r--r--include/hw/virtio/vhost-vsock.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/include/hw/virtio/vhost-vsock-common.h b/include/hw/virtio/vhost-vsock-common.h
index e412b5e..d8b565b 100644
--- a/include/hw/virtio/vhost-vsock-common.h
+++ b/include/hw/virtio/vhost-vsock-common.h
@@ -35,6 +35,9 @@ struct VHostVSockCommon {
VirtQueue *trans_vq;
QEMUTimer *post_load_timer;
+
+ /* features */
+ OnOffAuto seqpacket;
};
int vhost_vsock_common_start(VirtIODevice *vdev);
@@ -43,5 +46,7 @@ int vhost_vsock_common_pre_save(void *opaque);
int vhost_vsock_common_post_load(void *opaque, int version_id);
void vhost_vsock_common_realize(VirtIODevice *vdev, const char *name);
void vhost_vsock_common_unrealize(VirtIODevice *vdev);
+uint64_t vhost_vsock_common_get_features(VirtIODevice *vdev, uint64_t features,
+ Error **errp);
#endif /* _QEMU_VHOST_VSOCK_COMMON_H */
diff --git a/include/hw/virtio/vhost-vsock.h b/include/hw/virtio/vhost-vsock.h
index 3f121a6..84f4e72 100644
--- a/include/hw/virtio/vhost-vsock.h
+++ b/include/hw/virtio/vhost-vsock.h
@@ -30,9 +30,6 @@ struct VHostVSock {
VHostVSockCommon parent;
VHostVSockConf conf;
- /* features */
- OnOffAuto seqpacket;
-
/*< public >*/
};