[libvirt] [PATCH 0/8] Add optional pSeries features (HTM)

Applies cleanly on top of 90d7262552e8de3b067239b215903144a285723d. Patch 2/8 is fairly big because of all the capabilities data being added: I'm sending a redacted version to the list, the rest of the code can be grabbed from https://github.com/andreabolognani/libvirt/tree/pseries-caps Changes from [RFC v3]: * can be considered for merging, since the QEMU part already has; * fix compatibility issues with QEMU <2.12 spotted by Shivaprasad; * drop all features except for HTM, at least for the time being; * add documentation. Changes from [RFC v2]: * use qom-list-properties to probe availability; * test all features with a single XML file. Changes from [RFC v1]: * don't nest features inside a <pseries/> element; * implement all optional features. [RFC v3] https://www.redhat.com/archives/libvir-list/2018-March/msg00042.html [RFC v2] https://www.redhat.com/archives/libvir-list/2018-February/msg00310.html [RFC v1] https://www.redhat.com/archives/libvir-list/2018-January/msg00779.html Andrea Bolognani (8): tests: Rename pseries-features-hpt test tests: Add capabilities data for QEMU 2.12 qemu: Add capability for qom-list-properties qemu: Rename virQEMUCapsObjectProps* -> virQEMUCapsDeviceProps* qemu: Extract generic part from qemuMonitorJSONGetDeviceProps() qemu: Add capability for the HTM pSeries feature qemu: Implement the HTM pSeries feature news: Update for the HTM pSeries feature docs/formatdomain.html.in | 7 + docs/news.xml | 9 + docs/schemas/domaincommon.rng | 5 + src/conf/domain_conf.c | 19 + src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 281 +- src/qemu/qemu_capabilities.h | 2 + src/qemu/qemu_command.c | 149 + src/qemu/qemu_domain.c | 13 + src/qemu/qemu_monitor.c | 13 + src/qemu/qemu_monitor.h | 3 + src/qemu/qemu_monitor_json.c | 40 +- src/qemu/qemu_monitor_json.h | 5 + .../caps_2.12.0-gicv2.aarch64.replies | 17153 +++++++++++++++ .../caps_2.12.0-gicv2.aarch64.xml | 319 + .../caps_2.12.0-gicv3.aarch64.replies | 17153 +++++++++++++++ .../caps_2.12.0-gicv3.aarch64.xml | 319 + .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 21247 +++++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1095 + .../caps_2.12.0.x86_64.replies | 19121 +++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1271 ++ tests/qemucapabilitiestest.c | 4 + .../pseries-features-invalid-machine.xml | 1 + ...ies-features-hpt.args => pseries-features.args} | 2 +- ...eries-features-hpt.xml => pseries-features.xml} | 1 + tests/qemuxml2argvtest.c | 5 +- tests/qemuxml2xmloutdata/pseries-features-hpt.xml | 1 - tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 3 +- 29 files changed, 78113 insertions(+), 130 deletions(-) create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml rename tests/qemuxml2argvdata/{pseries-features-hpt.args => pseries-features.args} (87%) rename tests/qemuxml2argvdata/{pseries-features-hpt.xml => pseries-features.xml} (97%) delete mode 120000 tests/qemuxml2xmloutdata/pseries-features-hpt.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features.xml -- 2.14.3

We're going to use the same test case to exercise all optional pSeries features, so a more generic name is needed. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../{pseries-features-hpt.args => pseries-features.args} | 0 .../{pseries-features-hpt.xml => pseries-features.xml} | 0 tests/qemuxml2argvtest.c | 4 ++-- tests/qemuxml2xmloutdata/pseries-features-hpt.xml | 1 - tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename tests/qemuxml2argvdata/{pseries-features-hpt.args => pseries-features.args} (100%) rename tests/qemuxml2argvdata/{pseries-features-hpt.xml => pseries-features.xml} (100%) delete mode 120000 tests/qemuxml2xmloutdata/pseries-features-hpt.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features.xml diff --git a/tests/qemuxml2argvdata/pseries-features-hpt.args b/tests/qemuxml2argvdata/pseries-features.args similarity index 100% rename from tests/qemuxml2argvdata/pseries-features-hpt.args rename to tests/qemuxml2argvdata/pseries-features.args diff --git a/tests/qemuxml2argvdata/pseries-features-hpt.xml b/tests/qemuxml2argvdata/pseries-features.xml similarity index 100% rename from tests/qemuxml2argvdata/pseries-features-hpt.xml rename to tests/qemuxml2argvdata/pseries-features.xml diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 688846b9b4..ca53912ebe 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1896,10 +1896,10 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); - DO_TEST("pseries-features-hpt", + DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); - DO_TEST_FAILURE("pseries-features-hpt", + DO_TEST_FAILURE("pseries-features", QEMU_CAPS_MACHINE_OPT); DO_TEST_PARSE_ERROR("pseries-features-invalid-machine", NONE); diff --git a/tests/qemuxml2xmloutdata/pseries-features-hpt.xml b/tests/qemuxml2xmloutdata/pseries-features-hpt.xml deleted file mode 120000 index bcaf2e6fec..0000000000 --- a/tests/qemuxml2xmloutdata/pseries-features-hpt.xml +++ /dev/null @@ -1 +0,0 @@ -../qemuxml2argvdata/pseries-features-hpt.xml \ No newline at end of file diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2xmloutdata/pseries-features.xml new file mode 120000 index 0000000000..1b01dbace6 --- /dev/null +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/pseries-features.xml \ No newline at end of file diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 0eb9e6c77a..a363b55446 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -763,7 +763,7 @@ mymain(void) QEMU_CAPS_VIRTIO_SCSI, QEMU_CAPS_DEVICE_VFIO_PCI); - DO_TEST("pseries-features-hpt", + DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); -- 2.14.3

On Fri, 2018-03-09 at 16:07 +0100, Andrea Bolognani wrote:
We're going to use the same test case to exercise all optional pSeries features, so a more generic name is needed.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../{pseries-features-hpt.args => pseries-features.args} | 0 .../{pseries-features-hpt.xml => pseries-features.xml} | 0 tests/qemuxml2argvtest.c | 4 ++-- tests/qemuxml2xmloutdata/pseries-features-hpt.xml | 1 - tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename tests/qemuxml2argvdata/{pseries-features-hpt.args => pseries-features.args} (100%) rename tests/qemuxml2argvdata/{pseries-features-hpt.xml => pseries-features.xml} (100%) delete mode 120000 tests/qemuxml2xmloutdata/pseries-features-hpt.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features.xml
This does no longer apply cleanly now that 07160b65db94 has been pushed, but the conflict is trivial. At any rate, I've updated the GitHub branch so that it's based on b9b9195f15c9 instead of 90d7262552e8, which means anyone fetching from there won't have to deal with the conflict at all. -- Andrea Bolognani / Red Hat / Virtualization

