[PATCH 0/3] Full boot order support on s390x

This series adds on s390x full boot order support which has been introduced recently in QEMU with the PR https://lore.kernel.org/qemu-devel/20241023131710.906748-1-thuth@redhat.com/ The replies and xml files are removed from the patch in this series and are available in https://gitlab.com/fiuczy/libvirt/-/commits/fullbootorder Boris Fiuczynski (3): qemu: capabilities: Add QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM tests: add capabilities for QEMU 9.2.0 on s390x qemu: command: add multi boot device support on s390x src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 40 +- src/qemu/qemu_command.h | 6 +- src/qemu/qemu_hotplug.c | 6 +- tests/domaincapsdata/qemu_9.2.0.s390x.xml | 311 + .../caps_5.2.0_s390x.replies | 321 +- .../caps_6.0.0_s390x.replies | 321 +- .../caps_8.1.0_s390x.replies | 321 +- .../caps_8.2.0_s390x.replies | 321 +- .../caps_9.1.0_s390x.replies | 321 +- .../caps_9.2.0_s390x.replies | 36741 ++++++++++++++++ .../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 3752 ++ .../machine-loadparm-hostdev.s390x-9.1.0.args | 33 + .../machine-loadparm-hostdev.s390x-9.1.0.xml | 33 + ...machine-loadparm-hostdev.s390x-latest.args | 4 +- ...-multiple-disks-nets-s390.s390x-9.1.0.args | 40 + ...m-multiple-disks-nets-s390.s390x-9.1.0.xml | 51 + ...multiple-disks-nets-s390.s390x-latest.args | 8 +- ...machine-loadparm-net-s390.s390x-9.1.0.args | 34 + .../machine-loadparm-net-s390.s390x-9.1.0.xml | 32 + ...achine-loadparm-net-s390.s390x-latest.args | 4 +- .../machine-loadparm-s390.s390x-9.1.0.args | 34 + .../machine-loadparm-s390.s390x-9.1.0.xml | 33 + .../machine-loadparm-s390.s390x-latest.args | 4 +- tests/qemuxmlconftest.c | 4 + 26 files changed, 42664 insertions(+), 120 deletions(-) create mode 100644 tests/domaincapsdata/qemu_9.2.0.s390x.xml create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml -- 2.45.0

