virtio: clarify VirtioPCIDeviceTypeInfo usage
PATCH v2 1/1 virtio: clarify VirtioPCIDeviceTypeInfo usage
How to use .base_name, .generic_name, .transitional_name, and .non_transitional_name can be confusing.
Existing devices have .generic_name but its behavior is somewhat magic.
Devices added to new versions of the VIRTIO specification should forego transitional mode completely and always operate in non-transitional mode because there are no existing drivers for them that require backwards compatibility.
This patch adds comments that hopefully make it easier for developers to decide how to fill out VirtioPCIDeviceTypeInfo.
---
v2:
* Drop incorrect mention of machine type compat properties [ehabkost]
--- hw/virtio/virtio-pci.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
hw/virtio/virtio-pci.h +5 -1
@@ -209,7 +209,8 @@ typedef struct VirtioPCIDeviceTypeInfo {* Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE, * but PCI Express is supported only in non-transitional mode. * -* The only type implemented by QEMU 3.1 and older. +* The only type implemented by QEMU 3.1 and older. This type is less +* explicit than the transitional and non-transitional device types. */ const char *generic_name;/*
@@ -222,6 +223,9 @@ typedef struct VirtioPCIDeviceTypeInfo {* The non-transitional device type. Optional. * * Implements INTERFACE_CONVENTIONAL_PCI_DEVICE only. +* +* New virtio device types should only define this and base_name, thereby +* allowing only non-transitional mode. */ const char *non_transitional_name;
Signature · 1 line
2.20.1
Quoted 10 lines · Stefan Hajnoczi
How to use .base_name, .generic_name, .transitional_name, and .non_transitional_name can be confusing.
Existing devices have .generic_name but its behavior is somewhat magic.
Devices added to new versions of the VIRTIO specification should forego transitional mode completely and always operate in non-transitional mode because there are no existing drivers for them that require backwards compatibility.
Quoted 4 lines
This patch adds comments that hopefully make it easier for developers to decide how to fill out VirtioPCIDeviceTypeInfo.
Signed-off-by Stefan Hajnoczi <[email protected]>
Signature · 1 line
Eduardo
Quoted 13 lines · Stefan Hajnoczi
How to use .base_name, .generic_name, .transitional_name, and .non_transitional_name can be confusing.
Existing devices have .generic_name but its behavior is somewhat magic.
Devices added to new versions of the VIRTIO specification should forego transitional mode completely and always operate in non-transitional mode because there are no existing drivers for them that require backwards compatibility.
This patch adds comments that hopefully make it easier for developers to decide how to fill out VirtioPCIDeviceTypeInfo.
Quoted 7 lines
Signed-off-by Stefan Hajnoczi <[email protected]>---
v2:
* Drop incorrect mention of machine type compat properties [ehabkost]--- hw/virtio/virtio-pci.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Michael: This patch is for your virtio tree.
Quoted 28 lines
hw/virtio/virtio-pci.h +5
-1@@ -209,7 +209,8 @@ typedef struct VirtioPCIDeviceTypeInfo {* Implements both INTERFACE_PCIE_DEVICE and INTERFACE_CONVENTIONAL_PCI_DEVICE, * but PCI Express is supported only in non-transitional mode. * -* The only type implemented by QEMU 3.1 and older. +* The only type implemented by QEMU 3.1 and older. This type is less +* explicit than the transitional and non-transitional device types. */ const char *generic_name;/* @@ -222,6 +223,9 @@ typedef struct VirtioPCIDeviceTypeInfo {* The non-transitional device type. Optional. * * Implements INTERFACE_CONVENTIONAL_PCI_DEVICE only. +* +* New virtio device types should only define this and base_name, thereby +* allowing only non-transitional mode. */ const char *non_transitional_name;Signature · 1 line
2.20.1