On 03/09/2018 10:07 AM, Andrea Bolognani wrote:
We're going to use the same test case to exercise all optional pSeries features, so a more generic name is needed.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../{pseries-features-hpt.args => pseries-features.args} | 0 .../{pseries-features-hpt.xml => pseries-features.xml} | 0 tests/qemuxml2argvtest.c | 4 ++-- tests/qemuxml2xmloutdata/pseries-features-hpt.xml | 1 - tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename tests/qemuxml2argvdata/{pseries-features-hpt.args => pseries-features.args} (100%) rename tests/qemuxml2argvdata/{pseries-features-hpt.xml => pseries-features.xml} (100%) delete mode 120000 tests/qemuxml2xmloutdata/pseries-features-hpt.xml create mode 120000 tests/qemuxml2xmloutdata/pseries-features.xml
Reviewed-by: John Ferlan <jferlan@redhat.com> John

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_capabilities.c | 4 +++- src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3eb5ed6d1a..c70bd27f18 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -459,6 +459,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "pl011", "machine.pseries.max-cpu-compat", "dump-completed", + "qom-list-properties", ); @@ -1579,7 +1580,8 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { { "query-qmp-schema", QEMU_CAPS_QUERY_QMP_SCHEMA }, { "query-cpu-model-expansion", QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION}, { "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS}, - { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES} + { "query-named-block-nodes", QEMU_CAPS_QUERY_NAMED_BLOCK_NODES }, + { "qom-list-properties", QEMU_CAPS_QOM_LIST_PROPERTIES }, }; struct virQEMUCapsStringFlags virQEMUCapsMigration[] = { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c2ec2be193..ce07dfd6b1 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -444,6 +444,7 @@ typedef enum { QEMU_CAPS_DEVICE_PL011, /* -device pl011 (not user-instantiable) */ QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */ QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */ + QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties QMP command */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml index c81dfcba43..9c4e40973b 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml @@ -187,6 +187,7 @@ <flag name='isa-serial'/> <flag name='pl011'/> <flag name='dump-completed'/> + <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>315524</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml index fae7c26538..06e0068cbd 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml @@ -187,6 +187,7 @@ <flag name='isa-serial'/> <flag name='pl011'/> <flag name='dump-completed'/> + <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>315524</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml index e82a7cd5dd..a0df689c25 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -185,6 +185,7 @@ <flag name='isa-serial'/> <flag name='machine.pseries.max-cpu-compat'/> <flag name='dump-completed'/> + <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>393199</microcodeVersion> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index 50b2ac52d3..fbdde1733f 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -228,6 +228,7 @@ <flag name='iscsi.password-secret'/> <flag name='isa-serial'/> <flag name='dump-completed'/> + <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> <microcodeVersion>364740</microcodeVersion> -- 2.14.3

On 03/09/2018 10:07 AM, Andrea Bolognani wrote:
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_capabilities.c | 4 +++- src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1 + 6 files changed, 8 insertions(+), 1 deletion(-)
Looks like some competition to see who gets the next qemu_capabilities update flags - I think this is the 3rd or 4th patch I've seen in this area on the list. Although I haven't been able to build this series because of the various conflicts in patch 1 and 2, this looks right... Still it's not required until patch 6... and it seems we need to wait a bit for patch 2 to be pushed for the: Reviewed-by: John Ferlan <jferlan@redhat.com> John

In QOM, all devices are objects, which makes the existing names technically correct; however, not all objects are devices, and soon we're going to start looking for object properties in addition to device properties: the former need to go through a different code path, so we need to be able to tell them apart. Using more precise names is a good way to achieve that. While renaming, hunks are also being moved around a bit: the new grouping, too, will make things nicer once we start adding support for object properties. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_capabilities.c | 239 ++++++++++++++++++++++--------------------- src/qemu/qemu_monitor.c | 4 +- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_monitor_json.h | 2 +- 5 files changed, 128 insertions(+), 121 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c70bd27f18..83ec8a67d5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1559,6 +1559,13 @@ struct virQEMUCapsStringFlags { int flag; }; +struct virQEMUCapsObjectTypeProps { + const char *type; + struct virQEMUCapsStringFlags *props; + size_t nprops; + int capsCondition; +}; + struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { { "system_wakeup", QEMU_CAPS_WAKEUP }, @@ -1698,14 +1705,21 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "pl011", QEMU_CAPS_DEVICE_PL011 }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { +/* Device properties. + * + * The following can be probed either using the device-list-properties + * QMP command or, for older QEMU versions, from the help text obtained + * through the '-device xxx,?' command line option + */ + +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { { "deflate-on-oom", QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBlk[] = { { "multifunction", QEMU_CAPS_PCI_MULTIFUNCTION }, { "bootindex", QEMU_CAPS_BOOTINDEX }, { "ioeventfd", QEMU_CAPS_VIRTIO_IOEVENTFD }, @@ -1719,7 +1733,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBlk[] = { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioNet[] = { { "tx", QEMU_CAPS_VIRTIO_TX_ALG }, { "event_idx", QEMU_CAPS_VIRTIO_NET_EVENT_IDX }, { "rx_queue_size", QEMU_CAPS_VIRTIO_NET_RX_QUEUE_SIZE }, @@ -1730,87 +1744,87 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioNet[] = { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSpaprPCIHostBridge[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSpaprPCIHostBridge[] = { { "numa_node", QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioSCSI[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioSCSI[] = { { "iothread", QEMU_CAPS_VIRTIO_SCSI_IOTHREAD }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPCIAssign[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsPCIAssign[] = { { "configfd", QEMU_CAPS_PCI_CONFIGFD }, { "bootindex", QEMU_CAPS_PCI_BOOTINDEX }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVfioPCI[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVfioPCI[] = { { "bootindex", QEMU_CAPS_VFIO_PCI_BOOTINDEX }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIDisk[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIDisk[] = { { "channel", QEMU_CAPS_SCSI_DISK_CHANNEL }, { "wwn", QEMU_CAPS_SCSI_DISK_WWN }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIDEDrive[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIDEDrive[] = { { "wwn", QEMU_CAPS_IDE_DRIVE_WWN }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsPiix4PM[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsPiix4PM[] = { { "disable_s3", QEMU_CAPS_PIIX_DISABLE_S3 }, { "disable_s4", QEMU_CAPS_PIIX_DISABLE_S4 }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBRedir[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBRedir[] = { { "filter", QEMU_CAPS_USB_REDIR_FILTER }, { "bootindex", QEMU_CAPS_USB_REDIR_BOOTINDEX }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBHost[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBHost[] = { { "bootindex", QEMU_CAPS_USB_HOST_BOOTINDEX }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSCSIGeneric[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsSCSIGeneric[] = { { "bootindex", QEMU_CAPS_DEVICE_SCSI_GENERIC_BOOTINDEX }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsI440FXPCIHost[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsI440FXPCIHost[] = { { "pci-hole64-size", QEMU_CAPS_I440FX_PCI_HOLE64_SIZE }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQ35PCIHost[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsQ35PCIHost[] = { { "pci-hole64-size", QEMU_CAPS_Q35_PCI_HOLE64_SIZE }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBStorage[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBStorage[] = { { "removable", QEMU_CAPS_USB_STORAGE_REMOVABLE }, { "share-rw", QEMU_CAPS_DISK_SHARE_RW }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsKVMPit[] = { { "lost_tick_policy", QEMU_CAPS_KVM_PIT_TICK_POLICY }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVGA[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVGA[] = { { "vgamem_mb", QEMU_CAPS_VGA_VGAMEM }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVmwareSvga[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVmwareSvga[] = { { "vgamem_mb", QEMU_CAPS_VMWARE_SVGA_VGAMEM }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsQxl[] = { { "vgamem_mb", QEMU_CAPS_QXL_VGAMEM }, { "vram64_size_mb", QEMU_CAPS_QXL_VRAM64 }, { "max_outputs", QEMU_CAPS_QXL_MAX_OUTPUTS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioGpu[] = { { "virgl", QEMU_CAPS_VIRTIO_GPU_VIRGL }, { "max_outputs", QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, @@ -1818,139 +1832,132 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioGpu[] = { { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsICH9[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsICH9[] = { { "disable_s3", QEMU_CAPS_ICH9_DISABLE_S3 }, { "disable_s4", QEMU_CAPS_ICH9_DISABLE_S4 }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsUSBNECXHCI[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsUSBNECXHCI[] = { { "p3", QEMU_CAPS_NEC_USB_XHCI_PORTS }, }; -static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsIntelIOMMU[] = { +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsIntelIOMMU[] = { { "intremap", QEMU_CAPS_INTEL_IOMMU_INTREMAP }, { "caching-mode", QEMU_CAPS_INTEL_IOMMU_CACHING_MODE }, { "eim", QEMU_CAPS_INTEL_IOMMU_EIM }, { "device-iotlb", QEMU_CAPS_INTEL_IOMMU_DEVICE_IOTLB }, }; -/* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ -static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { - { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, - { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, - { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS}, - { "blockdev-add/arg-type/+iscsi/password-secret", QEMU_CAPS_ISCSI_PASSWORD_SECRET }, -}; - -struct virQEMUCapsObjectTypeProps { - const char *type; - struct virQEMUCapsStringFlags *props; - size_t nprops; - int capsCondition; -}; - -static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { - { "virtio-blk-pci", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), +static struct virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { + { "virtio-blk-pci", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), -1 }, - { "virtio-net-pci", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-pci", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "virtio-scsi-pci", virQEMUCapsObjectPropsVirtioSCSI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), + { "virtio-scsi-pci", virQEMUCapsDevicePropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioSCSI), QEMU_CAPS_VIRTIO_SCSI }, - { "virtio-blk-ccw", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), + { "virtio-blk-ccw", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), QEMU_CAPS_VIRTIO_CCW }, - { "virtio-net-ccw", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-ccw", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "virtio-scsi-ccw", virQEMUCapsObjectPropsVirtioSCSI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioSCSI), + { "virtio-scsi-ccw", virQEMUCapsDevicePropsVirtioSCSI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioSCSI), QEMU_CAPS_VIRTIO_SCSI }, - { "virtio-blk-s390", virQEMUCapsObjectPropsVirtioBlk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBlk), + { "virtio-blk-s390", virQEMUCapsDevicePropsVirtioBlk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBlk), QEMU_CAPS_VIRTIO_S390 }, - { "virtio-net-s390", virQEMUCapsObjectPropsVirtioNet, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioNet), + { "virtio-net-s390", virQEMUCapsDevicePropsVirtioNet, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioNet), QEMU_CAPS_DEVICE_VIRTIO_NET }, - { "pci-assign", virQEMUCapsObjectPropsPCIAssign, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), + { "pci-assign", virQEMUCapsDevicePropsPCIAssign, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPCIAssign), -1 }, - { "kvm-pci-assign", virQEMUCapsObjectPropsPCIAssign, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPCIAssign), + { "kvm-pci-assign", virQEMUCapsDevicePropsPCIAssign, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPCIAssign), -1 }, - { "vfio-pci", virQEMUCapsObjectPropsVfioPCI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVfioPCI), + { "vfio-pci", virQEMUCapsDevicePropsVfioPCI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVfioPCI), QEMU_CAPS_DEVICE_VFIO_PCI }, - { "scsi-disk", virQEMUCapsObjectPropsSCSIDisk, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIDisk), + { "scsi-disk", virQEMUCapsDevicePropsSCSIDisk, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSCSIDisk), -1 }, - { "ide-drive", virQEMUCapsObjectPropsIDEDrive, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsIDEDrive), + { "ide-drive", virQEMUCapsDevicePropsIDEDrive, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsIDEDrive), -1 }, - { "PIIX4_PM", virQEMUCapsObjectPropsPiix4PM, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsPiix4PM), + { "PIIX4_PM", virQEMUCapsDevicePropsPiix4PM, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsPiix4PM), -1 }, - { "usb-redir", virQEMUCapsObjectPropsUSBRedir, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBRedir), + { "usb-redir", virQEMUCapsDevicePropsUSBRedir, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBRedir), QEMU_CAPS_USB_REDIR }, - { "usb-host", virQEMUCapsObjectPropsUSBHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBHost), + { "usb-host", virQEMUCapsDevicePropsUSBHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBHost), -1 }, - { "scsi-generic", virQEMUCapsObjectPropsSCSIGeneric, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSCSIGeneric), + { "scsi-generic", virQEMUCapsDevicePropsSCSIGeneric, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSCSIGeneric), QEMU_CAPS_DEVICE_SCSI_GENERIC }, - { "i440FX-pcihost", virQEMUCapsObjectPropsI440FXPCIHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsI440FXPCIHost), + { "i440FX-pcihost", virQEMUCapsDevicePropsI440FXPCIHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsI440FXPCIHost), -1 }, - { "q35-pcihost", virQEMUCapsObjectPropsQ35PCIHost, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsQ35PCIHost), + { "q35-pcihost", virQEMUCapsDevicePropsQ35PCIHost, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsQ35PCIHost), -1 }, - { "usb-storage", virQEMUCapsObjectPropsUSBStorage, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage), + { "usb-storage", virQEMUCapsDevicePropsUSBStorage, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBStorage), QEMU_CAPS_DEVICE_USB_STORAGE }, - { "kvm-pit", virQEMUCapsObjectPropsKVMPit, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit), + { "kvm-pit", virQEMUCapsDevicePropsKVMPit, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsKVMPit), -1 }, - { "VGA", virQEMUCapsObjectPropsVGA, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA), + { "VGA", virQEMUCapsDevicePropsVGA, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVGA), QEMU_CAPS_DEVICE_VGA }, - { "vmware-svga", virQEMUCapsObjectPropsVmwareSvga, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga), + { "vmware-svga", virQEMUCapsDevicePropsVmwareSvga, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVmwareSvga), QEMU_CAPS_DEVICE_VMWARE_SVGA }, - { "qxl", virQEMUCapsObjectPropsQxl, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl), + { "qxl", virQEMUCapsDevicePropsQxl, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsQxl), QEMU_CAPS_DEVICE_QXL }, - { "virtio-gpu-pci", virQEMUCapsObjectPropsVirtioGpu, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), + { "virtio-gpu-pci", virQEMUCapsDevicePropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU }, - { "virtio-gpu-device", virQEMUCapsObjectPropsVirtioGpu, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioGpu), + { "virtio-gpu-device", virQEMUCapsDevicePropsVirtioGpu, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioGpu), QEMU_CAPS_DEVICE_VIRTIO_GPU }, - { "ICH9-LPC", virQEMUCapsObjectPropsICH9, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsICH9), + { "ICH9-LPC", virQEMUCapsDevicePropsICH9, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsICH9), -1 }, - { "virtio-balloon-pci", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-pci", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "virtio-balloon-ccw", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-ccw", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "virtio-balloon-device", virQEMUCapsObjectPropsVirtioBalloon, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsVirtioBalloon), + { "virtio-balloon-device", virQEMUCapsDevicePropsVirtioBalloon, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsVirtioBalloon), -1 }, - { "nec-usb-xhci", virQEMUCapsObjectPropsUSBNECXHCI, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBNECXHCI), + { "nec-usb-xhci", virQEMUCapsDevicePropsUSBNECXHCI, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsUSBNECXHCI), QEMU_CAPS_NEC_USB_XHCI }, - { "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU), + { "intel-iommu", virQEMUCapsDevicePropsIntelIOMMU, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsIntelIOMMU), QEMU_CAPS_DEVICE_INTEL_IOMMU }, - { "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge, - ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge), + { "spapr-pci-host-bridge", virQEMUCapsDevicePropsSpaprPCIHostBridge, + ARRAY_CARDINALITY(virQEMUCapsDevicePropsSpaprPCIHostBridge), QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, }; +/* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ +static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { + { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, + { "blockdev-add/arg-type/+gluster/debug", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, + { "blockdev-add/arg-type/+vxhs", QEMU_CAPS_VXHS}, + { "blockdev-add/arg-type/+iscsi/password-secret", QEMU_CAPS_ISCSI_PASSWORD_SECRET }, +}; + static void virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps, @@ -2081,15 +2088,15 @@ virQEMUCapsParseDeviceStr(virQEMUCapsPtr qemuCaps, const char *str) nvalues, values); virStringListFreeCount(values, nvalues); - for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { - const char *type = virQEMUCapsObjectProps[i].type; + for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsDeviceProps); i++) { + const char *type = virQEMUCapsDeviceProps[i].type; if ((nvalues = virQEMUCapsParseDeviceStrObjectProps(str, type, &values)) < 0) return -1; virQEMUCapsProcessStringFlags(qemuCaps, - virQEMUCapsObjectProps[i].nprops, - virQEMUCapsObjectProps[i].props, + virQEMUCapsDeviceProps[i].nprops, + virQEMUCapsDeviceProps[i].props, nvalues, values); virStringListFreeCount(values, nvalues); } @@ -2851,20 +2858,20 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, nvalues, values); virStringListFreeCount(values, nvalues); - for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { - const char *type = virQEMUCapsObjectProps[i].type; - int cap = virQEMUCapsObjectProps[i].capsCondition; + for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsDeviceProps); i++) { + const char *type = virQEMUCapsDeviceProps[i].type; + int cap = virQEMUCapsDeviceProps[i].capsCondition; if (cap >= 0 && !virQEMUCapsGet(qemuCaps, cap)) continue; - if ((nvalues = qemuMonitorGetObjectProps(mon, + if ((nvalues = qemuMonitorGetDeviceProps(mon, type, &values)) < 0) return -1; virQEMUCapsProcessStringFlags(qemuCaps, - virQEMUCapsObjectProps[i].nprops, - virQEMUCapsObjectProps[i].props, + virQEMUCapsDeviceProps[i].nprops, + virQEMUCapsDeviceProps[i].props, nvalues, values); virStringListFreeCount(values, nvalues); } diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1d67a97789..8ec759fe3f 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3942,7 +3942,7 @@ qemuMonitorGetObjectTypes(qemuMonitorPtr mon, int -qemuMonitorGetObjectProps(qemuMonitorPtr mon, +qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) { @@ -3950,7 +3950,7 @@ qemuMonitorGetObjectProps(qemuMonitorPtr mon, QEMU_CHECK_MONITOR_JSON(mon); - return qemuMonitorJSONGetObjectProps(mon, type, props); + return qemuMonitorJSONGetDeviceProps(mon, type, props); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index adfa87aba9..26074ef7dd 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1094,7 +1094,7 @@ int qemuMonitorGetKVMState(qemuMonitorPtr mon, int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, char ***types); -int qemuMonitorGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props); char *qemuMonitorGetTargetArch(qemuMonitorPtr mon); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 08dfffdf64..eb32811cd1 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6058,7 +6058,7 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, #undef MAKE_SET_CMD -int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index ec243becc4..4a1da725d1 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -441,7 +441,7 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, qemuMonitorJSONObjectPropertyPtr prop) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -- 2.14.3

On 03/09/2018 10:07 AM, Andrea Bolognani wrote:
In QOM, all devices are objects, which makes the existing names technically correct; however, not all objects are devices, and soon we're going to start looking for object properties in addition to device properties: the former need to go through a different code path, so we need to be able to tell them apart. Using more precise names is a good way to achieve that.
While renaming, hunks are also being moved around a bit: the new grouping, too, will make things nicer once we start adding support for object properties.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_capabilities.c | 239 ++++++++++++++++++++++--------------------- src/qemu/qemu_monitor.c | 4 +- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +- src/qemu/qemu_monitor_json.h | 2 +- 5 files changed, 128 insertions(+), 121 deletions(-)
This is unrelated to the v2.12/capabilities... although I imagine someone will be cursing at you for the merge conflicts they'll have. Reviewed-by: John Ferlan <jferlan@redhat.com> John note the minor nit ...
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c70bd27f18..83ec8a67d5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1559,6 +1559,13 @@ struct virQEMUCapsStringFlags { int flag; };
+struct virQEMUCapsObjectTypeProps { + const char *type; + struct virQEMUCapsStringFlags *props; + size_t nprops; + int capsCondition; +}; +
struct virQEMUCapsStringFlags virQEMUCapsCommands[] = { { "system_wakeup", QEMU_CAPS_WAKEUP }, @@ -1698,14 +1705,21 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "pl011", QEMU_CAPS_DEVICE_PL011 }, };
-static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVirtioBalloon[] = { +/* Device properties. + * + * The following can be probed either using the device-list-properties + * QMP command or, for older QEMU versions, from the help text obtained
s/or,/or/ s/, from/ IOW: QMP command or for older QEMU versions the help text obtained
+ * through the '-device xxx,?' command line option + */ + +static struct virQEMUCapsStringFlags virQEMUCapsDevicePropsVirtioBalloon[] = { { "deflate-on-oom", QEMU_CAPS_VIRTIO_BALLOON_AUTODEFLATE }, { "disable-legacy", QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY }, { "iommu_platform", QEMU_CAPS_VIRTIO_PCI_IOMMU_PLATFORM }, { "ats", QEMU_CAPS_VIRTIO_PCI_ATS }, };
[...]

Querying properties for devices and objects is identical except for the specific QMP command that needs to be called. Take the existing qemuMonitorJSONGetDeviceProps(), scrub all the device-specific parts, thus turning it into the generic helper qemuMonitorJSONGetProps(), which is then used to reimplement the original function and will be used again once object properties are needed. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_monitor_json.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index eb32811cd1..141873a705 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6058,9 +6058,11 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, #undef MAKE_SET_CMD -int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, - const char *type, - char ***props) +static int +qemuMonitorJSONGetProps(qemuMonitorPtr mon, + const char *type, + char ***props, + const char *impl) { int ret = -1; virJSONValuePtr cmd; @@ -6072,7 +6074,7 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, *props = NULL; - if (!(cmd = qemuMonitorJSONMakeCommand("device-list-properties", + if (!(cmd = qemuMonitorJSONMakeCommand(impl, "s:typename", type, NULL))) return -1; @@ -6090,8 +6092,9 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, if (!(data = virJSONValueObjectGetArray(reply, "return")) || (n = virJSONValueArraySize(data)) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("device-list-properties reply data was not an array")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("%s reply data was not an array"), + impl); goto cleanup; } @@ -6104,8 +6107,9 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *tmp; if (!(tmp = virJSONValueObjectGetString(child, "name"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("device-list-properties reply data was missing 'name'")); + virReportError(VIR_ERR_INTERNAL_ERROR, + _("%s reply data was missing 'name'"), + impl); goto cleanup; } @@ -6125,6 +6129,16 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, } +int +qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + return qemuMonitorJSONGetProps(mon, type, props, + "device-list-properties"); +} + + char * qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon) { -- 2.14.3

On 03/09/2018 10:07 AM, Andrea Bolognani wrote:
Querying properties for devices and objects is identical except for the specific QMP command that needs to be called.
Take the existing qemuMonitorJSONGetDeviceProps(), scrub all the device-specific parts, thus turning it into the generic helper qemuMonitorJSONGetProps(), which is then used to reimplement the original function and will be used again once object properties are needed.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_monitor_json.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index eb32811cd1..141873a705 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6058,9 +6058,11 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, #undef MAKE_SET_CMD
-int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, - const char *type, - char ***props) +static int +qemuMonitorJSONGetProps(qemuMonitorPtr mon,
Is perhaps this name too generic? How about JSONGetListProps where currently it's "device-list-properties", but shortly there will be "qom-list-properties". With some sort of API name adjustment, Reviewed-by: John Ferlan <jferlan@redhat.com> John
+ const char *type, + char ***props, + const char *impl) { int ret = -1; virJSONValuePtr cmd;
[...]

This is the first capability that depends on an object property, so we need to introduce a couple new functions at the same time. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_capabilities.c | 38 +++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_monitor.c | 13 ++ src/qemu/qemu_monitor.h | 3 + src/qemu/qemu_monitor_json.c | 10 ++ src/qemu/qemu_monitor_json.h | 5 + .../caps_2.12.0-gicv2.aarch64.replies | 24 ++- .../caps_2.12.0-gicv2.aarch64.xml | 2 +- .../caps_2.12.0-gicv3.aarch64.replies | 24 ++- .../caps_2.12.0-gicv3.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 170 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 3 +- .../caps_2.12.0.x86_64.replies | 30 ++-- tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 2 +- 14 files changed, 289 insertions(+), 38 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 83ec8a67d5..0165de0407 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -460,6 +460,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "machine.pseries.max-cpu-compat", "dump-completed", "qom-list-properties", + "machine.pseries.cap-htm", ); @@ -1950,6 +1951,21 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, }; +/* Object properties. + * + * The following can be probed using the qom-list-properties QMP command + */ + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSPAPRMachine[] = { + { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM }, +}; + +static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { + { "spapr-machine", virQEMUCapsObjectPropsSPAPRMachine, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsSPAPRMachine), + -1 }, +}; + /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, @@ -2876,6 +2892,28 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, virStringListFreeCount(values, nvalues); } + /* If the qom-list-properties QMP command is available, then we + * can probe objects in addition to devices */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QOM_LIST_PROPERTIES)) { + for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { + const char *type = virQEMUCapsObjectProps[i].type; + int cap = virQEMUCapsObjectProps[i].capsCondition; + + if (cap >= 0 && !virQEMUCapsGet(qemuCaps, cap)) + continue; + + if ((nvalues = qemuMonitorGetObjectProps(mon, + type, + &values)) < 0) + return -1; + virQEMUCapsProcessStringFlags(qemuCaps, + virQEMUCapsObjectProps[i].nprops, + virQEMUCapsObjectProps[i].props, + nvalues, values); + virStringListFreeCount(values, nvalues); + } + } + /* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC)) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ce07dfd6b1..62a1138130 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -445,6 +445,7 @@ typedef enum { QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */ QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */ QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties QMP command */ + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, /* -machine pseries,cap-htm= */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8ec759fe3f..6e43d268e1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3954,6 +3954,19 @@ qemuMonitorGetDeviceProps(qemuMonitorPtr mon, } +int +qemuMonitorGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + VIR_DEBUG("type=%s props=%p", type, props); + + QEMU_CHECK_MONITOR_JSON(mon); + + return qemuMonitorJSONGetObjectProps(mon, type, props); +} + + char * qemuMonitorGetTargetArch(qemuMonitorPtr mon) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 26074ef7dd..e83e49cd51 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1097,6 +1097,9 @@ int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, int qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props); +int qemuMonitorGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props); char *qemuMonitorGetTargetArch(qemuMonitorPtr mon); int qemuMonitorNBDServerStart(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 141873a705..bb7e6e12e7 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6139,6 +6139,16 @@ qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, } +int +qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + return qemuMonitorJSONGetProps(mon, type, props, + "qom-list-properties"); +} + + char * qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 4a1da725d1..2ce208845a 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -445,6 +445,11 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); +int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) + ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); + char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon); int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies index 9b1ed887e9..1a328d6bce 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies @@ -5208,6 +5208,14 @@ "id": "libvirt-35" } +{ + "id": "libvirt-36", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -5497,7 +5505,7 @@ "cpu-max": 1 } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5668,20 +5676,20 @@ "static": false } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "emulator" ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6838,7 +6846,7 @@ "option": "drive" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6896,7 +6904,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16953,7 +16961,7 @@ "meta-type": "object" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16969,7 +16977,7 @@ "kernel": true } ], - "id": "libvirt-43" + "id": "libvirt-44" } { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml index 9c4e40973b..dab701b726 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml @@ -190,7 +190,7 @@ <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>315524</microcodeVersion> + <microcodeVersion>315645</microcodeVersion> <package> (v2.11.0-2110-gf6d81cd)</package> <arch>aarch64</arch> <cpu type='kvm' name='pxa262'/> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies index 9a12b14569..6a4302f2e0 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies @@ -5208,6 +5208,14 @@ "id": "libvirt-35" } +{ + "id": "libvirt-36", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -5497,7 +5505,7 @@ "cpu-max": 1 } ], - "id": "libvirt-36" + "id": "libvirt-37" } { @@ -5668,20 +5676,20 @@ "static": false } ], - "id": "libvirt-37" + "id": "libvirt-38" } { "return": [ ], - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ "emulator" ], - "id": "libvirt-39" + "id": "libvirt-40" } { @@ -6838,7 +6846,7 @@ "option": "drive" } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -6896,7 +6904,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -16953,7 +16961,7 @@ "meta-type": "object" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -16969,7 +16977,7 @@ "kernel": false } ], - "id": "libvirt-43" + "id": "libvirt-44" } { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml index 06e0068cbd..d14c7948b4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml @@ -190,7 +190,7 @@ <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>315524</microcodeVersion> + <microcodeVersion>315645</microcodeVersion> <package> (v2.11.0-2110-gf6d81cd)</package> <arch>aarch64</arch> <cpu type='kvm' name='pxa262'/> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies index 0ccf0ad403..e941e59995 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies @@ -5279,6 +5279,162 @@ "id": "libvirt-36" } +{ + "return": [ + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root node", + "type": "string" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "cap-ibs", + "description": "Indirect Branch Speculation (broken, fixed-ibs, fixed-ccd)", + "type": "string" + }, + { + "name": "cap-cfpc", + "description": "Cache Flush on Privilege Change (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-sbbc", + "description": "Speculation Barrier Bounds Checking (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-dfp", + "description": "Allow Decimal Floating Point (DFP)", + "type": "bool" + }, + { + "name": "cap-htm", + "description": "Allow Hardware Transactional Memory (HTM)", + "type": "bool" + }, + { + "name": "cap-vsx", + "description": "Allow Vector Scalar Extensions (VSX)", + "type": "bool" + }, + { + "name": "cap-ibs", + "description": "Indirect Branch Speculation (broken, fixed-ibs, fixed-ccd)", + "type": "string" + }, + { + "name": "cap-cfpc", + "description": "Cache Flush on Privilege Change (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-sbbc", + "description": "Speculation Barrier Bounds Checking (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-dfp", + "description": "Allow Decimal Floating Point (DFP)", + "type": "bool" + }, + { + "name": "cap-htm", + "description": "Allow Hardware Transactional Memory (HTM)", + "type": "bool" + }, + { + "name": "cap-vsx", + "description": "Allow Vector Scalar Extensions (VSX)", + "type": "bool" + } + ], + "id": "libvirt-37" +} + { "return": [ { @@ -5414,7 +5570,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-38" } { @@ -7610,20 +7766,20 @@ "static": false } ], - "id": "libvirt-38" + "id": "libvirt-39" } { "return": [ ], - "id": "libvirt-39" + "id": "libvirt-40" } { "return": [ "emulator" ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -8775,7 +8931,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -8833,7 +8989,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -18890,7 +19046,7 @@ "meta-type": "object" } ], - "id": "libvirt-43" + "id": "libvirt-44" } { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml index a0df689c25..0a2b64e157 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -186,9 +186,10 @@ <flag name='machine.pseries.max-cpu-compat'/> <flag name='dump-completed'/> <flag name='qom-list-properties'/> + <flag name='machine.pseries.cap-htm'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>393199</microcodeVersion> + <microcodeVersion>397043</microcodeVersion> <package> (v2.11.0-2110-gf6d81cd)</package> <arch>ppc64</arch> <cpu type='kvm' name='default'/> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies index c161dd006b..c06bafa4ba 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -4609,6 +4609,14 @@ "id": "libvirt-39" } +{ + "id": "libvirt-40", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -4815,7 +4823,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" } { @@ -5329,7 +5337,7 @@ "migration-safe": true } ], - "id": "libvirt-41" + "id": "libvirt-42" } { @@ -5337,7 +5345,7 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" } { @@ -5345,7 +5353,7 @@ "passthrough", "emulator" ], - "id": "libvirt-43" + "id": "libvirt-44" } { @@ -6636,7 +6644,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" } { @@ -6694,7 +6702,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-45" + "id": "libvirt-46" } { @@ -16751,7 +16759,7 @@ "meta-type": "object" } ], - "id": "libvirt-46" + "id": "libvirt-47" } { @@ -16939,7 +16947,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" } { @@ -17192,7 +17200,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" } { @@ -17380,7 +17388,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" } { @@ -17633,7 +17641,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" } { diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index fbdde1733f..dd910853f4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -231,7 +231,7 @@ <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>364740</microcodeVersion> + <microcodeVersion>364861</microcodeVersion> <package> (v2.11.0-2110-gf6d81cdec8-dirty)</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'> -- 2.14.3

On 03/09/2018 10:07 AM, Andrea Bolognani wrote:
This is the first capability that depends on an object property, so we need to introduce a couple new functions at the same time.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- src/qemu/qemu_capabilities.c | 38 +++++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_monitor.c | 13 ++ src/qemu/qemu_monitor.h | 3 + src/qemu/qemu_monitor_json.c | 10 ++ src/qemu/qemu_monitor_json.h | 5 + .../caps_2.12.0-gicv2.aarch64.replies | 24 ++- .../caps_2.12.0-gicv2.aarch64.xml | 2 +- .../caps_2.12.0-gicv3.aarch64.replies | 24 ++- .../caps_2.12.0-gicv3.aarch64.xml | 2 +- .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 170 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 3 +- .../caps_2.12.0.x86_64.replies | 30 ++-- tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 2 +- 14 files changed, 289 insertions(+), 38 deletions(-)
In general - looks reasonable - although need to wait for respin once we create the "more official" 2.12 caps...
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 83ec8a67d5..0165de0407 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -460,6 +460,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "machine.pseries.max-cpu-compat", "dump-completed", "qom-list-properties", + "machine.pseries.cap-htm", );
@@ -1950,6 +1951,21 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = { QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE }, };
+/* Object properties. + * + * The following can be probed using the qom-list-properties QMP command + */ + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsSPAPRMachine[] = { + { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM }, +}; + +static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { + { "spapr-machine", virQEMUCapsObjectPropsSPAPRMachine, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsSPAPRMachine), + -1 }, +}; + /* see documentation for virQEMUCapsQMPSchemaGetByPath for the query format */ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = { { "blockdev-add/arg-type/options/+gluster/debug-level", QEMU_CAPS_GLUSTER_DEBUG_LEVEL}, @@ -2876,6 +2892,28 @@ virQEMUCapsProbeQMPObjects(virQEMUCapsPtr qemuCaps, virStringListFreeCount(values, nvalues); }
+ /* If the qom-list-properties QMP command is available, then we + * can probe objects in addition to devices */ + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QOM_LIST_PROPERTIES)) { + for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsObjectProps); i++) { + const char *type = virQEMUCapsObjectProps[i].type; + int cap = virQEMUCapsObjectProps[i].capsCondition; + + if (cap >= 0 && !virQEMUCapsGet(qemuCaps, cap)) + continue; + + if ((nvalues = qemuMonitorGetObjectProps(mon, + type, + &values)) < 0) + return -1; + virQEMUCapsProcessStringFlags(qemuCaps, + virQEMUCapsObjectProps[i].nprops, + virQEMUCapsObjectProps[i].props, + nvalues, values); + virStringListFreeCount(values, nvalues); + } + } +
Is it worth creating a helper that takes the "virQEMUCapsDeviceProps" and "virQEMUCapsObjectProps" as input - since this is mostly cut-n-paste of the same code. Not required... John
/* Prefer -chardev spicevmc (detected earlier) over -device spicevmc */ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC)) virQEMUCapsClear(qemuCaps, QEMU_CAPS_DEVICE_SPICEVMC); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index ce07dfd6b1..62a1138130 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -445,6 +445,7 @@ typedef enum { QEMU_CAPS_MACHINE_PSERIES_MAX_CPU_COMPAT, /* -machine pseries,max-cpu-compat= */ QEMU_CAPS_DUMP_COMPLETED, /* DUMP_COMPLETED event */ QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties QMP command */ + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, /* -machine pseries,cap-htm= */
QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8ec759fe3f..6e43d268e1 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3954,6 +3954,19 @@ qemuMonitorGetDeviceProps(qemuMonitorPtr mon, }
+int +qemuMonitorGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + VIR_DEBUG("type=%s props=%p", type, props); + + QEMU_CHECK_MONITOR_JSON(mon); + + return qemuMonitorJSONGetObjectProps(mon, type, props); +} + + char * qemuMonitorGetTargetArch(qemuMonitorPtr mon) { diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 26074ef7dd..e83e49cd51 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1097,6 +1097,9 @@ int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, int qemuMonitorGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props); +int qemuMonitorGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props); char *qemuMonitorGetTargetArch(qemuMonitorPtr mon);
int qemuMonitorNBDServerStart(qemuMonitorPtr mon, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 141873a705..bb7e6e12e7 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6139,6 +6139,16 @@ qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, }
+int +qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) +{ + return qemuMonitorJSONGetProps(mon, type, props, + "qom-list-properties"); +} + + char * qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon) { diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 4a1da725d1..2ce208845a 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -445,6 +445,11 @@ int qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, const char *type, char ***props) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); +int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, + const char *type, + char ***props) + ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); + char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon);
int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies index 9b1ed887e9..1a328d6bce 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies @@ -5208,6 +5208,14 @@ "id": "libvirt-35" }
+{ + "id": "libvirt-36", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -5497,7 +5505,7 @@ "cpu-max": 1 } ], - "id": "libvirt-36" + "id": "libvirt-37" }
{ @@ -5668,20 +5676,20 @@ "static": false } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ "return": [ ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ "return": [ "emulator" ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -6838,7 +6846,7 @@ "option": "drive" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -6896,7 +6904,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-41" + "id": "libvirt-42" }
{ @@ -16953,7 +16961,7 @@ "meta-type": "object" } ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ @@ -16969,7 +16977,7 @@ "kernel": true } ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml index 9c4e40973b..dab701b726 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml @@ -190,7 +190,7 @@ <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>315524</microcodeVersion> + <microcodeVersion>315645</microcodeVersion> <package> (v2.11.0-2110-gf6d81cd)</package> <arch>aarch64</arch> <cpu type='kvm' name='pxa262'/> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies index 9a12b14569..6a4302f2e0 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies @@ -5208,6 +5208,14 @@ "id": "libvirt-35" }
+{ + "id": "libvirt-36", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -5497,7 +5505,7 @@ "cpu-max": 1 } ], - "id": "libvirt-36" + "id": "libvirt-37" }
{ @@ -5668,20 +5676,20 @@ "static": false } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ "return": [ ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ "return": [ "emulator" ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ @@ -6838,7 +6846,7 @@ "option": "drive" } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -6896,7 +6904,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-41" + "id": "libvirt-42" }
{ @@ -16953,7 +16961,7 @@ "meta-type": "object" } ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ @@ -16969,7 +16977,7 @@ "kernel": false } ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml index 06e0068cbd..d14c7948b4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml @@ -190,7 +190,7 @@ <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>315524</microcodeVersion> + <microcodeVersion>315645</microcodeVersion> <package> (v2.11.0-2110-gf6d81cd)</package> <arch>aarch64</arch> <cpu type='kvm' name='pxa262'/> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies index 0ccf0ad403..e941e59995 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies @@ -5279,6 +5279,162 @@ "id": "libvirt-36" }
+{ + "return": [ + { + "name": "graphics", + "description": "Set on/off to enable/disable graphics emulation", + "type": "bool" + }, + { + "name": "phandle-start", + "description": "The first phandle ID we may generate dynamically", + "type": "int" + }, + { + "name": "dump-guest-core", + "description": "Include guest memory in a core dump", + "type": "bool" + }, + { + "name": "kernel-irqchip", + "description": "Configure KVM in-kernel irqchip", + "type": "on|off|split" + }, + { + "name": "accel", + "description": "Accelerator list", + "type": "string" + }, + { + "name": "append", + "description": "Linux kernel command line", + "type": "string" + }, + { + "name": "dumpdtb", + "description": "Dump current dtb to a file and quit", + "type": "string" + }, + { + "name": "igd-passthru", + "description": "Set on/off to enable/disable igd passthrou", + "type": "bool" + }, + { + "name": "dt-compatible", + "description": "Overrides the \"compatible\" property of the dt root node", + "type": "string" + }, + { + "name": "kernel", + "description": "Linux kernel image file", + "type": "string" + }, + { + "name": "usb", + "description": "Set on/off to enable/disable usb", + "type": "bool" + }, + { + "name": "suppress-vmdesc", + "description": "Set on to disable self-describing migration", + "type": "bool" + }, + { + "name": "dtb", + "description": "Linux kernel device tree file", + "type": "string" + }, + { + "name": "firmware", + "description": "Firmware image", + "type": "string" + }, + { + "name": "mem-merge", + "description": "Enable/disable memory merge support", + "type": "bool" + }, + { + "name": "initrd", + "description": "Linux initial ramdisk file", + "type": "string" + }, + { + "name": "enforce-config-section", + "description": "Set on to enforce configuration section migration", + "type": "bool" + }, + { + "name": "kvm-shadow-mem", + "description": "KVM shadow MMU size", + "type": "int" + }, + { + "name": "cap-ibs", + "description": "Indirect Branch Speculation (broken, fixed-ibs, fixed-ccd)", + "type": "string" + }, + { + "name": "cap-cfpc", + "description": "Cache Flush on Privilege Change (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-sbbc", + "description": "Speculation Barrier Bounds Checking (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-dfp", + "description": "Allow Decimal Floating Point (DFP)", + "type": "bool" + }, + { + "name": "cap-htm", + "description": "Allow Hardware Transactional Memory (HTM)", + "type": "bool" + }, + { + "name": "cap-vsx", + "description": "Allow Vector Scalar Extensions (VSX)", + "type": "bool" + }, + { + "name": "cap-ibs", + "description": "Indirect Branch Speculation (broken, fixed-ibs, fixed-ccd)", + "type": "string" + }, + { + "name": "cap-cfpc", + "description": "Cache Flush on Privilege Change (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-sbbc", + "description": "Speculation Barrier Bounds Checking (broken, workaround, fixed)", + "type": "string" + }, + { + "name": "cap-dfp", + "description": "Allow Decimal Floating Point (DFP)", + "type": "bool" + }, + { + "name": "cap-htm", + "description": "Allow Hardware Transactional Memory (HTM)", + "type": "bool" + }, + { + "name": "cap-vsx", + "description": "Allow Vector Scalar Extensions (VSX)", + "type": "bool" + } + ], + "id": "libvirt-37" +} + { "return": [ { @@ -5414,7 +5570,7 @@ "cpu-max": 1 } ], - "id": "libvirt-37" + "id": "libvirt-38" }
{ @@ -7610,20 +7766,20 @@ "static": false } ], - "id": "libvirt-38" + "id": "libvirt-39" }
{ "return": [ ], - "id": "libvirt-39" + "id": "libvirt-40" }
{ "return": [ "emulator" ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -8775,7 +8931,7 @@ "option": "drive" } ], - "id": "libvirt-41" + "id": "libvirt-42" }
{ @@ -8833,7 +8989,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ @@ -18890,7 +19046,7 @@ "meta-type": "object" } ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml index a0df689c25..0a2b64e157 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -186,9 +186,10 @@ <flag name='machine.pseries.max-cpu-compat'/> <flag name='dump-completed'/> <flag name='qom-list-properties'/> + <flag name='machine.pseries.cap-htm'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>393199</microcodeVersion> + <microcodeVersion>397043</microcodeVersion> <package> (v2.11.0-2110-gf6d81cd)</package> <arch>ppc64</arch> <cpu type='kvm' name='default'/> diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies index c161dd006b..c06bafa4ba 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -4609,6 +4609,14 @@ "id": "libvirt-39" }
+{ + "id": "libvirt-40", + "error": { + "class": "DeviceNotFound", + "desc": "Class 'spapr-machine' not found" + } +} + { "return": [ { @@ -4815,7 +4823,7 @@ "cpu-max": 255 } ], - "id": "libvirt-40" + "id": "libvirt-41" }
{ @@ -5329,7 +5337,7 @@ "migration-safe": true } ], - "id": "libvirt-41" + "id": "libvirt-42" }
{ @@ -5337,7 +5345,7 @@ "tpm-crb", "tpm-tis" ], - "id": "libvirt-42" + "id": "libvirt-43" }
{ @@ -5345,7 +5353,7 @@ "passthrough", "emulator" ], - "id": "libvirt-43" + "id": "libvirt-44" }
{ @@ -6636,7 +6644,7 @@ "option": "drive" } ], - "id": "libvirt-44" + "id": "libvirt-45" }
{ @@ -6694,7 +6702,7 @@ "capability": "x-multifd" } ], - "id": "libvirt-45" + "id": "libvirt-46" }
{ @@ -16751,7 +16759,7 @@ "meta-type": "object" } ], - "id": "libvirt-46" + "id": "libvirt-47" }
{ @@ -16939,7 +16947,7 @@ } } }, - "id": "libvirt-47" + "id": "libvirt-48" }
{ @@ -17192,7 +17200,7 @@ } } }, - "id": "libvirt-48" + "id": "libvirt-49" }
{ @@ -17380,7 +17388,7 @@ } } }, - "id": "libvirt-49" + "id": "libvirt-50" }
{ @@ -17633,7 +17641,7 @@ } } }, - "id": "libvirt-50" + "id": "libvirt-51" }
{ diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml index fbdde1733f..dd910853f4 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -231,7 +231,7 @@ <flag name='qom-list-properties'/> <version>2011050</version> <kvmVersion>0</kvmVersion> - <microcodeVersion>364740</microcodeVersion> + <microcodeVersion>364861</microcodeVersion> <package> (v2.11.0-2110-gf6d81cdec8-dirty)</package> <arch>x86_64</arch> <hostCPU type='kvm' model='base' migratability='yes'>

This is the first in a list of pSeries-specific optional features that have recently been introduced in QEMU. Along with the feature proper, some generic code that will make it easier to implement subsequent features is introduced as well. Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/formatdomain.html.in | 7 + docs/schemas/domaincommon.rng | 5 + src/conf/domain_conf.c | 19 +++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 149 +++++++++++++++++++++ src/qemu/qemu_domain.c | 13 ++ .../pseries-features-invalid-machine.xml | 1 + tests/qemuxml2argvdata/pseries-features.args | 2 +- tests/qemuxml2argvdata/pseries-features.xml | 1 + tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 1 + 11 files changed, 199 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6fd2189cd2..51400afa49 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2057,6 +2057,13 @@ the attribute is not defined, the hypervisor default will be used. <span class="since">Since 3.10.0</span> (QEMU/KVM only) </dd> + <dt><code>htm</code></dt> + <dd>Configure HTM (Hardware Transational Memory) availability for + pSeries guests. Possible values for the <code>state</code> attribute + are <code>on</code> and <code>off</code>. If the attribute is not + defined, the hypervisor default will be used. + <span class="since">Since 4.2.0</span> (QEMU/KVM only) + </dd> <dt><code>vmcoreinfo</code></dt> <dd>Enable QEMU vmcoreinfo device to let the guest kernel save debug details. <span class="since">Since 3.10.0</span> (QEMU only) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8165e699d6..b4143f5bc3 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4797,6 +4797,11 @@ <optional> <ref name="hpt"/> </optional> + <optional> + <element name="htm"> + <ref name="featurestate"/> + </element> + </optional> <optional> <ref name="vmcoreinfo"/> </optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 70b19311b4..98897d3a63 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -152,6 +152,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "ioapic", "hpt", "vmcoreinfo", + "htm", ); VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST, @@ -19297,6 +19298,22 @@ virDomainDefParseXML(xmlDocPtr xml, } break; + case VIR_DOMAIN_FEATURE_HTM: + if (!(tmp = virXMLPropString(nodes[i], "state"))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("missing state attribute '%s' of feature '%s'"), + tmp, virDomainFeatureTypeToString(val)); + goto error; + } + if ((def->features[val] = virTristateSwitchTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown state attribute '%s' of feature '%s'"), + tmp, virDomainFeatureTypeToString(val)); + goto error; + } + VIR_FREE(tmp); + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; @@ -21384,6 +21401,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_HTM: if (src->features[i] != dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s' differs: " @@ -26845,6 +26863,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_HTM: switch ((virTristateSwitch) def->features[i]) { case VIR_TRISTATE_SWITCH_LAST: case VIR_TRISTATE_SWITCH_ABSENT: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5859c8f4b1..b87a9d9de2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1746,6 +1746,7 @@ typedef enum { VIR_DOMAIN_FEATURE_IOAPIC, VIR_DOMAIN_FEATURE_HPT, VIR_DOMAIN_FEATURE_VMCOREINFO, + VIR_DOMAIN_FEATURE_HTM, VIR_DOMAIN_FEATURE_LAST } virDomainFeature; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fa0aa5d5c3..d58211c4c6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7117,6 +7117,113 @@ qemuBuildNameCommandLine(virCommandPtr cmd, return 0; } +static int +virDomainFeatureToQEMUCaps(int feature) +{ + switch ((virDomainFeature) feature) { + case VIR_DOMAIN_FEATURE_HTM: + return QEMU_CAPS_MACHINE_PSERIES_CAP_HTM; + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_LAST: + default: + return -1; + } + + return -1; +} + +static const char* +virDomainFeatureToMachineOption(int feature) +{ + switch ((virDomainFeature) feature) { + case VIR_DOMAIN_FEATURE_HTM: + return "cap-htm"; + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_LAST: + default: + return NULL; + } + + return NULL; +} + +static int +qemuBuildMachineCommandLineFeature(virBufferPtr buf, + virDomainFeature feature, + const char *value, + virQEMUCapsPtr qemuCaps) +{ + const char *name; + const char *option; + int cap; + int ret = -1; + + if (!(name = virDomainFeatureTypeToString(feature))) { + virReportEnumRangeError(virDomainFeature, feature); + goto cleanup; + } + + if (!(option = virDomainFeatureToMachineOption(feature))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown QEMU option for '%s' feature"), + name); + goto cleanup; + } + + if ((cap = virDomainFeatureToQEMUCaps(feature)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown QEMU capability for '%s' feature"), + name); + goto cleanup; + } + + if (cap > 0 && !virQEMUCapsGet(qemuCaps, cap)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'%s' feature not supported by this QEMU binary"), + name); + goto cleanup; + } + + virBufferAsprintf(buf, ",%s=%s", option, value); + + ret = 0; + + cleanup: + return ret; +} + static int qemuBuildMachineCommandLine(virCommandPtr cmd, virQEMUDriverConfigPtr cfg, @@ -7343,6 +7450,48 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAsprintf(&buf, ",resize-hpt=%s", str); } + for (i = 0; i < VIR_DOMAIN_FEATURE_LAST; i++) { + const char *value; + + switch ((virDomainFeature) i) { + case VIR_DOMAIN_FEATURE_HTM: + if (def->features[i] == VIR_TRISTATE_SWITCH_ABSENT) + break; + + if (!(value = virTristateSwitchTypeToString(def->features[i]))) { + virReportEnumRangeError(virTristateSwitch, def->features[i]); + goto cleanup; + } + + if (qemuBuildMachineCommandLineFeature(&buf, i, value, qemuCaps) < 0) + goto cleanup; + break; + + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + break; + + case VIR_DOMAIN_FEATURE_LAST: + default: + break; + } + } + if (cpu && cpu->model && cpu->mode == VIR_CPU_MODE_HOST_MODEL && qemuDomainIsPSeries(def) && diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b55013de6a..35d84adae3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3377,6 +3377,19 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) } break; + case VIR_DOMAIN_FEATURE_HTM: + if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT && + !qemuDomainIsPSeries(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is not supported for " + "architecture '%s' or machine type '%s'"), + featureName, + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: diff --git a/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml b/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml index 5a6bb02d5b..76cbf0737f 100644 --- a/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml +++ b/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml @@ -9,6 +9,7 @@ <features> <!-- pSeries features can't be enabled for non-pSeries guests --> <hpt resizing='enabled'/> + <htm state='on'/> </features> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2argvdata/pseries-features.args index 8cdb329651..0517ca8237 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -7,7 +7,7 @@ QEMU_AUDIO_DRV=none \ /usr/bin/qemu-system-ppc64 \ -name guest \ -S \ --machine pseries,accel=tcg,resize-hpt=required \ +-machine pseries,accel=tcg,resize-hpt=required,cap-htm=on \ -m 512 \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2argvdata/pseries-features.xml index 5dd0dbd0be..a0e98db8b2 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -10,6 +10,7 @@ </os> <features> <hpt resizing='required'/> + <htm state='on'/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ca53912ebe..03f8c429e0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1898,6 +1898,7 @@ mymain(void) DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); DO_TEST_FAILURE("pseries-features", QEMU_CAPS_MACHINE_OPT); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a363b55446..b9a8bd6f14 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -765,6 +765,7 @@ mymain(void) DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); DO_TEST("pseries-serial-native", -- 2.14.3

On 03/09/2018 10:07 AM, Andrea Bolognani wrote:
This is the first in a list of pSeries-specific optional features that have recently been introduced in QEMU. Along with the feature proper, some generic code that will make it easier to implement subsequent features is introduced as well.
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/formatdomain.html.in | 7 + docs/schemas/domaincommon.rng | 5 + src/conf/domain_conf.c | 19 +++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 149 +++++++++++++++++++++ src/qemu/qemu_domain.c | 13 ++ .../pseries-features-invalid-machine.xml | 1 + tests/qemuxml2argvdata/pseries-features.args | 2 +- tests/qemuxml2argvdata/pseries-features.xml | 1 + tests/qemuxml2argvtest.c | 1 + tests/qemuxml2xmltest.c | 1 + 11 files changed, 199 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 6fd2189cd2..51400afa49 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2057,6 +2057,13 @@ the attribute is not defined, the hypervisor default will be used. <span class="since">Since 3.10.0</span> (QEMU/KVM only) </dd> + <dt><code>htm</code></dt> + <dd>Configure HTM (Hardware Transational Memory) availability for + pSeries guests. Possible values for the <code>state</code> attribute + are <code>on</code> and <code>off</code>. If the attribute is not + defined, the hypervisor default will be used. + <span class="since">Since 4.2.0</span> (QEMU/KVM only) + </dd> <dt><code>vmcoreinfo</code></dt> <dd>Enable QEMU vmcoreinfo device to let the guest kernel save debug details. <span class="since">Since 3.10.0</span> (QEMU only) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8165e699d6..b4143f5bc3 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4797,6 +4797,11 @@ <optional> <ref name="hpt"/> </optional> + <optional> + <element name="htm"> + <ref name="featurestate"/> + </element> + </optional> <optional> <ref name="vmcoreinfo"/> </optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 70b19311b4..98897d3a63 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -152,6 +152,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "ioapic", "hpt", "vmcoreinfo", + "htm", );
VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST, @@ -19297,6 +19298,22 @@ virDomainDefParseXML(xmlDocPtr xml, } break;
+ case VIR_DOMAIN_FEATURE_HTM: + if (!(tmp = virXMLPropString(nodes[i], "state"))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("missing state attribute '%s' of feature '%s'"), + tmp, virDomainFeatureTypeToString(val)); + goto error; + } + if ((def->features[val] = virTristateSwitchTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown state attribute '%s' of feature '%s'"), + tmp, virDomainFeatureTypeToString(val)); + goto error; + } + VIR_FREE(tmp); + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; @@ -21384,6 +21401,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_SMM: case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_HTM: if (src->features[i] != dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%s' differs: " @@ -26845,6 +26863,7 @@ virDomainDefFormatInternal(virDomainDefPtr def, case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_HTM: switch ((virTristateSwitch) def->features[i]) { case VIR_TRISTATE_SWITCH_LAST: case VIR_TRISTATE_SWITCH_ABSENT: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 5859c8f4b1..b87a9d9de2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1746,6 +1746,7 @@ typedef enum { VIR_DOMAIN_FEATURE_IOAPIC, VIR_DOMAIN_FEATURE_HPT, VIR_DOMAIN_FEATURE_VMCOREINFO, + VIR_DOMAIN_FEATURE_HTM,
VIR_DOMAIN_FEATURE_LAST } virDomainFeature; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fa0aa5d5c3..d58211c4c6 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7117,6 +7117,113 @@ qemuBuildNameCommandLine(virCommandPtr cmd, return 0; }
This looks particularly useful for other commands, but...
+static int +virDomainFeatureToQEMUCaps(int feature) +{ + switch ((virDomainFeature) feature) { + case VIR_DOMAIN_FEATURE_HTM: + return QEMU_CAPS_MACHINE_PSERIES_CAP_HTM; + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_LAST: + default: + return -1; + } + + return -1; +} + +static const char* +virDomainFeatureToMachineOption(int feature) +{ + switch ((virDomainFeature) feature) { + case VIR_DOMAIN_FEATURE_HTM: + return "cap-htm"; + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_LAST: + default: + return NULL; + } + + return NULL; +} + +static int +qemuBuildMachineCommandLineFeature(virBufferPtr buf, + virDomainFeature feature, + const char *value, + virQEMUCapsPtr qemuCaps) +{ + const char *name; + const char *option; + int cap; + int ret = -1; + + if (!(name = virDomainFeatureTypeToString(feature))) { + virReportEnumRangeError(virDomainFeature, feature); + goto cleanup; + } + + if (!(option = virDomainFeatureToMachineOption(feature))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown QEMU option for '%s' feature"), + name); + goto cleanup; + } + + if ((cap = virDomainFeatureToQEMUCaps(feature)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown QEMU capability for '%s' feature"), + name); + goto cleanup; + } + + if (cap > 0 && !virQEMUCapsGet(qemuCaps, cap)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("'%s' feature not supported by this QEMU binary"), + name); + goto cleanup; + } + + virBufferAsprintf(buf, ",%s=%s", option, value); + + ret = 0; + + cleanup: + return ret; +} + static int qemuBuildMachineCommandLine(virCommandPtr cmd, virQEMUDriverConfigPtr cfg, @@ -7343,6 +7450,48 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAsprintf(&buf, ",resize-hpt=%s", str); }
+ for (i = 0; i < VIR_DOMAIN_FEATURE_LAST; i++) { + const char *value; + + switch ((virDomainFeature) i) { + case VIR_DOMAIN_FEATURE_HTM: + if (def->features[i] == VIR_TRISTATE_SWITCH_ABSENT) + break; + + if (!(value = virTristateSwitchTypeToString(def->features[i]))) { + virReportEnumRangeError(virTristateSwitch, def->features[i]); + goto cleanup; + } + + if (qemuBuildMachineCommandLineFeature(&buf, i, value, qemuCaps) < 0) + goto cleanup; + break; + + case VIR_DOMAIN_FEATURE_ACPI: + case VIR_DOMAIN_FEATURE_APIC: + case VIR_DOMAIN_FEATURE_PAE: + case VIR_DOMAIN_FEATURE_HAP: + case VIR_DOMAIN_FEATURE_VIRIDIAN: + case VIR_DOMAIN_FEATURE_PRIVNET: + case VIR_DOMAIN_FEATURE_HYPERV: + case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + case VIR_DOMAIN_FEATURE_CAPABILITIES: + case VIR_DOMAIN_FEATURE_PMU: + case VIR_DOMAIN_FEATURE_VMPORT: + case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_SMM: + case VIR_DOMAIN_FEATURE_IOAPIC: + case VIR_DOMAIN_FEATURE_HPT: + case VIR_DOMAIN_FEATURE_VMCOREINFO: + break; + + case VIR_DOMAIN_FEATURE_LAST: + default: + break; + } + } +
It's only generated/built for one - seems like a lot of work for little gain unless of course there's a plan to add in all the others. Without adding in others, one is left to wonder the "best" way to add things in the future. John
if (cpu && cpu->model && cpu->mode == VIR_CPU_MODE_HOST_MODEL && qemuDomainIsPSeries(def) && diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b55013de6a..35d84adae3 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3377,6 +3377,19 @@ qemuDomainDefValidateFeatures(const virDomainDef *def) } break;
+ case VIR_DOMAIN_FEATURE_HTM: + if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT && + !qemuDomainIsPSeries(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is not supported for " + "architecture '%s' or machine type '%s'"), + featureName, + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: case VIR_DOMAIN_FEATURE_PAE: diff --git a/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml b/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml index 5a6bb02d5b..76cbf0737f 100644 --- a/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml +++ b/tests/qemuxml2argvdata/pseries-features-invalid-machine.xml @@ -9,6 +9,7 @@ <features> <!-- pSeries features can't be enabled for non-pSeries guests --> <hpt resizing='enabled'/> + <htm state='on'/> </features> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2argvdata/pseries-features.args index 8cdb329651..0517ca8237 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -7,7 +7,7 @@ QEMU_AUDIO_DRV=none \ /usr/bin/qemu-system-ppc64 \ -name guest \ -S \ --machine pseries,accel=tcg,resize-hpt=required \ +-machine pseries,accel=tcg,resize-hpt=required,cap-htm=on \ -m 512 \ -smp 1,sockets=1,cores=1,threads=1 \ -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \ diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2argvdata/pseries-features.xml index 5dd0dbd0be..a0e98db8b2 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -10,6 +10,7 @@ </os> <features> <hpt resizing='required'/> + <htm state='on'/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index ca53912ebe..03f8c429e0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1898,6 +1898,7 @@ mymain(void)
DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); DO_TEST_FAILURE("pseries-features", QEMU_CAPS_MACHINE_OPT); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index a363b55446..b9a8bd6f14 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -765,6 +765,7 @@ mymain(void)
DO_TEST("pseries-features", QEMU_CAPS_MACHINE_OPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT);
DO_TEST("pseries-serial-native",

On Fri, 2018-03-16 at 11:33 -0400, John Ferlan wrote:
This looks particularly useful for other commands, but...
[...]
It's only generated/built for one - seems like a lot of work for little gain unless of course there's a plan to add in all the others. Without adding in others, one is left to wonder the "best" way to add things in the future.
The RFC versions of the series added three more features, which made very good use of the generic code introduced here. I've later decided to skip those features, at least initially, because QEMU added mitigated machine type variants that cover 99% of what people need. I'm still unconvinced there is a need to have more fine-grained knobs there, so those three features are probably not going to be introduced any time soon. Moreover, between the time I posted this series and today, I've learned that work on a POWER9-compatible version of HTM is progressing much faster than initially anticipated, so this last feature too might end up being unnecessary in the medium run. I'm still not sure about this last part, but there is enough uncertainty there that I would probably not push this before 4.2.0 is out even if it were fully R-b'd. Finally, it was always my intention, assuming the approach taken here had been considered good, to convert existing features to use it: I guess at this point the tables have turned and I should *start* with that instead :) -- Andrea Bolognani / Red Hat / Virtualization

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- docs/news.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index a51ca973e4..fc56f776ae 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -35,6 +35,15 @@ <libvirt> <release version="v4.2.0" date="unreleased"> <section title="New features"> + <change> + <summary> + qemu: Implement the HTM pSeries features + </summary> + <description> + Users can now decide whether HTM (Hardware Transactional Memory) + support should be available to the guest. + </description> + </change> </section> <section title="Improvements"> <change> -- 2.14.3

Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../caps_2.12.0-gicv2.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv2.aarch64.xml | 318 + .../caps_2.12.0-gicv3.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv3.aarch64.xml | 318 + .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 21091 +++++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1093 + .../caps_2.12.0.x86_64.replies | 19113 +++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1270 ++ tests/qemucapabilitiestest.c | 4 + 9 files changed, 77497 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies new file mode 100644 index 0000000000..9b1ed887e9 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies @@ -0,0 +1,17145 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cd)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml new file mode 100644 index 0000000000..c81dfcba43 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml @@ -0,0 +1,318 @@ +<qemuCaps> + <qemuctime>0</qemuctime> + <selfctime>0</selfctime> + <selfvers>0</selfvers> + <usedQMP/> [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies new file mode 100644 index 0000000000..9a12b14569 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies @@ -0,0 +1,17145 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cd)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml new file mode 100644 index 0000000000..fae7c26538 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml @@ -0,0 +1,318 @@ +<qemuCaps> + <qemuctime>0</qemuctime> + <selfctime>0</selfctime> + <selfvers>0</selfvers> + <usedQMP/> [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies new file mode 100644 index 0000000000..0ccf0ad403 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies @@ -0,0 +1,21091 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cd)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml new file mode 100644 index 0000000000..e82a7cd5dd --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -0,0 +1,1093 @@ +<qemuCaps> + <qemuctime>0</qemuctime> + <selfctime>0</selfctime> + <selfvers>0</selfvers> + <usedQMP/> [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies new file mode 100644 index 0000000000..c161dd006b --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies @@ -0,0 +1,19113 @@ +{ + "QMP": { + "version": { + "qemu": { + "micro": 50, + "minor": 11, + "major": 2 + }, + "package": " (v2.11.0-2110-gf6d81cdec8-dirty)" + }, + "capabilities": [ + ] + } +} [...] diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml new file mode 100644 index 0000000000..50b2ac52d3 --- /dev/null +++ b/tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml @@ -0,0 +1,1270 @@ +<qemuCaps> + <qemuctime>0</qemuctime> + <selfctime>0</selfctime> + <selfvers>0</selfvers> + <usedQMP/> [...] diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index f9e8e187c2..dcad02588c 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -177,13 +177,17 @@ mymain(void) DO_TEST("x86_64", "caps_2.8.0"); DO_TEST("x86_64", "caps_2.9.0"); DO_TEST("x86_64", "caps_2.10.0"); + DO_TEST("x86_64", "caps_2.12.0"); DO_TEST("aarch64", "caps_2.6.0-gicv2"); DO_TEST("aarch64", "caps_2.6.0-gicv3"); DO_TEST("aarch64", "caps_2.10.0-gicv2"); DO_TEST("aarch64", "caps_2.10.0-gicv3"); + DO_TEST("aarch64", "caps_2.12.0-gicv2"); + DO_TEST("aarch64", "caps_2.12.0-gicv3"); DO_TEST("ppc64", "caps_2.6.0"); DO_TEST("ppc64", "caps_2.9.0"); DO_TEST("ppc64", "caps_2.10.0"); + DO_TEST("ppc64", "caps_2.12.0"); DO_TEST("s390x", "caps_2.7.0"); DO_TEST("s390x", "caps_2.8.0"); DO_TEST("s390x", "caps_2.9.0"); -- 2.14.3

On 03/09/2018 10:18 AM, Andrea Bolognani wrote:
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../caps_2.12.0-gicv2.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv2.aarch64.xml | 318 + .../caps_2.12.0-gicv3.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv3.aarch64.xml | 318 + .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 21091 +++++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1093 + .../caps_2.12.0.x86_64.replies | 19113 +++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1270 ++ tests/qemucapabilitiestest.c | 4 + 9 files changed, 77497 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
What, not adventurous enough for s390 too?! :-) While 2.12 isn't "complete" yet, we may as well update now and then try to remember later on when 2.12 finalizes to do the final update. I was off trying to recollect the process of generating the files ;-) If you need to do an update w/ latest before pushing this, that's fine. Doesn't seem like anyone else is putting up the not yet flag, so in order to make progress... Reviewed-by: John Ferlan <jferlan@redhat.com> John

On Fri, Mar 16, 2018 at 10:33:30AM -0400, John Ferlan wrote:
On 03/09/2018 10:18 AM, Andrea Bolognani wrote:
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../caps_2.12.0-gicv2.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv2.aarch64.xml | 318 + .../caps_2.12.0-gicv3.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv3.aarch64.xml | 318 + .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 21091 +++++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1093 + .../caps_2.12.0.x86_64.replies | 19113 +++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1270 ++ tests/qemucapabilitiestest.c | 4 + 9 files changed, 77497 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
What, not adventurous enough for s390 too?! :-)
While 2.12 isn't "complete" yet, we may as well update now and then try to remember later on when 2.12 finalizes to do the final update. I was off trying to recollect the process of generating the files ;-)
We have hit feature freeze for QEMU. A few pull requests are still pending to be merged, but if you wait until middle of next week, the capabilities should not change again before release unless bad bugs are found. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On 03/16/2018 10:41 AM, Daniel P. Berrangé wrote:
On Fri, Mar 16, 2018 at 10:33:30AM -0400, John Ferlan wrote:
On 03/09/2018 10:18 AM, Andrea Bolognani wrote:
Signed-off-by: Andrea Bolognani <abologna@redhat.com> --- .../caps_2.12.0-gicv2.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv2.aarch64.xml | 318 + .../caps_2.12.0-gicv3.aarch64.replies | 17145 +++++++++++++++ .../caps_2.12.0-gicv3.aarch64.xml | 318 + .../qemucapabilitiesdata/caps_2.12.0.ppc64.replies | 21091 +++++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1093 + .../caps_2.12.0.x86_64.replies | 19113 +++++++++++++++++ tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml | 1270 ++ tests/qemucapabilitiestest.c | 4 + 9 files changed, 77497 insertions(+) create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.xml
What, not adventurous enough for s390 too?! :-)
While 2.12 isn't "complete" yet, we may as well update now and then try to remember later on when 2.12 finalizes to do the final update. I was off trying to recollect the process of generating the files ;-)
We have hit feature freeze for QEMU. A few pull requests are still pending to be merged, but if you wait until middle of next week, the capabilities should not change again before release unless bad bugs are found.
I see that 2.12 hit rc0... since there's a few series upstream that are essentially waiting for the real 2.12 replies/xml files - perhaps it'd be good to just update this patch and get it pushed... Then of course wait for the rush on qemu_capabilities.{c,h} updates... John