Add capability QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM to detect multi boot device support in QEMU by checking the virtio-blk-ccw device property existence of loadparm. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + .../caps_5.2.0_s390x.replies | 321 ++++++++++++++++-- .../caps_6.0.0_s390x.replies | 321 ++++++++++++++++-- .../caps_8.1.0_s390x.replies | 321 ++++++++++++++++-- .../caps_8.2.0_s390x.replies | 321 ++++++++++++++++-- .../caps_9.1.0_s390x.replies | 321 ++++++++++++++++-- 7 files changed, 1514 insertions(+), 100 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 38fdade255..6b67da30ec 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -719,6 +719,7 @@ VIR_ENUM_IMPL(virQEMUCaps, /* 465 */ "snapshot-internal-qmp", /* QEMU_CAPS_SNAPSHOT_INTERNAL_QMP */ "chardev-reconnect-miliseconds", /* QEMU_CAPS_CHARDEV_RECONNECT_MILISECONDS */ + "virtio-ccw.loadparm", /* QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM */ ); @@ -1547,6 +1548,10 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioIOMMU[] = { "boot-bypass", QEMU_CAPS_VIRTIO_IOMMU_BOOT_BYPASS, NULL }, }; +static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioBlkCCW[] = { + { "loadparm", QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM, NULL }, +}; + /* see documentation for virQEMUQAPISchemaPathGet for the query format */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { { "blockdev-add/arg-type/+file/drop-cache", QEMU_CAPS_MIGRATION_FILE_DROP_CACHE }, @@ -1704,6 +1709,9 @@ static virQEMUCapsDeviceTypeProps virQEMUCapsDeviceProps[] = { { "virtio-iommu-pci", virQEMUCapsDevicePropsVirtioIOMMU, G_N_ELEMENTS(virQEMUCapsDevicePropsVirtioIOMMU), QEMU_CAPS_DEVICE_VIRTIO_IOMMU_PCI }, + { "virtio-blk-ccw", virQEMUCapsDevicePropsVirtioBlkCCW, + G_N_ELEMENTS(virQEMUCapsDevicePropsVirtioBlkCCW), + QEMU_CAPS_VIRTIO_CCW }, }; static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 261abcc1b4..e49fda6721 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -698,6 +698,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ /* 465 */ QEMU_CAPS_SNAPSHOT_INTERNAL_QMP, /* internal snapshot support via QMP commands 'snapshot-save'/'snapshot-delete' */ QEMU_CAPS_CHARDEV_RECONNECT_MILISECONDS, /* 'reconnect-ms' option for chardevs supported */ + QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM, /* loadparm available on CCW device for multi device boot */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_5.2.0_s390x.replies b/tests/qemucapabilitiesdata/caps_5.2.0_s390x.replies index 3dfd0b502d..4ee6725d90 100644 --- a/tests/qemucapabilitiesdata/caps_5.2.0_s390x.replies +++ b/tests/qemucapabilitiesdata/caps_5.2.0_s390x.replies @@ -18830,12 +18830,293 @@ "id": "libvirt-28" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "virtio-blk-ccw" + }, + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "dev_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "devno", + "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "subch_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "default-value": 2, + "name": "max_revision", + "type": "uint32" + }, + { + "default-value": true, + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "default-value": false, + "name": "share-rw", + "type": "bool" + }, + { + "default-value": 0, + "name": "lcyls", + "type": "uint32" + }, + { + "default-value": 256, + "name": "queue-size", + "type": "uint16" + }, + { + "default-value": 0, + "name": "lsecs", + "type": "uint32" + }, + { + "default-value": 0, + "name": "heads", + "type": "uint32" + }, + { + "default-value": "auto", + "name": "account-invalid", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "default-value": 0, + "name": "lheads", + "type": "uint32" + }, + { + "default-value": 65535, + "name": "num-queues", + "type": "uint16" + }, + { + "default-value": 0, + "name": "cyls", + "type": "uint32" + }, + { + "default-value": 0, + "name": "secs", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-blk-device>" + }, + { + "default-value": 0, + "name": "min_io_size", + "type": "size" + }, + { + "name": "bootindex", + "type": "int32" + }, + { + "default-value": true, + "name": "config-wce", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "seg-max-adjust", + "type": "bool" + }, + { + "name": "drive", + "description": "Node name or ID of a block device to use as a backend", + "type": "str" + }, + { + "default-value": "auto", + "name": "werror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": true, + "name": "report-discard-granularity", + "type": "bool" + }, + { + "default-value": "auto", + "name": "rerror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": "auto", + "name": "write-cache", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "use-disabled-flag", + "type": "bool" + }, + { + "default-value": false, + "name": "x-disable-legacy-check", + "type": "bool" + }, + { + "default-value": true, + "name": "use-started", + "type": "bool" + }, + { + "default-value": false, + "name": "iommu_platform", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "physical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": false, + "name": "scsi", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "opt_io_size", + "type": "size" + }, + { + "default-value": 0, + "name": "logical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": 4194303, + "name": "max-discard-sectors", + "type": "uint32" + }, + { + "default-value": true, + "name": "discard", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4294967295, + "name": "discard_granularity", + "type": "size" + }, + { + "default-value": true, + "name": "request-merging", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "queue_reset", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "write-zeroes", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4194303, + "name": "max-write-zeroes-sectors", + "type": "uint32" + }, + { + "default-value": false, + "name": "packed", + "description": "on/off", + "type": "bool" + }, + { + "default-value": "auto", + "name": "account-failed", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "x-enable-wce-if-config-wce", + "type": "bool" + }, + { + "default-value": "auto", + "name": "backend_defaults", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "serial", + "type": "str" + } + ], + "id": "libvirt-29" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -18905,7 +19186,7 @@ "type": "bool" } ], - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -18913,7 +19194,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -18982,12 +19263,12 @@ "type": "int" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { "execute": "query-machines", - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -19156,7 +19437,7 @@ "default-ram-id": "s390.ram" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -19164,7 +19445,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -19249,12 +19530,12 @@ "type": "string" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-cpu-definitions", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -19860,32 +20141,32 @@ "deprecated": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-tpm-models", - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-types", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-command-line-options", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -21032,12 +21313,12 @@ "option": "drive" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-migrate-capabilities", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -21115,7 +21396,7 @@ "capability": "validate-uuid" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -21126,7 +21407,7 @@ "name": "host" } }, - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -21182,7 +21463,7 @@ } } }, - "id": "libvirt-38" + "id": "libvirt-39" } { diff --git a/tests/qemucapabilitiesdata/caps_6.0.0_s390x.replies b/tests/qemucapabilitiesdata/caps_6.0.0_s390x.replies index 6fcc0a484b..cc42499fa1 100644 --- a/tests/qemucapabilitiesdata/caps_6.0.0_s390x.replies +++ b/tests/qemucapabilitiesdata/caps_6.0.0_s390x.replies @@ -20471,12 +20471,293 @@ "id": "libvirt-28" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "virtio-blk-ccw" + }, + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "dev_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "devno", + "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "subch_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "default-value": 2, + "name": "max_revision", + "type": "uint32" + }, + { + "default-value": true, + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "default-value": false, + "name": "share-rw", + "type": "bool" + }, + { + "default-value": 0, + "name": "lcyls", + "type": "uint32" + }, + { + "default-value": 256, + "name": "queue-size", + "type": "uint16" + }, + { + "default-value": 0, + "name": "lsecs", + "type": "uint32" + }, + { + "default-value": 0, + "name": "heads", + "type": "uint32" + }, + { + "default-value": "auto", + "name": "account-invalid", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "default-value": 0, + "name": "lheads", + "type": "uint32" + }, + { + "default-value": 65535, + "name": "num-queues", + "type": "uint16" + }, + { + "default-value": 0, + "name": "cyls", + "type": "uint32" + }, + { + "default-value": 0, + "name": "secs", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-blk-device>" + }, + { + "default-value": 0, + "name": "min_io_size", + "type": "size" + }, + { + "name": "bootindex", + "type": "int32" + }, + { + "default-value": true, + "name": "config-wce", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "seg-max-adjust", + "type": "bool" + }, + { + "name": "drive", + "description": "Node name or ID of a block device to use as a backend", + "type": "str" + }, + { + "default-value": "auto", + "name": "werror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": true, + "name": "report-discard-granularity", + "type": "bool" + }, + { + "default-value": "auto", + "name": "rerror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": "auto", + "name": "write-cache", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "use-disabled-flag", + "type": "bool" + }, + { + "default-value": false, + "name": "x-disable-legacy-check", + "type": "bool" + }, + { + "default-value": true, + "name": "use-started", + "type": "bool" + }, + { + "default-value": false, + "name": "iommu_platform", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "physical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": false, + "name": "scsi", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "opt_io_size", + "type": "size" + }, + { + "default-value": 0, + "name": "logical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": 4194303, + "name": "max-discard-sectors", + "type": "uint32" + }, + { + "default-value": true, + "name": "discard", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4294967295, + "name": "discard_granularity", + "type": "size" + }, + { + "default-value": true, + "name": "request-merging", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "queue_reset", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "write-zeroes", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4194303, + "name": "max-write-zeroes-sectors", + "type": "uint32" + }, + { + "default-value": false, + "name": "packed", + "description": "on/off", + "type": "bool" + }, + { + "default-value": "auto", + "name": "account-failed", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "x-enable-wce-if-config-wce", + "type": "bool" + }, + { + "default-value": "auto", + "name": "backend_defaults", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "serial", + "type": "str" + } + ], + "id": "libvirt-29" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -20546,7 +20827,7 @@ "type": "bool" } ], - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -20554,7 +20835,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -20623,12 +20904,12 @@ "type": "int" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { "execute": "query-machines", - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -20806,7 +21087,7 @@ "default-ram-id": "s390.ram" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -20814,7 +21095,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -20912,12 +21193,12 @@ "type": "child<container>" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-cpu-definitions", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -21523,32 +21804,32 @@ "deprecated": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-tpm-models", - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-types", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-command-line-options", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -22715,12 +22996,12 @@ "option": "drive" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-migrate-capabilities", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -22802,7 +23083,7 @@ "capability": "background-snapshot" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -22813,7 +23094,7 @@ "name": "host" } }, - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -22870,7 +23151,7 @@ } } }, - "id": "libvirt-38" + "id": "libvirt-39" } { diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies index 77014169cb..032c102d4b 100644 --- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies +++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.replies @@ -27524,12 +27524,293 @@ "id": "libvirt-28" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "virtio-blk-ccw" + }, + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "dev_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "devno", + "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "subch_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "default-value": 2, + "name": "max_revision", + "type": "uint32" + }, + { + "default-value": true, + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "default-value": false, + "name": "share-rw", + "type": "bool" + }, + { + "default-value": 0, + "name": "lcyls", + "type": "uint32" + }, + { + "default-value": 256, + "name": "queue-size", + "type": "uint16" + }, + { + "default-value": 0, + "name": "lsecs", + "type": "uint32" + }, + { + "default-value": 0, + "name": "heads", + "type": "uint32" + }, + { + "default-value": "auto", + "name": "account-invalid", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "default-value": 0, + "name": "lheads", + "type": "uint32" + }, + { + "default-value": 65535, + "name": "num-queues", + "type": "uint16" + }, + { + "default-value": 0, + "name": "cyls", + "type": "uint32" + }, + { + "default-value": 0, + "name": "secs", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-blk-device>" + }, + { + "default-value": 0, + "name": "min_io_size", + "type": "size" + }, + { + "name": "bootindex", + "type": "int32" + }, + { + "default-value": true, + "name": "config-wce", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "seg-max-adjust", + "type": "bool" + }, + { + "name": "drive", + "description": "Node name or ID of a block device to use as a backend", + "type": "str" + }, + { + "default-value": "auto", + "name": "werror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": true, + "name": "report-discard-granularity", + "type": "bool" + }, + { + "default-value": "auto", + "name": "rerror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": "auto", + "name": "write-cache", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "use-disabled-flag", + "type": "bool" + }, + { + "default-value": false, + "name": "x-disable-legacy-check", + "type": "bool" + }, + { + "default-value": true, + "name": "use-started", + "type": "bool" + }, + { + "default-value": false, + "name": "iommu_platform", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "physical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": false, + "name": "scsi", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "opt_io_size", + "type": "size" + }, + { + "default-value": 0, + "name": "logical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": 4194303, + "name": "max-discard-sectors", + "type": "uint32" + }, + { + "default-value": true, + "name": "discard", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4294967295, + "name": "discard_granularity", + "type": "size" + }, + { + "default-value": true, + "name": "request-merging", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "queue_reset", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "write-zeroes", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4194303, + "name": "max-write-zeroes-sectors", + "type": "uint32" + }, + { + "default-value": false, + "name": "packed", + "description": "on/off", + "type": "bool" + }, + { + "default-value": "auto", + "name": "account-failed", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "x-enable-wce-if-config-wce", + "type": "bool" + }, + { + "default-value": "auto", + "name": "backend_defaults", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "serial", + "type": "str" + } + ], + "id": "libvirt-29" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -27614,7 +27895,7 @@ "type": "bool" } ], - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -27622,7 +27903,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -27701,12 +27982,12 @@ "type": "int" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { "execute": "query-machines", - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -27981,7 +28262,7 @@ "default-ram-id": "s390.ram" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -27989,7 +28270,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -28102,12 +28383,12 @@ "type": "child<container>" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-cpu-definitions", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -28871,32 +29152,32 @@ "deprecated": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-tpm-models", - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-types", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-command-line-options", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -30119,12 +30400,12 @@ "option": "drive" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-migrate-capabilities", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -30222,7 +30503,7 @@ "capability": "dirty-limit" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -30233,7 +30514,7 @@ "name": "host" } }, - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -30282,7 +30563,7 @@ } } }, - "id": "libvirt-38" + "id": "libvirt-39" } { diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_s390x.replies b/tests/qemucapabilitiesdata/caps_8.2.0_s390x.replies index fa9051c305..222a9fdfdc 100644 --- a/tests/qemucapabilitiesdata/caps_8.2.0_s390x.replies +++ b/tests/qemucapabilitiesdata/caps_8.2.0_s390x.replies @@ -28217,12 +28217,293 @@ "id": "libvirt-28" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "virtio-blk-ccw" + }, + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "dev_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "devno", + "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "subch_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "default-value": 2, + "name": "max_revision", + "type": "uint32" + }, + { + "default-value": true, + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "default-value": false, + "name": "share-rw", + "type": "bool" + }, + { + "default-value": 0, + "name": "lcyls", + "type": "uint32" + }, + { + "default-value": 256, + "name": "queue-size", + "type": "uint16" + }, + { + "default-value": 0, + "name": "lsecs", + "type": "uint32" + }, + { + "default-value": 0, + "name": "heads", + "type": "uint32" + }, + { + "default-value": "auto", + "name": "account-invalid", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "default-value": 0, + "name": "lheads", + "type": "uint32" + }, + { + "default-value": 65535, + "name": "num-queues", + "type": "uint16" + }, + { + "default-value": 0, + "name": "cyls", + "type": "uint32" + }, + { + "default-value": 0, + "name": "secs", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-blk-device>" + }, + { + "default-value": 0, + "name": "min_io_size", + "type": "size" + }, + { + "name": "bootindex", + "type": "int32" + }, + { + "default-value": true, + "name": "config-wce", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "seg-max-adjust", + "type": "bool" + }, + { + "name": "drive", + "description": "Node name or ID of a block device to use as a backend", + "type": "str" + }, + { + "default-value": "auto", + "name": "werror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": true, + "name": "report-discard-granularity", + "type": "bool" + }, + { + "default-value": "auto", + "name": "rerror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": "auto", + "name": "write-cache", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "use-disabled-flag", + "type": "bool" + }, + { + "default-value": false, + "name": "x-disable-legacy-check", + "type": "bool" + }, + { + "default-value": true, + "name": "use-started", + "type": "bool" + }, + { + "default-value": false, + "name": "iommu_platform", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "physical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": false, + "name": "scsi", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "opt_io_size", + "type": "size" + }, + { + "default-value": 0, + "name": "logical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": 4194303, + "name": "max-discard-sectors", + "type": "uint32" + }, + { + "default-value": true, + "name": "discard", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4294967295, + "name": "discard_granularity", + "type": "size" + }, + { + "default-value": true, + "name": "request-merging", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "queue_reset", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "write-zeroes", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4194303, + "name": "max-write-zeroes-sectors", + "type": "uint32" + }, + { + "default-value": false, + "name": "packed", + "description": "on/off", + "type": "bool" + }, + { + "default-value": "auto", + "name": "account-failed", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "x-enable-wce-if-config-wce", + "type": "bool" + }, + { + "default-value": "auto", + "name": "backend_defaults", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "serial", + "type": "str" + } + ], + "id": "libvirt-29" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -28312,7 +28593,7 @@ "type": "bool" } ], - "id": "libvirt-29" + "id": "libvirt-30" } { @@ -28320,7 +28601,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -28399,12 +28680,12 @@ "type": "int" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { "execute": "query-machines", - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -28689,7 +28970,7 @@ "default-ram-id": "s390.ram" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -28697,7 +28978,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -28810,12 +29091,12 @@ "type": "child<container>" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { "execute": "query-cpu-definitions", - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -29579,32 +29860,32 @@ "deprecated": false } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-tpm-models", - "id": "libvirt-34" + "id": "libvirt-35" } { "return": [], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-types", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-command-line-options", - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -30835,12 +31116,12 @@ "option": "drive" } ], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-migrate-capabilities", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -30938,7 +31219,7 @@ "capability": "dirty-limit" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -30949,7 +31230,7 @@ "name": "host" } }, - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -30998,7 +31279,7 @@ } } }, - "id": "libvirt-38" + "id": "libvirt-39" } { diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies index 4e54acb5b1..2d4ab8ed75 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies +++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.replies @@ -29266,12 +29266,293 @@ "id": "libvirt-29" } +{ + "execute": "device-list-properties", + "arguments": { + "typename": "virtio-blk-ccw" + }, + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "dev_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "devno", + "description": "Identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "name": "subch_id", + "description": "Read-only identifier of an I/O device in the channel subsystem, example: fe.1.23ab", + "type": "str" + }, + { + "default-value": 2, + "name": "max_revision", + "type": "uint32" + }, + { + "default-value": true, + "name": "ioeventfd", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "notify_on_empty", + "description": "on/off", + "type": "bool" + }, + { + "default-value": false, + "name": "share-rw", + "type": "bool" + }, + { + "default-value": 0, + "name": "lcyls", + "type": "uint32" + }, + { + "default-value": 256, + "name": "queue-size", + "type": "uint16" + }, + { + "default-value": 0, + "name": "lsecs", + "type": "uint32" + }, + { + "default-value": 0, + "name": "heads", + "type": "uint32" + }, + { + "default-value": "auto", + "name": "account-invalid", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "iothread", + "type": "link<iothread>" + }, + { + "default-value": 0, + "name": "lheads", + "type": "uint32" + }, + { + "default-value": 65535, + "name": "num-queues", + "type": "uint16" + }, + { + "default-value": 0, + "name": "cyls", + "type": "uint32" + }, + { + "default-value": 0, + "name": "secs", + "type": "uint32" + }, + { + "name": "virtio-backend", + "type": "child<virtio-blk-device>" + }, + { + "default-value": 0, + "name": "min_io_size", + "type": "size" + }, + { + "name": "bootindex", + "type": "int32" + }, + { + "default-value": true, + "name": "config-wce", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "seg-max-adjust", + "type": "bool" + }, + { + "name": "drive", + "description": "Node name or ID of a block device to use as a backend", + "type": "str" + }, + { + "default-value": "auto", + "name": "werror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": true, + "name": "report-discard-granularity", + "type": "bool" + }, + { + "default-value": "auto", + "name": "rerror", + "description": "Error handling policy, report/ignore/enospc/stop/auto", + "type": "BlockdevOnError" + }, + { + "default-value": "auto", + "name": "write-cache", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "use-disabled-flag", + "type": "bool" + }, + { + "default-value": false, + "name": "x-disable-legacy-check", + "type": "bool" + }, + { + "default-value": true, + "name": "use-started", + "type": "bool" + }, + { + "default-value": false, + "name": "iommu_platform", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "physical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": false, + "name": "scsi", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "any_layout", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 0, + "name": "opt_io_size", + "type": "size" + }, + { + "default-value": 0, + "name": "logical_block_size", + "description": "A power of two between 512 B and 2 MiB", + "type": "size" + }, + { + "default-value": 4194303, + "name": "max-discard-sectors", + "type": "uint32" + }, + { + "default-value": true, + "name": "discard", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4294967295, + "name": "discard_granularity", + "type": "size" + }, + { + "default-value": true, + "name": "request-merging", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "queue_reset", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "write-zeroes", + "description": "on/off", + "type": "bool" + }, + { + "default-value": 4194303, + "name": "max-write-zeroes-sectors", + "type": "uint32" + }, + { + "default-value": false, + "name": "packed", + "description": "on/off", + "type": "bool" + }, + { + "default-value": "auto", + "name": "account-failed", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "default-value": true, + "name": "indirect_desc", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "event_idx", + "description": "on/off", + "type": "bool" + }, + { + "default-value": true, + "name": "x-enable-wce-if-config-wce", + "type": "bool" + }, + { + "default-value": "auto", + "name": "backend_defaults", + "description": "on/off/auto", + "type": "OnOffAuto" + }, + { + "name": "serial", + "type": "str" + } + ], + "id": "libvirt-30" +} + { "execute": "qom-list-properties", "arguments": { "typename": "memory-backend-file" }, - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -29361,7 +29642,7 @@ "type": "bool" } ], - "id": "libvirt-30" + "id": "libvirt-31" } { @@ -29369,7 +29650,7 @@ "arguments": { "typename": "memory-backend-memfd" }, - "id": "libvirt-31" + "id": "libvirt-32" } { @@ -29448,12 +29729,12 @@ "type": "int" } ], - "id": "libvirt-31" + "id": "libvirt-32" } { "execute": "query-machines", - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -29758,7 +30039,7 @@ "default-ram-id": "s390.ram" } ], - "id": "libvirt-32" + "id": "libvirt-33" } { @@ -29766,7 +30047,7 @@ "arguments": { "typename": "none-machine" }, - "id": "libvirt-33" + "id": "libvirt-34" } { @@ -29879,12 +30160,12 @@ "type": "child<container>" } ], - "id": "libvirt-33" + "id": "libvirt-34" } { "execute": "query-cpu-definitions", - "id": "libvirt-34" + "id": "libvirt-35" } { @@ -30522,32 +30803,32 @@ "deprecated": false } ], - "id": "libvirt-34" + "id": "libvirt-35" } { "execute": "query-tpm-models", - "id": "libvirt-35" + "id": "libvirt-36" } { "return": [], - "id": "libvirt-35" + "id": "libvirt-36" } { "execute": "query-tpm-types", - "id": "libvirt-36" + "id": "libvirt-37" } { "return": [], - "id": "libvirt-36" + "id": "libvirt-37" } { "execute": "query-command-line-options", - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -31786,12 +32067,12 @@ "option": "drive" } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "execute": "query-migrate-capabilities", - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -31885,7 +32166,7 @@ "capability": "mapped-ram" } ], - "id": "libvirt-38" + "id": "libvirt-39" } { @@ -31896,7 +32177,7 @@ "name": "host" } }, - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -31968,7 +32249,7 @@ } } }, - "id": "libvirt-39" + "id": "libvirt-40" } { -- 2.45.0

