On Thu, May 16, 2019 at 05:35:36PM +0200, Andrea Bolognani wrote:
Since we know the full list of machine types supported
by the QEMU binary when probing machine type properties,
we can save some work (and eventually test suite churn,
as more architecture-specific machine types need to be
probed) by only probing machines that we know exist.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 5 ++
.../caps_2.12.0.aarch64.replies | 44 +++++---------
.../caps_2.12.0.s390x.replies | 48 +++++----------
.../caps_2.12.0.x86_64.replies | 60 +++++++------------
.../caps_3.0.0.riscv32.replies | 36 ++++-------
.../caps_3.0.0.riscv64.replies | 36 ++++-------
.../caps_3.0.0.s390x.replies | 48 +++++----------
.../caps_3.0.0.x86_64.replies | 60 +++++++------------
.../caps_3.1.0.x86_64.replies | 60 +++++++------------
.../caps_4.0.0.aarch64.replies | 44 +++++---------
.../caps_4.0.0.riscv32.replies | 36 ++++-------
.../caps_4.0.0.riscv64.replies | 36 ++++-------
.../caps_4.0.0.s390x.replies | 48 +++++----------
.../caps_4.0.0.x86_64.replies | 60 +++++++------------
14 files changed, 209 insertions(+), 412 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index e12f076da8..d13c2c1192 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2361,6 +2361,11 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps,
const char *canon = virQEMUCapsGetCanonicalMachine(qemuCaps, props.type);
VIR_AUTOFREE(char *) type = NULL;
+ /* If the machine type is not supported by the QEMU binary, we
+ * don't need to bother probing its properties */
Redundant comment, the code says the same thing.
+ if (!virQEMUCapsIsMachineSupported(qemuCaps, canon))
+ continue;
+
/* The QOM type for machine types is the machine type name
* followed by the -machine suffix */
if (virAsprintf(&type, "%s-machine", canon) < 0)
Reviewed-by: Pavel Hrdina <phrdina(a)redhat.com>