On Wed, 2018-03-21 at 07:34 -0400, John Ferlan wrote:
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies
What, not adventurous enough for s390 too?! :-)
I usually generate capabilities data on the native architecture, as that makes a diffence at least for aarch64. I've never bothered obtaining access to an s390x machine, but I guess it shouldn't be too difficult :)
While 2.12 isn't "complete" yet, we may as well update now and then try to remember later on when 2.12 finalizes to do the final update. I was off trying to recollect the process of generating the files ;-)
We have hit feature freeze for QEMU. A few pull requests are still pending to be merged, but if you wait until middle of next week, the capabilities should not change again before release unless bad bugs are found.
I see that 2.12 hit rc0... since there's a few series upstream that are essentially waiting for the real 2.12 replies/xml files - perhaps it'd be good to just update this patch and get it pushed...
I was not aware of other series being held up by this, but if there is indeed any I can definitely collect the data again using v2.12.0-rc0 and push. -- Andrea Bolognani / Red Hat / Virtualization

On 03/21/2018 09:03 AM, Andrea Bolognani wrote:
On Wed, 2018-03-21 at 07:34 -0400, John Ferlan wrote:
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies
What, not adventurous enough for s390 too?! :-)
I usually generate capabilities data on the native architecture, as that makes a diffence at least for aarch64. I've never bothered obtaining access to an s390x machine, but I guess it shouldn't be too difficult :)
While 2.12 isn't "complete" yet, we may as well update now and then try to remember later on when 2.12 finalizes to do the final update. I was off trying to recollect the process of generating the files ;-)
We have hit feature freeze for QEMU. A few pull requests are still pending to be merged, but if you wait until middle of next week, the capabilities should not change again before release unless bad bugs are found.
I see that 2.12 hit rc0... since there's a few series upstream that are essentially waiting for the real 2.12 replies/xml files - perhaps it'd be good to just update this patch and get it pushed...
I was not aware of other series being held up by this, but if there is indeed any I can definitely collect the data again using v2.12.0-rc0 and push.
Held up is perhaps a strong word, but there's a couple series where 2.12 is where a feature was added (sev - secure encrypted vms, chardev-fd-pass, query-cpus-fast, and of course 'this' series). Then there's the virtio-gpu-ccw that'll be impacted by changes or merges w/ qemu_capabilities. I know I have an unposted series that will have merge conflicts too... John