On Wed, Nov 06, 2024 at 15:31:55 +0100, Boris Fiuczynski wrote:
Add capability QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM to detect multi boot device support in QEMU by checking the virtio-blk-ccw device property existence of loadparm.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/qemu/qemu_capabilities.c | 8 + src/qemu/qemu_capabilities.h | 1 + .../caps_5.2.0_s390x.replies | 321 ++++++++++++++++-- .../caps_6.0.0_s390x.replies | 321 ++++++++++++++++-- .../caps_8.1.0_s390x.replies | 321 ++++++++++++++++-- .../caps_8.2.0_s390x.replies | 321 ++++++++++++++++-- .../caps_9.1.0_s390x.replies | 321 ++++++++++++++++-- 7 files changed, 1514 insertions(+), 100 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Let us introduce the xml and reply files for QEMU 9.2.0 on s390x. Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com> Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- tests/domaincapsdata/qemu_9.2.0.s390x.xml | 311 + .../caps_9.2.0_s390x.replies | 36741 ++++++++++++++++ .../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 3752 ++ 3 files changed, 40804 insertions(+) create mode 100644 tests/domaincapsdata/qemu_9.2.0.s390x.xml create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml diff --git a/tests/domaincapsdata/qemu_9.2.0.s390x.xml b/tests/domaincapsdata/qemu_9.2.0.s390x.xml new file mode 100644 index 0000000000..e13809bc63 --- /dev/null +++ b/tests/domaincapsdata/qemu_9.2.0.s390x.xml @@ -0,0 +1,311 @@ +<domainCapabilities> + <path>/usr/bin/qemu-system-s390x</path> + <domain>kvm</domain> + <machine>s390-ccw-virtio-9.2</machine> + <arch>s390x</arch> + <vcpu max='248'/> + <iothreads supported='yes'/> + <os supported='yes'> + <enum name='firmware'/> + <loader supported='yes'> + <value>/obviously/fake/firmware1.fd</value> + <value>/obviously/fake/firmware2.fd</value> + <enum name='type'> + <value>rom</value> + <value>pflash</value> + </enum> + <enum name='readonly'> + <value>yes</value> + <value>no</value> + </enum> + <enum name='secure'> + <value>no</value> + </enum> + </loader> + </os> + <cpu> + <mode name='host-passthrough' supported='yes'> + <enum name='hostPassthroughMigratable'> + <value>off</value> + </enum> + </mode> + <mode name='maximum' supported='yes'> + <enum name='maximumMigratable'> + <value>on</value> + <value>off</value> + </enum> + </mode> + <mode name='host-model' supported='yes'> + <model fallback='forbid'>gen16a-base</model> + <feature policy='require' name='nnpa'/> + <feature policy='require' name='aen'/> + <feature policy='require' name='cmmnt'/> + <feature policy='require' name='vxpdeh'/> + <feature policy='require' name='aefsi'/> + <feature policy='require' name='diag318'/> + <feature policy='require' name='csske'/> + <feature policy='require' name='mepoch'/> + <feature policy='require' name='msa9'/> + <feature policy='require' name='msa8'/> + <feature policy='require' name='msa7'/> + <feature policy='require' name='msa6'/> + <feature policy='require' name='msa5'/> + <feature policy='require' name='msa4'/> + <feature policy='require' name='msa3'/> + <feature policy='require' name='msa2'/> + <feature policy='require' name='msa1'/> + <feature policy='require' name='sthyi'/> + <feature policy='require' name='edat'/> + <feature policy='require' name='ri'/> + <feature policy='require' name='deflate'/> + <feature policy='require' name='edat2'/> + <feature policy='require' name='etoken'/> + <feature policy='require' name='vx'/> + <feature policy='require' name='ipter'/> + <feature policy='require' name='pai'/> + <feature policy='require' name='paie'/> + <feature policy='require' name='mepochptff'/> + <feature policy='require' name='ap'/> + <feature policy='require' name='vxeh'/> + <feature policy='require' name='vxpd'/> + <feature policy='require' name='esop'/> + <feature policy='require' name='msa9_pckmo'/> + <feature policy='require' name='vxeh2'/> + <feature policy='require' name='esort'/> + <feature policy='require' name='appv'/> + <feature policy='require' name='apqi'/> + <feature policy='require' name='apft'/> + <feature policy='require' name='els'/> + <feature policy='require' name='iep'/> + <feature policy='require' name='appvi'/> + <feature policy='require' name='apqci'/> + <feature policy='require' name='cte'/> + <feature policy='require' name='ais'/> + <feature policy='require' name='bpb'/> + <feature policy='require' name='ctop'/> + <feature policy='require' name='gs'/> + <feature policy='require' name='ppa15'/> + <feature policy='require' name='zpci'/> + <feature policy='require' name='rdp'/> + <feature policy='require' name='sea_esop2'/> + <feature policy='require' name='beareh'/> + <feature policy='require' name='te'/> + <feature policy='require' name='cmm'/> + <feature policy='require' name='vxpdeh2'/> + </mode> + <mode name='custom' supported='yes'> + <model usable='yes' vendor='IBM'>gen15a</model> + <model usable='yes' vendor='IBM'>gen15a-base</model> + <model usable='yes' vendor='IBM'>gen15b</model> + <model usable='yes' vendor='IBM'>gen15b-base</model> + <model usable='yes' vendor='IBM'>gen16a</model> + <model usable='yes' vendor='IBM'>gen16a-base</model> + <model usable='yes' vendor='IBM'>gen16b</model> + <model usable='yes' vendor='IBM'>gen16b-base</model> + <model usable='yes' vendor='unknown'>max</model> + <model usable='yes' vendor='unknown'>qemu</model> + <model usable='yes' vendor='IBM'>z10BC</model> + <model usable='yes' vendor='IBM'>z10BC-base</model> + <model usable='yes' vendor='IBM'>z10BC.2</model> + <model usable='yes' vendor='IBM'>z10BC.2-base</model> + <model usable='yes' vendor='IBM'>z10EC</model> + <model usable='yes' vendor='IBM'>z10EC-base</model> + <model usable='yes' vendor='IBM'>z10EC.2</model> + <model usable='yes' vendor='IBM'>z10EC.2-base</model> + <model usable='yes' vendor='IBM'>z10EC.3</model> + <model usable='yes' vendor='IBM'>z10EC.3-base</model> + <model usable='yes' vendor='IBM'>z114</model> + <model usable='yes' vendor='IBM'>z114-base</model> + <model usable='yes' vendor='IBM'>z13</model> + <model usable='yes' vendor='IBM'>z13-base</model> + <model usable='yes' vendor='IBM'>z13.2</model> + <model usable='yes' vendor='IBM'>z13.2-base</model> + <model usable='yes' vendor='IBM'>z13s</model> + <model usable='yes' vendor='IBM'>z13s-base</model> + <model usable='yes' vendor='IBM'>z14</model> + <model usable='yes' vendor='IBM'>z14-base</model> + <model usable='yes' vendor='IBM'>z14.2</model> + <model usable='yes' vendor='IBM'>z14.2-base</model> + <model usable='yes' vendor='IBM'>z14ZR1</model> + <model usable='yes' vendor='IBM'>z14ZR1-base</model> + <model usable='yes' vendor='IBM'>z196</model> + <model usable='yes' vendor='IBM'>z196-base</model> + <model usable='yes' vendor='IBM'>z196.2</model> + <model usable='yes' vendor='IBM'>z196.2-base</model> + <model usable='yes' vendor='IBM'>z800</model> + <model usable='yes' vendor='IBM'>z800-base</model> + <model usable='yes' vendor='IBM'>z890</model> + <model usable='yes' vendor='IBM'>z890-base</model> + <model usable='yes' vendor='IBM'>z890.2</model> + <model usable='yes' vendor='IBM'>z890.2-base</model> + <model usable='yes' vendor='IBM'>z890.3</model> + <model usable='yes' vendor='IBM'>z890.3-base</model> + <model usable='yes' vendor='IBM'>z900</model> + <model usable='yes' vendor='IBM'>z900-base</model> + <model usable='yes' vendor='IBM'>z900.2</model> + <model usable='yes' vendor='IBM'>z900.2-base</model> + <model usable='yes' vendor='IBM'>z900.3</model> + <model usable='yes' vendor='IBM'>z900.3-base</model> + <model usable='yes' vendor='IBM'>z990</model> + <model usable='yes' vendor='IBM'>z990-base</model> + <model usable='yes' vendor='IBM'>z990.2</model> + <model usable='yes' vendor='IBM'>z990.2-base</model> + <model usable='yes' vendor='IBM'>z990.3</model> + <model usable='yes' vendor='IBM'>z990.3-base</model> + <model usable='yes' vendor='IBM'>z990.4</model> + <model usable='yes' vendor='IBM'>z990.4-base</model> + <model usable='yes' vendor='IBM'>z990.5</model> + <model usable='yes' vendor='IBM'>z990.5-base</model> + <model usable='yes' vendor='IBM'>z9BC</model> + <model usable='yes' vendor='IBM'>z9BC-base</model> + <model usable='yes' vendor='IBM'>z9BC.2</model> + <model usable='yes' vendor='IBM'>z9BC.2-base</model> + <model usable='yes' vendor='IBM'>z9EC</model> + <model usable='yes' vendor='IBM'>z9EC-base</model> + <model usable='yes' vendor='IBM'>z9EC.2</model> + <model usable='yes' vendor='IBM'>z9EC.2-base</model> + <model usable='yes' vendor='IBM'>z9EC.3</model> + <model usable='yes' vendor='IBM'>z9EC.3-base</model> + <model usable='yes' vendor='IBM'>zBC12</model> + <model usable='yes' vendor='IBM'>zBC12-base</model> + <model usable='yes' vendor='IBM'>zEC12</model> + <model usable='yes' vendor='IBM'>zEC12-base</model> + <model usable='yes' vendor='IBM'>zEC12.2</model> + <model usable='yes' vendor='IBM'>zEC12.2-base</model> + </mode> + </cpu> + <memoryBacking supported='yes'> + <enum name='sourceType'> + <value>file</value> + <value>anonymous</value> + <value>memfd</value> + </enum> + </memoryBacking> + <devices> + <disk supported='yes'> + <enum name='diskDevice'> + <value>disk</value> + <value>cdrom</value> + <value>floppy</value> + <value>lun</value> + </enum> + <enum name='bus'> + <value>fdc</value> + <value>scsi</value> + <value>virtio</value> + <value>usb</value> + </enum> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + </disk> + <graphics supported='yes'> + <enum name='type'> + <value>sdl</value> + <value>vnc</value> + <value>egl-headless</value> + <value>dbus</value> + </enum> + </graphics> + <video supported='yes'> + <enum name='modelType'> + <value>virtio</value> + <value>none</value> + </enum> + </video> + <hostdev supported='yes'> + <enum name='mode'> + <value>subsystem</value> + </enum> + <enum name='startupPolicy'> + <value>default</value> + <value>mandatory</value> + <value>requisite</value> + <value>optional</value> + </enum> + <enum name='subsysType'> + <value>usb</value> + <value>pci</value> + <value>scsi</value> + </enum> + <enum name='capsType'/> + <enum name='pciBackend'> + <value>default</value> + <value>vfio</value> + </enum> + </hostdev> + <rng supported='yes'> + <enum name='model'> + <value>virtio</value> + <value>virtio-transitional</value> + <value>virtio-non-transitional</value> + </enum> + <enum name='backendModel'> + <value>random</value> + <value>egd</value> + <value>builtin</value> + </enum> + </rng> + <filesystem supported='yes'> + <enum name='driverType'> + <value>path</value> + <value>handle</value> + <value>virtiofs</value> + </enum> + </filesystem> + <tpm supported='no'/> + <redirdev supported='yes'> + <enum name='bus'> + <value>usb</value> + </enum> + </redirdev> + <channel supported='yes'> + <enum name='type'> + <value>pty</value> + <value>unix</value> + </enum> + </channel> + <crypto supported='yes'> + <enum name='model'> + <value>virtio</value> + </enum> + <enum name='type'> + <value>qemu</value> + </enum> + <enum name='backendModel'> + <value>builtin</value> + <value>lkcf</value> + </enum> + </crypto> + <interface supported='yes'> + <enum name='backendType'> + <value>default</value> + <value>passt</value> + </enum> + </interface> + <panic supported='yes'> + <enum name='model'> + <value>s390</value> + </enum> + </panic> + </devices> + <features> + <gic supported='no'/> + <vmcoreinfo supported='no'/> + <genid supported='no'/> + <backingStoreInput supported='yes'/> + <backup supported='yes'/> + <async-teardown supported='yes'/> + <s390-pv supported='yes'/> + <ps2 supported='no'/> + <sev supported='no'/> + <sgx supported='no'/> + <launchSecurity supported='yes'> + <enum name='sectype'> + <value>s390-pv</value> + </enum> + </launchSecurity> + </features> +</domainCapabilities> diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies new file mode 100644 index 0000000000..0f97cd3499 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies @@ -0,0 +1,36741 @@ [...] diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml new file mode 100644 index 0000000000..8a6a516fa3 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml @@ -0,0 +1,3752 @@ [...] -- 2.45.0

