hw/s390x/ccw: Mark virtio-pci disable-legacy property as optional
PATCH 1/1 hw/s390x/ccw: Mark virtio-pci disable-legacy property as optional
The s390-ccw-virtio-11.0 compatibility property for TYPE_VIRTIO_PCI "disable-legacy" causes QEMU to abort when instantiating vhost-user-fs-pci devices:
Unexpected error in object_property_find_err() at ../qom/object.c:1284:
qemu-system-s390x: -device vhost-user-fs-pci: can't apply global virtio-pci.disable-legacy=off: Property 'vhost-user-fs-pci.disable-legacy' not found
The issue occurs because some vhost-user devices like vhost-user-fs-pci only implement the non-transitional variant and do not define a generic device type. Non-transitional devices have disable-legacy hardcoded to "on" and do not expose it as a property, while only generic device types have the "disable-legacy" property. This affects users running older machine versions (11.0 and earlier) even when using the latest QEMU version.
Mark the global property as optional so it only applies to devices that actually have the property, allowing vhost-user devices without a generic variant to be instantiated successfully on older machine versions.
--- hw/s390x/s390-virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/s390x/s390-virtio-ccw.c +1 -1
@@ -946,7 +946,7 @@ static void ccw_machine_11_0_class_options(MachineClass *mc)* keep legacy virtio-pci enabled. */ static GlobalProperty compat[] = { - {TYPE_VIRTIO_PCI ,"disable-legacy" ,"off" }, + {TYPE_VIRTIO_PCI ,"disable-legacy" ,"off" , .optional = true }, };ccw_machine_11_1_class_options (mc);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat));
Signature · 1 line
2.54.0
Quoted 19 lines · Jaehoon Kim
The s390-ccw-virtio-11.0 compatibility property for
TYPE_VIRTIO_PCI"disable-legacy" causes QEMU to abort when instantiating vhost-user-fs-pci devices:Unexpected error in
object_property_find_err()at../qom/object.c:1284:
qemu-system-s390x: -device vhost-user-fs-pci: can't apply global virtio-pci.disable-legacy=off: Property 'vhost-user-fs-pci.disable-legacy' not foundThe issue occurs because some vhost-user devices like vhost-user-fs-pci only implement the non-transitional variant and do not define a generic device type. Non-transitional devices have disable-legacy hardcoded to "on" and do not expose it as a property, while only generic device types have the "disable-legacy" property. This affects users running older machine versions (11.0 and earlier) even when using the latest QEMU version.
Quoted 7 lines
Mark the global property as optional so it only applies to devices that actually have the property, allowing vhost-user devices without a generic variant to be instantiated successfully on older machine versions.
Fixes 26103c13cff0 ("hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)")Signed-off-by Jaehoon Kim <[email protected]>
Thanks Jaehoon. I was able to reproduce as well and confirmed that this patch resolves the issue.
Quoted 35 lines · Jaehoon Kim
The s390-ccw-virtio-11.0 compatibility property for
TYPE_VIRTIO_PCI"disable-legacy" causes QEMU to abort when instantiating vhost-user-fs-pci devices:Unexpected error in
object_property_find_err()at../qom/object.c:1284:
qemu-system-s390x: -device vhost-user-fs-pci: can't apply global virtio-pci.disable-legacy=off: Property 'vhost-user-fs-pci.disable-legacy' not foundThe issue occurs because some vhost-user devices like vhost-user-fs-pci only implement the non-transitional variant and do not define a generic device type. Non-transitional devices have disable-legacy hardcoded to "on" and do not expose it as a property, while only generic device types have the "disable-legacy" property. This affects users running older machine versions (11.0 and earlier) even when using the latest QEMU version.
Mark the global property as optional so it only applies to devices that actually have the property, allowing vhost-user devices without a generic variant to be instantiated successfully on older machine versions.
Fixes 26103c13cff0 ("hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)")Signed-off-by Jaehoon Kim <[email protected]>--- hw/s390x/s390-virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)hw/s390x/s390-virtio-ccw.c +0
-0
hw/s390x/s390-virtio-ccw.c static void ccw_machine_11_0_class_options(MachineClass *mc) · line 952
Quoted 8 lines
hw/s390x/s390-virtio-ccw.c +1
-1@@ -946,7 +946,7 @@ static void ccw_machine_11_0_class_options(MachineClass *mc)* keep legacy virtio-pci enabled. */ static GlobalProperty compat[] = { - {TYPE_VIRTIO_PCI ,"disable-legacy" ,"off" }, + {TYPE_VIRTIO_PCI ,"disable-legacy" ,"off" , .optional = true }, };ccw_machine_11_1_class_options (mc);compat_props_add (mc->compat_props, compat,G_N_ELEMENTS (compat));
Thanks, queued to s390-next.