[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v3 19/19] vhost-vsock: SOCK_SEQPACKET feature bit support
From: |
Michael S. Tsirkin |
Subject: |
[PULL v3 19/19] vhost-vsock: SOCK_SEQPACKET feature bit support |
Date: |
Fri, 16 Jul 2021 11:15:47 -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 v3 10/19] hw/pci/pci_host: Allow PCI host to bypass iommu, (continued)
- [PULL v3 10/19] hw/pci/pci_host: Allow PCI host to bypass iommu, Michael S. Tsirkin, 2021/07/16
- [PULL v3 06/19] bios-tables-test: Update golden binaries, Michael S. Tsirkin, 2021/07/16
- [PULL v3 08/19] hw/virtio: add vhost-user-i2c-pci boilerplate, Michael S. Tsirkin, 2021/07/16
- [PULL v3 11/19] hw/pxb: Add a bypass iommu property, Michael S. Tsirkin, 2021/07/16
- [PULL v3 12/19] hw/arm/virt: Add default_bus_bypass_iommu machine option, Michael S. Tsirkin, 2021/07/16
- [PULL v3 14/19] hw/pci: Add pci_bus_range() to get PCI bus number range, Michael S. Tsirkin, 2021/07/16
- [PULL v3 13/19] hw/i386: Add a default_bus_bypass_iommu pc machine option, Michael S. Tsirkin, 2021/07/16
- [PULL v3 15/19] hw/arm/virt-acpi-build: Add IORT support to bypass SMMUv3, Michael S. Tsirkin, 2021/07/16
- [PULL v3 17/19] hw/i386/acpi-build: Add IVRS support to bypass iommu, Michael S. Tsirkin, 2021/07/16
- [PULL v3 18/19] docs: Add documentation for iommu bypass, Michael S. Tsirkin, 2021/07/16
- [PULL v3 19/19] vhost-vsock: SOCK_SEQPACKET feature bit support,
Michael S. Tsirkin <=
- [PULL v3 16/19] hw/i386/acpi-build: Add DMAR support to bypass iommu, Michael S. Tsirkin, 2021/07/16
- Re: [PULL v3 00/19] pc,pci,virtio: lots of new features, Peter Maydell, 2021/07/16