On Wed, Nov 06, 2024 at 15:31:56 +0100, Boris Fiuczynski wrote:
Let us introduce the xml and reply files for QEMU 9.2.0 on s390x.
qemu-9.2 is not yet out ...
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com> Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- tests/domaincapsdata/qemu_9.2.0.s390x.xml | 311 + .../caps_9.2.0_s390x.replies | 36741 ++++++++++++++++ .../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 3752 ++ 3 files changed, 40804 insertions(+) create mode 100644 tests/domaincapsdata/qemu_9.2.0.s390x.xml create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
... but your .replies file claims: + "return": { + "qemu": { + "micro": 0, + "minor": 2, + "major": 9 + }, + "package": "v9.2.0" + }, + "id": "libvirt-2" +} + So that seems doctored. We're okay with in development versions but they must be captured from a real qemu build without any shenanigans. Also don't forget to mention in the commit message which exact commit this was based on. Additionally if you want to commit an in-development version you also need to volunteer to update this once the real qemu-9.2 is released.

On 11/7/24 17:19, Peter Krempa wrote:
On Wed, Nov 06, 2024 at 15:31:56 +0100, Boris Fiuczynski wrote:
Let us introduce the xml and reply files for QEMU 9.2.0 on s390x.
qemu-9.2 is not yet out ...
Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.ibm.com> Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- tests/domaincapsdata/qemu_9.2.0.s390x.xml | 311 + .../caps_9.2.0_s390x.replies | 36741 ++++++++++++++++ .../qemucapabilitiesdata/caps_9.2.0_s390x.xml | 3752 ++ 3 files changed, 40804 insertions(+) create mode 100644 tests/domaincapsdata/qemu_9.2.0.s390x.xml create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies create mode 100644 tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
...
but your .replies file claims:
+ "return": { + "qemu": { + "micro": 0, + "minor": 2, + "major": 9 + }, + "package": "v9.2.0" + }, + "id": "libvirt-2" +} +
So that seems doctored. We're okay with in development versions but they must be captured from a real qemu build without any shenanigans.
Also don't forget to mention in the commit message which exact commit this was based on.
Additionally if you want to commit an in-development version you also need to volunteer to update this once the real qemu-9.2 is released.
I will look up the QEMU commit id we used to generate the replies file and add it to the package returned as well as mention it in the commit message. We plan to update these files with the future GA qemu-9.2. -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Thu, Nov 07, 2024 at 17:44:05 +0100, Boris Fiuczynski wrote:
On 11/7/24 17:19, Peter Krempa wrote:
On Wed, Nov 06, 2024 at 15:31:56 +0100, Boris Fiuczynski wrote:
Let us introduce the xml and reply files for QEMU 9.2.0 on s390x.
[...]
Additionally if you want to commit an in-development version you also need to volunteer to update this once the real qemu-9.2 is released.
I will look up the QEMU commit id we used to generate the replies file and add it to the package returned as well as mention it in the commit message. We plan to update these files with the future GA qemu-9.2.
I'm here to collect on this promise ;) $ git grep 'package":' -- tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies | cat tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies: "package": "v9.1.0-1348-g11b8920ed2" commit ae35f033b874c627d81d51070187fbf55f0bf1a7 (tag: v9.2.0) Author: Peter Maydell <peter.maydell@linaro.org> Date: Tue Dec 10 16:20:54 2024 +0000 Update version for v9.2.0 release

