[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/23] vhost-vsock: SOCK_SEQPACKET feature bit support
From: |
Michael S. Tsirkin |
Subject: |
[PULL 23/23] vhost-vsock: SOCK_SEQPACKET feature bit support |
Date: |
Tue, 13 Jul 2021 18:11:21 -0400 |
From: Arseny Krasnov <arseny.krasnov@kaspersky.com>
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>
---
hw/virtio/vhost-vsock.c | 12 ++++++++++--
1 file 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 = {
--
MST
- [PULL 12/23] hw/virtio: add vhost-user-i2c-pci boilerplate, (continued)
- [PULL 12/23] hw/virtio: add vhost-user-i2c-pci boilerplate, Michael S. Tsirkin, 2021/07/13
- [PULL 13/23] docs: Add '-device intel-iommu' entry, Michael S. Tsirkin, 2021/07/13
- [PULL 14/23] hw/pci/pci_host: Allow PCI host to bypass iommu, Michael S. Tsirkin, 2021/07/13
- [PULL 15/23] hw/pxb: Add a bypass iommu property, Michael S. Tsirkin, 2021/07/13
- [PULL 17/23] hw/i386: Add a default_bus_bypass_iommu pc machine option, Michael S. Tsirkin, 2021/07/13
- [PULL 18/23] hw/pci: Add pci_bus_range() to get PCI bus number range, Michael S. Tsirkin, 2021/07/13
- [PULL 19/23] hw/arm/virt-acpi-build: Add IORT support to bypass SMMUv3, Michael S. Tsirkin, 2021/07/13
- [PULL 20/23] hw/i386/acpi-build: Add DMAR support to bypass iommu, Michael S. Tsirkin, 2021/07/13
- [PULL 21/23] hw/i386/acpi-build: Add IVRS support to bypass iommu, Michael S. Tsirkin, 2021/07/13
- [PULL 22/23] docs: Add documentation for iommu bypass, Michael S. Tsirkin, 2021/07/13
- [PULL 23/23] vhost-vsock: SOCK_SEQPACKET feature bit support,
Michael S. Tsirkin <=
- [PULL 06/23] bios-tables-test: Update golden binaries, Michael S. Tsirkin, 2021/07/13
- [PULL 04/23] bios-tables-test: Allow changes in DSDT ACPI tables, Michael S. Tsirkin, 2021/07/13
- [PULL 16/23] hw/arm/virt: Add default_bus_bypass_iommu machine option, Michael S. Tsirkin, 2021/07/13
- [PULL 10/23] docs: Add documentation for vhost based RNG implementation, Michael S. Tsirkin, 2021/07/13
- Re: [PULL 00/23] pc,pci,virtio: lots of new features, Peter Maydell, 2021/07/14