Skip to contentSkip to conversation

virtio-pmem-pci: force virtio version 1

PATCH In review Pankaj Gupta 3 participants 5 messages Sep 25, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-pmem-pci: force virtio version 1

Qemu fails with below error when trying to run with virtio pmem:

(qemu) qemu-system-x86_64: -device virtio-pmem-pci,memdev=mem1,id=nv1:
device is modern-only, use disable-legacy=on

This patch fixes this by forcing virtio 1 with virtio-pmem.

Fixes adf0748a49 ("virtio-pci: Proxy for virtio-pmem")
---
 hw/virtio/virtio-pmem-pci.c | 1 +
 1 file changed, 1 insertion(+)
hw/virtio/virtio-pmem-pci.c +1 -0
index 21a457d151..2b2a0b1eae 100644
@@ -22,6 +22,7 @@ static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOPMEMPCI *pmem_pci = VIRTIO_PMEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&pmem_pci->vdev);
 
+    virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · Pankaj Gupta

Qemu fails with below error when trying to run with virtio pmem:

(qemu) qemu-system-x86_64: -device virtio-pmem-pci,memdev=mem1,id=nv1:
device is modern-only, use disable-legacy=on

This patch fixes this by forcing virtio 1 with virtio-pmem.

Fixes adf0748a49 ("virtio-pci: Proxy for virtio-pmem")
---
 hw/virtio/virtio-pmem-pci.c | 1 +
 1 file changed, 1 insertion(+)
hw/virtio/virtio-pmem-pci.c +0 -0
index 21a457d151..2b2a0b1eae 100644

hw/virtio/virtio-pmem-pci.c static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) · line 28

Quoted 7 lines
hw/virtio/virtio-pmem-pci.c +1 -0
@@ -22,6 +22,7 @@ static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOPMEMPCI *pmem_pci = VIRTIO_PMEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&pmem_pci->vdev);
 
+    virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 
Signature · 3 lines
Thanks,

David / dhildenb
#2 lore raw
In reply to Pankaj Gupta
Quoted 4 lines · On Fri, 25 Sep 2020 12:22:51 +0200 Pankaj Gupta <[email protected]>…

Qemu fails with below error when trying to run with virtio pmem:

(qemu) qemu-system-x86_64: -device virtio-pmem-pci,memdev=mem1,id=nv1:
device is modern-only, use disable-legacy=on

Oh, another one :(

Quoted 14 lines

This patch fixes this by forcing virtio 1 with virtio-pmem.

Fixes adf0748a49 ("virtio-pci: Proxy for virtio-pmem")
---
 hw/virtio/virtio-pmem-pci.c | 1 +
 1 file changed, 1 insertion(+)
hw/virtio/virtio-pmem-pci.c +0 -0
index 21a457d151..2b2a0b1eae 100644

hw/virtio/virtio-pmem-pci.c static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) · line 28

Quoted 7 lines
hw/virtio/virtio-pmem-pci.c +1 -0
@@ -22,6 +22,7 @@ static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOPMEMPCI *pmem_pci = VIRTIO_PMEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&pmem_pci->vdev);
 
+    virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 

The alternative would be to force virtio 1 only for 5.1 and later (see
https://lore.kernel.org/qemu-devel/[email protected]/).

#3 lore raw
Quoted 7 lines
Quoted 5 lines

Qemu fails with below error when trying to run with virtio pmem:

(qemu) qemu-system-x86_64: -device virtio-pmem-pci,memdev=mem1,id=nv1:
device is modern-only, use disable-legacy=on

Oh, another one :(

:)

Quoted 18 lines
Quoted 18 lines

This patch fixes this by forcing virtio 1 with virtio-pmem.

Fixes adf0748a49 ("virtio-pci: Proxy for virtio-pmem")
---
 hw/virtio/virtio-pmem-pci.c | 1 +
 1 file changed, 1 insertion(+)
hw/virtio/virtio-pmem-pci.c +0 -0
index 21a457d151..2b2a0b1eae 100644
@@ -22,6 +22,7 @@ static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOPMEMPCI *pmem_pci = VIRTIO_PMEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&pmem_pci->vdev);
 
Quoted 7 lines

hw/virtio/virtio-pmem-pci.c static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) · line 28

Quoted 4 lines
hw/virtio/virtio-pmem-pci.c +1 -0
+    virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 

The alternative would be to force virtio 1 only for 5.1 and later (see
https://lore.kernel.org/qemu-devel/[email protected]/).

Thanks for sharing this. It's still good to mark virtio pmem as a modern virtio device.

Best regards,
Pankaj

Quoted 1 line
Acked-by
#4 lore raw
Quoted 34 lines · On Fri, 25 Sep 2020 13:49:05 +0200 Pankaj Gupta <[email protected]>…
Quoted 7 lines
Quoted 5 lines

Qemu fails with below error when trying to run with virtio pmem:

(qemu) qemu-system-x86_64: -device virtio-pmem-pci,memdev=mem1,id=nv1:
device is modern-only, use disable-legacy=on

Oh, another one :(

:)

Quoted 18 lines
Quoted 18 lines

This patch fixes this by forcing virtio 1 with virtio-pmem.

Fixes adf0748a49 ("virtio-pci: Proxy for virtio-pmem")
---
 hw/virtio/virtio-pmem-pci.c | 1 +
 1 file changed, 1 insertion(+)
hw/virtio/virtio-pmem-pci.c +0 -0
index 21a457d151..2b2a0b1eae 100644
@@ -22,6 +22,7 @@ static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp)
     VirtIOPMEMPCI *pmem_pci = VIRTIO_PMEM_PCI(vpci_dev);
     DeviceState *vdev = DEVICE(&pmem_pci->vdev);
 
Quoted 7 lines

hw/virtio/virtio-pmem-pci.c static void virtio_pmem_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) · line 28

Quoted 4 lines
hw/virtio/virtio-pmem-pci.c +1 -0
+    virtio_pci_force_virtio_1(vpci_dev);
     qdev_realize(vdev, BUS(&vpci_dev->bus), errp);
 }
 

The alternative would be to force virtio 1 only for 5.1 and later (see
https://lore.kernel.org/qemu-devel/[email protected]/).

Quoted 2 lines

Thanks for sharing this. It's still good to mark virtio pmem as a modern virtio device.

If you don't really need to care about compat handling, forcing virtio 1 is fine.