On 3/7/25 15:57, Peter Krempa wrote:
On Thu, Nov 07, 2024 at 17:44:05 +0100, Boris Fiuczynski wrote:
On 11/7/24 17:19, Peter Krempa wrote:
On Wed, Nov 06, 2024 at 15:31:56 +0100, Boris Fiuczynski wrote:
Let us introduce the xml and reply files for QEMU 9.2.0 on s390x.
[...]
Additionally if you want to commit an in-development version you also need to volunteer to update this once the real qemu-9.2 is released.
I will look up the QEMU commit id we used to generate the replies file and add it to the package returned as well as mention it in the commit message. We plan to update these files with the future GA qemu-9.2.
I'm here to collect on this promise ;)
$ git grep 'package":' -- tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies | cat tests/qemucapabilitiesdata/caps_9.2.0_s390x.replies: "package": "v9.1.0-1348-g11b8920ed2"
commit ae35f033b874c627d81d51070187fbf55f0bf1a7 (tag: v9.2.0) Author: Peter Maydell <peter.maydell@linaro.org> Date: Tue Dec 10 16:20:54 2024 +0000
Update version for v9.2.0 release
Peter, thanks for the collecting reminder. ;) Will get to it very soon. -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

If QEMU supports multi boot device make use of it instead of using the single boot device machine parameter. Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/qemu/qemu_command.c | 40 ++++++++++++--- src/qemu/qemu_command.h | 6 ++- src/qemu/qemu_hotplug.c | 6 ++- .../machine-loadparm-hostdev.s390x-9.1.0.args | 33 ++++++++++++ .../machine-loadparm-hostdev.s390x-9.1.0.xml | 33 ++++++++++++ ...machine-loadparm-hostdev.s390x-latest.args | 4 +- ...-multiple-disks-nets-s390.s390x-9.1.0.args | 40 +++++++++++++++ ...m-multiple-disks-nets-s390.s390x-9.1.0.xml | 51 +++++++++++++++++++ ...multiple-disks-nets-s390.s390x-latest.args | 8 +-- ...machine-loadparm-net-s390.s390x-9.1.0.args | 34 +++++++++++++ .../machine-loadparm-net-s390.s390x-9.1.0.xml | 32 ++++++++++++ ...achine-loadparm-net-s390.s390x-latest.args | 4 +- .../machine-loadparm-s390.s390x-9.1.0.args | 34 +++++++++++++ .../machine-loadparm-s390.s390x-9.1.0.xml | 33 ++++++++++++ .../machine-loadparm-s390.s390x-latest.args | 4 +- tests/qemuxmlconftest.c | 4 ++ 16 files changed, 346 insertions(+), 20 deletions(-) create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a5ff7695c3..cdc0ea18d7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1608,6 +1608,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, g_autofree char *chardev = NULL; g_autofree char *drive = NULL; unsigned int bootindex = 0; + g_autofree char *bootLoadparm = NULL; unsigned int logical_block_size = disk->blockio.logical_block_size; unsigned int physical_block_size = disk->blockio.physical_block_size; unsigned int discard_granularity = disk->blockio.discard_granularity; @@ -1746,9 +1747,14 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, } /* bootindex for floppies is configured via the fdc controller */ - if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) + if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) { bootindex = disk->info.effectiveBootIndex; + if (disk->info.loadparm && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = g_strdup(disk->info.loadparm); + } + if (disk->wwn) { unsigned long long w = 0; @@ -1791,6 +1797,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, "S:chardev", chardev, "s:id", disk->info.alias, "p:bootindex", bootindex, + "S:loadparm", bootLoadparm, "p:logical_block_size", logical_block_size, "p:physical_block_size", physical_block_size, "p:discard_granularity", discard_granularity, @@ -3616,6 +3623,7 @@ qemuBuildNicDevProps(virDomainDef *def, g_autoptr(virJSONValue) props = NULL; char macaddr[VIR_MAC_STRING_BUFLEN]; g_autofree char *netdev = g_strdup_printf("host%s", net->info.alias); + g_autofree char *bootLoadparm = NULL; if (virDomainNetIsVirtioModel(net)) { const char *tx = NULL; @@ -3701,11 +3709,16 @@ qemuBuildNicDevProps(virDomainDef *def, virMacAddrFormat(&net->mac, macaddr); + if (net->info.loadparm && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = g_strdup(net->info.loadparm); + if (virJSONValueObjectAdd(&props, "s:netdev", netdev, "s:id", net->info.alias, "s:mac", macaddr, "p:bootindex", net->info.effectiveBootIndex, + "S:loadparm", bootLoadparm, NULL) < 0) return NULL; @@ -4751,15 +4764,22 @@ qemuBuildSCSIVHostHostdevDevProps(const virDomainDef *def, virJSONValue * qemuBuildSCSIHostdevDevProps(const virDomainDef *def, virDomainHostdevDef *dev, - const char *backendAlias) + const char *backendAlias, + virQEMUCaps *qemuCaps) { + g_autofree char *bootLoadparm = NULL; g_autoptr(virJSONValue) props = NULL; + if (dev->info->loadparm && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = g_strdup(dev->info->loadparm); + if (virJSONValueObjectAdd(&props, "s:driver", "scsi-generic", "s:drive", backendAlias, "s:id", dev->info->alias, "p:bootindex", dev->info->bootIndex, + "S:loadparm", bootLoadparm, NULL) < 0) return NULL; @@ -4840,16 +4860,22 @@ qemuBuildHostdevMdevModelTypeString(virDomainHostdevSubsysMediatedDev *mdev) virJSONValue * qemuBuildHostdevMediatedDevProps(const virDomainDef *def, - virDomainHostdevDef *dev) + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps) { g_autoptr(virJSONValue) props = NULL; virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; g_autofree char *mdevPath = NULL; + g_autofree char *bootLoadparm = NULL; /* 'ramfb' property must be omitted unless it's to be enabled */ bool ramfb = mdevsrc->ramfb == VIR_TRISTATE_SWITCH_ON; mdevPath = virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr); + if (dev->info->loadparm && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = g_strdup(dev->info->loadparm); + if (virJSONValueObjectAdd(&props, "s:driver", qemuBuildHostdevMdevModelTypeString(mdevsrc), "s:id", dev->info->alias, @@ -4857,6 +4883,7 @@ qemuBuildHostdevMediatedDevProps(const virDomainDef *def, "S:display", qemuOnOffAuto(mdevsrc->display), "B:ramfb", ramfb, "p:bootindex", dev->info->bootIndex, + "S:loadparm", bootLoadparm, NULL) < 0) return NULL; @@ -4955,7 +4982,7 @@ qemuBuildHostdevSCSICommandLine(virCommand *cmd, if (qemuBuildBlockStorageSourceAttachDataCommandline(cmd, data, qemuCaps) < 0) return -1; - if (!(devprops = qemuBuildSCSIHostdevDevProps(def, hostdev, backendAlias))) + if (!(devprops = qemuBuildSCSIHostdevDevProps(def, hostdev, backendAlias, qemuCaps))) return -1; if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) < 0) @@ -5054,7 +5081,7 @@ qemuBuildHostdevCommandLine(virCommand *cmd, return -1; } - if (!(devprops = qemuBuildHostdevMediatedDevProps(def, hostdev))) + if (!(devprops = qemuBuildHostdevMediatedDevProps(def, hostdev, qemuCaps))) return -1; if (qemuBuildDeviceCommandlineFromJSON(cmd, devprops, def, qemuCaps) < 0) @@ -6879,7 +6906,8 @@ qemuBuildMachineCommandLine(virCommand *cmd, virBufferAsprintf(&buf, ",max-cpu-compat=%s", cpu->model); } - qemuAppendLoadparmMachineParm(&buf, def); + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + qemuAppendLoadparmMachineParm(&buf, def); if (def->sec) { switch (def->sec->sectype) { diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 309e566f6c..befc3f4ef9 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -179,7 +179,8 @@ qemuBuildUSBHostdevDevProps(const virDomainDef *def, virJSONValue * qemuBuildSCSIHostdevDevProps(const virDomainDef *def, virDomainHostdevDef *dev, - const char *backendAlias); + const char *backendAlias, + virQEMUCaps *qemuCaps); qemuBlockStorageSourceAttachData * qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef *hostdev, @@ -197,7 +198,8 @@ qemuBuildSCSIVHostHostdevDevProps(const virDomainDef *def, virJSONValue * qemuBuildHostdevMediatedDevProps(const virDomainDef *def, - virDomainHostdevDef *dev); + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps); virJSONValue * qemuBuildRedirdevDevProps(const virDomainDef *def, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 1a7b69e5bb..5db72ef634 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2541,7 +2541,8 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriver *driver, priv->qemuCaps))) goto cleanup; - if (!(devprops = qemuBuildSCSIHostdevDevProps(vm->def, hostdev, backendalias))) + if (!(devprops = qemuBuildSCSIHostdevDevProps(vm->def, hostdev, backendalias, + priv->qemuCaps))) goto cleanup; VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1); @@ -2761,7 +2762,8 @@ qemuDomainAttachMediatedDevice(virQEMUDriver *driver, qemuAssignDeviceHostdevAlias(vm->def, &hostdev->info->alias, -1); - if (!(devprops = qemuBuildHostdevMediatedDevProps(vm->def, hostdev))) + if (!(devprops = qemuBuildHostdevMediatedDevProps(vm->def, hostdev, + priv->qemuCaps))) goto cleanup; VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1); diff --git a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args new file mode 100644 index 0000000000..0a025e6335 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args @@ -0,0 +1,33 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine s390-ccw-virtio-9.1,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=2 \ +-accel tcg \ +-cpu qemu \ +-m size=524288k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":536870912}' \ +-overcommit mem-lock=off \ +-smp 2,sockets=2,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"vfio-ccw","id":"hostdev0","sysfsdev":"/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627","bootindex":1,"devno":"fe.0.0000"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml new file mode 100644 index 0000000000..119ae6b0fa --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>524288</memory> + <currentMemory unit='KiB'>524288</currentMemory> + <vcpu placement='static'>2</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio-9.1'>hvm</type> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <hostdev mode='subsystem' type='mdev' managed='no' model='vfio-ccw'> + <source> + <address uuid='90c6c135-ad44-41d0-b1b7-bae47de48627'/> + </source> + <boot order='1' loadparm='2'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </hostdev> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args index 3580db8e21..39f77c14e7 100644 --- a/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args +++ b/tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=2 \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel tcg \ -cpu qemu \ -m size=524288k \ @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -audiodev '{"id":"audio1","driver":"none"}' \ --device '{"driver":"vfio-ccw","id":"hostdev0","sysfsdev":"/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627","bootindex":1,"devno":"fe.0.0000"}' \ +-device '{"driver":"vfio-ccw","id":"hostdev0","sysfsdev":"/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627","bootindex":1,"loadparm":"2","devno":"fe.0.0000"}' \ -device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ -msg timestamp=on diff --git a/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args b/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args new file mode 100644 index 0000000000..02c0612440 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args @@ -0,0 +1,40 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine s390-ccw-virtio-9.1,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=SYSTEM1 \ +-accel tcg \ +-cpu qemu \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-2-storage","read-only":false}' \ +-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0002","drive":"libvirt-2-storage","id":"virtio-disk0","bootindex":1}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","node-name":"libvirt-1-storage","read-only":false}' \ +-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0003","drive":"libvirt-1-storage","id":"virtio-disk1","bootindex":3}' \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:54","bootindex":2,"devno":"fe.0.0000"}' \ +-netdev '{"type":"user","id":"hostnet1"}' \ +-device '{"driver":"virtio-net-ccw","netdev":"hostnet1","id":"net1","mac":"00:11:22:33:42:36","devno":"fe.0.0004"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml b/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml new file mode 100644 index 0000000000..9e108062ce --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml @@ -0,0 +1,51 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio-9.1'>hvm</type> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <boot order='1' loadparm='SYSTEM1'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/> + </disk> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest2'/> + <target dev='hdb' bus='virtio'/> + <boot order='3' loadparm='3'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0003'/> + </disk> + <controller type='pci' index='0' model='pci-root'/> + <interface type='user'> + <mac address='00:11:22:33:44:54'/> + <model type='virtio'/> + <boot order='2' loadparm='2.LP'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </interface> + <interface type='user'> + <mac address='00:11:22:33:42:36'/> + <model type='virtio'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0004'/> + </interface> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-latest.args b/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-latest.args index 411b62f3ee..34f148e430 100644 --- a/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-latest.args +++ b/tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=SYSTEM1 \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel tcg \ -cpu qemu \ -m size=219136k \ @@ -27,11 +27,11 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-2-storage","read-only":false}' \ --device '{"driver":"virtio-blk-ccw","devno":"fe.0.0002","drive":"libvirt-2-storage","id":"virtio-disk0","bootindex":1}' \ +-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0002","drive":"libvirt-2-storage","id":"virtio-disk0","bootindex":1,"loadparm":"SYSTEM1"}' \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","node-name":"libvirt-1-storage","read-only":false}' \ --device '{"driver":"virtio-blk-ccw","devno":"fe.0.0003","drive":"libvirt-1-storage","id":"virtio-disk1","bootindex":3}' \ +-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0003","drive":"libvirt-1-storage","id":"virtio-disk1","bootindex":3,"loadparm":"3"}' \ -netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:54","bootindex":2,"devno":"fe.0.0000"}' \ +-device '{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:54","bootindex":2,"loadparm":"2.LP","devno":"fe.0.0000"}' \ -netdev '{"type":"user","id":"hostnet1"}' \ -device '{"driver":"virtio-net-ccw","netdev":"hostnet1","id":"net1","mac":"00:11:22:33:42:36","devno":"fe.0.0004"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ diff --git a/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args b/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args new file mode 100644 index 0000000000..4d34784f46 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine s390-ccw-virtio-9.1,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=2 \ +-accel tcg \ +-cpu qemu \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-netdev '{"type":"user","id":"hostnet0"}' \ +-device '{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:54","bootindex":1,"devno":"fe.0.0000"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml b/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml new file mode 100644 index 0000000000..3c2dc60dd1 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml @@ -0,0 +1,32 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio-9.1'>hvm</type> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <controller type='pci' index='0' model='pci-root'/> + <interface type='user'> + <mac address='00:11:22:33:44:54'/> + <model type='virtio'/> + <boot order='1' loadparm='2'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </interface> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-latest.args b/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-latest.args index bdd2782f5a..a5241c38f3 100644 --- a/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-latest.args +++ b/tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=2 \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel tcg \ -cpu qemu \ -m size=219136k \ @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -netdev '{"type":"user","id":"hostnet0"}' \ --device '{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:54","bootindex":1,"devno":"fe.0.0000"}' \ +-device '{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"00:11:22:33:44:54","bootindex":1,"loadparm":"2","devno":"fe.0.0000"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args b/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args new file mode 100644 index 0000000000..cbb5e9df34 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args @@ -0,0 +1,34 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=test \ +LOGNAME=test \ +XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-s390x \ +-name guest=QEMUGuest1,debug-threads=on \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine s390-ccw-virtio-9.1,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=2 \ +-accel tcg \ +-cpu qemu \ +-m size=219136k \ +-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":224395264}' \ +-overcommit mem-lock=off \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ +-mon chardev=charmonitor,id=monitor,mode=control \ +-rtc base=utc \ +-no-shutdown \ +-boot strict=on \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ +-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0000","drive":"libvirt-1-storage","id":"virtio-disk0","bootindex":1}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ +-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ +-msg timestamp=on diff --git a/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml b/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml new file mode 100644 index 0000000000..994888a05e --- /dev/null +++ b/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml @@ -0,0 +1,33 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219136</memory> + <currentMemory unit='KiB'>219136</currentMemory> + <vcpu placement='static'>1</vcpu> + <os> + <type arch='s390x' machine='s390-ccw-virtio-9.1'>hvm</type> + </os> + <cpu mode='custom' match='exact' check='none'> + <model fallback='forbid'>qemu</model> + </cpu> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu-system-s390x</emulator> + <disk type='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='virtio'/> + <boot order='1' loadparm='2'/> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/> + </disk> + <controller type='pci' index='0' model='pci-root'/> + <audio id='1' type='none'/> + <memballoon model='virtio'> + <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/> + </memballoon> + <panic model='s390'/> + </devices> +</domain> diff --git a/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-latest.args b/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-latest.args index 896fc1e578..2b46f1b83f 100644 --- a/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-latest.args +++ b/tests/qemuxmlconfdata/machine-loadparm-s390.s390x-latest.args @@ -10,7 +10,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -name guest=QEMUGuest1,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ --machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram,loadparm=2 \ +-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \ -accel tcg \ -cpu qemu \ -m size=219136k \ @@ -27,7 +27,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -no-shutdown \ -boot strict=on \ -blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ --device '{"driver":"virtio-blk-ccw","devno":"fe.0.0000","drive":"libvirt-1-storage","id":"virtio-disk0","bootindex":1}' \ +-device '{"driver":"virtio-blk-ccw","devno":"fe.0.0000","drive":"libvirt-1-storage","id":"virtio-disk0","bootindex":1,"loadparm":"2"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0001"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c index 9bcd937447..e9c8d0c552 100644 --- a/tests/qemuxmlconftest.c +++ b/tests/qemuxmlconftest.c @@ -2721,9 +2721,13 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("machine-keywrap-none", "s390x"); DO_TEST_CAPS_ARCH_LATEST("machine-loadparm-s390", "s390x"); + DO_TEST_CAPS_ARCH_VER("machine-loadparm-s390", "s390x", "9.1.0"); DO_TEST_CAPS_ARCH_LATEST("machine-loadparm-net-s390", "s390x"); + DO_TEST_CAPS_ARCH_VER("machine-loadparm-net-s390", "s390x", "9.1.0"); DO_TEST_CAPS_ARCH_LATEST("machine-loadparm-hostdev", "s390x"); + DO_TEST_CAPS_ARCH_VER("machine-loadparm-hostdev", "s390x", "9.1.0"); DO_TEST_CAPS_ARCH_LATEST("machine-loadparm-multiple-disks-nets-s390", "s390x"); + DO_TEST_CAPS_ARCH_VER("machine-loadparm-multiple-disks-nets-s390", "s390x", "9.1.0"); DO_TEST_CAPS_LATEST_PARSE_ERROR("machine-loadparm-s390-char-invalid"); DO_TEST_CAPS_LATEST_PARSE_ERROR("machine-loadparm-s390-len-invalid"); -- 2.45.0

On Wed, Nov 06, 2024 at 15:31:57 +0100, Boris Fiuczynski wrote:
If QEMU supports multi boot device make use of it instead of using the single boot device machine parameter.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/qemu/qemu_command.c | 40 ++++++++++++--- src/qemu/qemu_command.h | 6 ++- src/qemu/qemu_hotplug.c | 6 ++- .../machine-loadparm-hostdev.s390x-9.1.0.args | 33 ++++++++++++ .../machine-loadparm-hostdev.s390x-9.1.0.xml | 33 ++++++++++++ ...machine-loadparm-hostdev.s390x-latest.args | 4 +- ...-multiple-disks-nets-s390.s390x-9.1.0.args | 40 +++++++++++++++ ...m-multiple-disks-nets-s390.s390x-9.1.0.xml | 51 +++++++++++++++++++ ...multiple-disks-nets-s390.s390x-latest.args | 8 +-- ...machine-loadparm-net-s390.s390x-9.1.0.args | 34 +++++++++++++ .../machine-loadparm-net-s390.s390x-9.1.0.xml | 32 ++++++++++++ ...achine-loadparm-net-s390.s390x-latest.args | 4 +- .../machine-loadparm-s390.s390x-9.1.0.args | 34 +++++++++++++ .../machine-loadparm-s390.s390x-9.1.0.xml | 33 ++++++++++++ .../machine-loadparm-s390.s390x-latest.args | 4 +- tests/qemuxmlconftest.c | 4 ++ 16 files changed, 346 insertions(+), 20 deletions(-) create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a5ff7695c3..cdc0ea18d7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1608,6 +1608,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, g_autofree char *chardev = NULL; g_autofree char *drive = NULL; unsigned int bootindex = 0; + g_autofree char *bootLoadparm = NULL; unsigned int logical_block_size = disk->blockio.logical_block_size; unsigned int physical_block_size = disk->blockio.physical_block_size; unsigned int discard_granularity = disk->blockio.discard_granularity; @@ -1746,9 +1747,14 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, }
/* bootindex for floppies is configured via the fdc controller */ - if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) + if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) { bootindex = disk->info.effectiveBootIndex;
+ if (disk->info.loadparm && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = g_strdup(disk->info.loadparm);
You don't need to copy this ....
+ } + if (disk->wwn) { unsigned long long w = 0;
@@ -1791,6 +1797,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, "S:chardev", chardev, "s:id", disk->info.alias, "p:bootindex", bootindex, + "S:loadparm", bootLoadparm,
... to pass it here. This takes const strings and copies them internally into the JSON buffer regardless. Just assign the pointer without copy. You also don't need to check that the string is non-NULL before passing it to g_strdup, or once you remove g_strdup to the temporary pointer. Looking at how the parsing of loadparm is handled I guess we still need to keep the capability (it' can't be moved into post-parse).

On 11/7/24 15:53, Peter Krempa wrote:
On Wed, Nov 06, 2024 at 15:31:57 +0100, Boris Fiuczynski wrote:
If QEMU supports multi boot device make use of it instead of using the single boot device machine parameter.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> --- src/qemu/qemu_command.c | 40 ++++++++++++--- src/qemu/qemu_command.h | 6 ++- src/qemu/qemu_hotplug.c | 6 ++- .../machine-loadparm-hostdev.s390x-9.1.0.args | 33 ++++++++++++ .../machine-loadparm-hostdev.s390x-9.1.0.xml | 33 ++++++++++++ ...machine-loadparm-hostdev.s390x-latest.args | 4 +- ...-multiple-disks-nets-s390.s390x-9.1.0.args | 40 +++++++++++++++ ...m-multiple-disks-nets-s390.s390x-9.1.0.xml | 51 +++++++++++++++++++ ...multiple-disks-nets-s390.s390x-latest.args | 8 +-- ...machine-loadparm-net-s390.s390x-9.1.0.args | 34 +++++++++++++ .../machine-loadparm-net-s390.s390x-9.1.0.xml | 32 ++++++++++++ ...achine-loadparm-net-s390.s390x-latest.args | 4 +- .../machine-loadparm-s390.s390x-9.1.0.args | 34 +++++++++++++ .../machine-loadparm-s390.s390x-9.1.0.xml | 33 ++++++++++++ .../machine-loadparm-s390.s390x-latest.args | 4 +- tests/qemuxmlconftest.c | 4 ++ 16 files changed, 346 insertions(+), 20 deletions(-) create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-hostdev.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-multiple-disks-nets-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-net-s390.s390x-9.1.0.xml create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.args create mode 100644 tests/qemuxmlconfdata/machine-loadparm-s390.s390x-9.1.0.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a5ff7695c3..cdc0ea18d7 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1608,6 +1608,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, g_autofree char *chardev = NULL; g_autofree char *drive = NULL; unsigned int bootindex = 0; + g_autofree char *bootLoadparm = NULL; unsigned int logical_block_size = disk->blockio.logical_block_size; unsigned int physical_block_size = disk->blockio.physical_block_size; unsigned int discard_granularity = disk->blockio.discard_granularity; @@ -1746,9 +1747,14 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, }
/* bootindex for floppies is configured via the fdc controller */ - if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) + if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) { bootindex = disk->info.effectiveBootIndex;
+ if (disk->info.loadparm && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = g_strdup(disk->info.loadparm);
You don't need to copy this ....
+ } + if (disk->wwn) { unsigned long long w = 0;
@@ -1791,6 +1797,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, "S:chardev", chardev, "s:id", disk->info.alias, "p:bootindex", bootindex, + "S:loadparm", bootLoadparm,
... to pass it here. This takes const strings and copies them internally into the JSON buffer regardless.
Just assign the pointer without copy. You also don't need to check that the string is non-NULL before passing it to g_strdup, or once you remove g_strdup to the temporary pointer.
Looking at how the parsing of loadparm is handled I guess we still need to keep the capability (it' can't be moved into post-parse).
OK, will do this here and also the other three similar instances. With fixups just like this: diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cdc0ea18d7..f67176fbfd 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1608,7 +1608,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, g_autofree char *chardev = NULL; g_autofree char *drive = NULL; unsigned int bootindex = 0; - g_autofree char *bootLoadparm = NULL; + const char *bootLoadparm = NULL; unsigned int logical_block_size = disk->blockio.logical_block_size; unsigned int physical_block_size = disk->blockio.physical_block_size; unsigned int discard_granularity = disk->blockio.discard_granularity; @@ -1750,9 +1750,8 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) { bootindex = disk->info.effectiveBootIndex; - if (disk->info.loadparm && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) - bootLoadparm = g_strdup(disk->info.loadparm); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = disk->info.loadparm; } if (disk->wwn) { -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Wolfgang Wendt Geschäftsführung: David Faller Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On Thu, Nov 07, 2024 at 17:01:52 +0100, Boris Fiuczynski wrote:
On 11/7/24 15:53, Peter Krempa wrote:
On Wed, Nov 06, 2024 at 15:31:57 +0100, Boris Fiuczynski wrote:
If QEMU supports multi boot device make use of it instead of using the single boot device machine parameter.
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> ---
[...]
OK, will do this here and also the other three similar instances. With fixups just like this: diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cdc0ea18d7..f67176fbfd 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1608,7 +1608,7 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, g_autofree char *chardev = NULL; g_autofree char *drive = NULL; unsigned int bootindex = 0; - g_autofree char *bootLoadparm = NULL; + const char *bootLoadparm = NULL; unsigned int logical_block_size = disk->blockio.logical_block_size; unsigned int physical_block_size = disk->blockio.physical_block_size; unsigned int discard_granularity = disk->blockio.discard_granularity; @@ -1750,9 +1750,8 @@ qemuBuildDiskDeviceProps(const virDomainDef *def, if (disk->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) { bootindex = disk->info.effectiveBootIndex;
- if (disk->info.loadparm && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) - bootLoadparm = g_strdup(disk->info.loadparm); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_CCW_DEVICE_LOADPARM)) + bootLoadparm = disk->info.loadparm; }
With that: Reviewed-by: Peter Krempa <pkrempa@redhat.com>
participants (2)
-
Boris Fiuczynski
-
Peter Krempa