On 08/16/2018 11:12 AM, Daniel P. Berrangé wrote:
Historically the argv -> xml convertor wanted the same default
machine
as we'd set when parsing xml. The latter has now changed, however, to
use a default defined by libvirt. The former needs fixing to again
honour the default QEMU machine.
This exposed a bug in handling for the aarch64 target, as QEMU does not
define any default machine. Thus we should not having been accepting
argv without a -machine provided.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 17 +++++++-
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_driver.c | 6 ++-
src/qemu/qemu_parse_command.c | 34 ++++++++++------
src/qemu/qemu_parse_command.h | 8 +++-
tests/qemuargv2xmldata/nomachine-aarch64.args | 11 -----
tests/qemuargv2xmldata/nomachine-aarch64.xml | 40 -------------------
tests/qemuargv2xmldata/nomachine-ppc64.xml | 4 +-
tests/qemuargv2xmldata/nomachine-x86_64.xml | 4 +-
tests/qemuargv2xmldata/pseries-disk.xml | 4 +-
tests/qemuargv2xmldata/pseries-nvram.xml | 4 +-
tests/qemuargv2xmltest.c | 18 ++++++++-
.../caps_1.5.3.x86_64.xml | 2 +-
.../caps_1.6.0.x86_64.xml | 2 +-
.../caps_1.7.0.x86_64.xml | 2 +-
.../caps_2.1.1.x86_64.xml | 2 +-
.../caps_2.10.0.ppc64.xml | 2 +-
.../caps_2.10.0.s390x.xml | 2 +-
.../caps_2.10.0.x86_64.xml | 2 +-
.../caps_2.11.0.s390x.xml | 2 +-
.../caps_2.11.0.x86_64.xml | 2 +-
.../caps_2.12.0.ppc64.xml | 2 +-
.../caps_2.12.0.s390x.xml | 2 +-
.../caps_2.12.0.x86_64.xml | 2 +-
.../caps_2.4.0.x86_64.xml | 2 +-
.../caps_2.5.0.x86_64.xml | 2 +-
.../qemucapabilitiesdata/caps_2.6.0.ppc64.xml | 2 +-
.../caps_2.6.0.x86_64.xml | 2 +-
.../qemucapabilitiesdata/caps_2.7.0.s390x.xml | 2 +-
.../caps_2.7.0.x86_64.xml | 2 +-
.../qemucapabilitiesdata/caps_2.8.0.s390x.xml | 2 +-
.../caps_2.8.0.x86_64.xml | 2 +-
.../qemucapabilitiesdata/caps_2.9.0.ppc64.xml | 2 +-
.../qemucapabilitiesdata/caps_2.9.0.s390x.xml | 2 +-
.../caps_2.9.0.x86_64.xml | 2 +-
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 2 +-
.../caps_3.0.0.x86_64.xml | 2 +-
37 files changed, 97 insertions(+), 104 deletions(-)
delete mode 100644 tests/qemuargv2xmldata/nomachine-aarch64.args
delete mode 100644 tests/qemuargv2xmldata/nomachine-aarch64.xml
[...]
}
if (VIR_ALLOC_N(ret->gicCapabilities, qemuCaps->ngicCapabilities) < 0)
@@ -2042,6 +2043,17 @@ const char *virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr
qemuCaps,
return name;
}
+const char *virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps)
Most recent preference is:
const char *
virQEMUCapsGetDefaultMachine(...)
w/ 2 empty lines before and after.
+{
+ size_t i;
+
+ for (i = 0; i < qemuCaps->nmachineTypes; i++) {
+ if (qemuCaps->machineTypes[i].qemuDefault)
+ return qemuCaps->machineTypes[i].name;
+ }
+
+ return NULL;
+}
[...]
Reviewed-by: John Ferlan <jferlan(a)redhat.com>
John