On Wed, Mar 21, 2018 at 02:03:18PM +0100, Andrea Bolognani wrote:
On Wed, 2018-03-21 at 07:34 -0400, John Ferlan wrote:
create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv2.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0-gicv3.aarch64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.ppc64.replies create mode 100644 tests/qemucapabilitiesdata/caps_2.12.0.x86_64.replies
What, not adventurous enough for s390 too?! :-)
I usually generate capabilities data on the native architecture, as that makes a diffence at least for aarch64. I've never bothered obtaining access to an s390x machine, but I guess it shouldn't be too difficult :)
While 2.12 isn't "complete" yet, we may as well update now and then try to remember later on when 2.12 finalizes to do the final update. I was off trying to recollect the process of generating the files ;-)
We have hit feature freeze for QEMU. A few pull requests are still pending to be merged, but if you wait until middle of next week, the capabilities should not change again before release unless bad bugs are found.
I see that 2.12 hit rc0... since there's a few series upstream that are essentially waiting for the real 2.12 replies/xml files - perhaps it'd be good to just update this patch and get it pushed...
I was not aware of other series being held up by this, but if there is indeed any I can definitely collect the data again using v2.12.0-rc0 and push.
Yeah, that's fine with me. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (3)
-
Andrea Bolognani
-
Daniel P. Berrangé
-
John Ferlan