aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorArseny Krasnov <arseny.krasnov@kaspersky.com>2021-06-22 17:47:47 +0300
committerMichael S. Tsirkin <mst@redhat.com>2021-07-16 11:10:45 -0400
commit1e08fd0a465d70ad30d2928c66537c816f0af7f8 (patch)
tree696ebfae69521d3b4696ce85113f510d77380740 /hw
parent732de3e72d8872b34b82afb3a5b063b2e0c1c85b (diff)
vhost-vsock: SOCK_SEQPACKET feature bit support
This adds processing of VIRTIO_VSOCK_F_SEQPACKET features bit. Guest negotiates it with vhost, thus both will know that SOCK_SEQPACKET supported by peer. Signed-off-by: Arseny Krasnov <arseny.krasnov@kaspersky.com> Message-Id: <20210622144747.2949134-1-arseny.krasnov@kaspersky.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/virtio/vhost-vsock.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
index 777cafe70d..1b1a5c70ed 100644
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -21,6 +21,11 @@
#include "hw/virtio/vhost-vsock.h"
#include "monitor/monitor.h"
+const int feature_bits[] = {
+ VIRTIO_VSOCK_F_SEQPACKET,
+ VHOST_INVALID_FEATURE_BIT
+};
+
static void vhost_vsock_get_config(VirtIODevice *vdev, uint8_t *config)
{
VHostVSock *vsock = VHOST_VSOCK(vdev);
@@ -108,8 +113,11 @@ static uint64_t vhost_vsock_get_features(VirtIODevice *vdev,
uint64_t requested_features,
Error **errp)
{
- /* No feature bits used yet */
- return requested_features;
+ VHostVSockCommon *vvc = VHOST_VSOCK_COMMON(vdev);
+
+ virtio_add_feature(&requested_features, VIRTIO_VSOCK_F_SEQPACKET);
+ return vhost_get_features(&vvc->vhost_dev, feature_bits,
+ requested_features);
}
static const VMStateDescription vmstate_virtio_vhost_vsock = {