qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* virtio-vsock requires 'disable-legacy=on' in QEMU 5.1
@ 2020-08-13  9:16 Stefano Garzarella
  2020-08-13  9:28 ` Cornelia Huck
  2020-08-13 15:36 ` no-reply
  0 siblings, 2 replies; 15+ messages in thread
From: Stefano Garzarella @ 2020-08-13  9:16 UTC (permalink / raw)
  To: Cornelia Huck, Michael S. Tsirkin
  Cc: Halil Pasic, Qinghua Cheng, qemu devel list, Stefan Hajnoczi

Hi,

Qinghua discovered that virtio-vsock-pci requires 'disable-legacy=on' in
QEMU 5.1:
    $ ./qemu-system-x86_64 ... -device vhost-vsock-pci,guest-cid=5
    qemu-system-x86_64: -device vhost-vsock-pci,guest-cid=5:
    device is modern-only, use disable-legacy=on

Bisecting I found that this behaviour starts from this commit:
9b3a35ec82 ("virtio: verify that legacy support is not accidentally on")

IIUC virtio-vsock is modern-only, so I tried this patch and it works:

diff --git a/hw/virtio/vhost-user-vsock-pci.c b/hw/virtio/vhost-user-vsock-pci.c
index f4cf95873d..6e4cc874cd 100644
--- a/hw/virtio/vhost-user-vsock-pci.c
+++ b/hw/virtio/vhost-user-vsock-pci.c
@@ -40,6 +40,7 @@ static void vhost_user_vsock_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VHostUserVSockPCI *dev = VHOST_USER_VSOCK_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);

+    virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }

diff --git a/hw/virtio/vhost-vsock-pci.c b/hw/virtio/vhost-vsock-pci.c
index a815278e69..f641b974e9 100644
--- a/hw/virtio/vhost-vsock-pci.c
+++ b/hw/virtio/vhost-vsock-pci.c
@@ -44,6 +44,7 @@ static void vhost_vsock_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VHostVSockPCI *dev = VHOST_VSOCK_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&dev->vdev);

+    virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }


Do you think this is the right approach or is there a better way to
solve this issue?

Thanks,
Stefano



^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-08-19  9:49 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-13  9:16 virtio-vsock requires 'disable-legacy=on' in QEMU 5.1 Stefano Garzarella
2020-08-13  9:28 ` Cornelia Huck
2020-08-13 10:24   ` Stefano Garzarella
2020-08-13 10:37     ` Cornelia Huck
2020-08-13 12:04       ` Stefano Garzarella
2020-08-17 10:27         ` Cornelia Huck
2020-08-17 13:11           ` Stefano Garzarella
2020-08-17 14:37             ` Cornelia Huck
2020-08-18 12:44             ` Cornelia Huck
2020-08-18 14:01               ` Stefano Garzarella
2020-08-18 14:31                 ` Cornelia Huck
2020-08-18 15:28                   ` Stefano Garzarella
2020-08-18 15:49                     ` Cornelia Huck
2020-08-19  9:48       ` Auger Eric
2020-08-13 15:36 ` no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).