The virQEMUCapsGetDefaultMachine() method doesn't get QEMU's default
machine any more, instead it gets the historical default that libvirt
prefers for each arch. Rename it, so that the old name can be used for
getting QEMU's default.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 8 ++++++--
src/qemu/qemu_capabilities.h | 2 +-
tests/domaincapstest.c | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index a0a1b97f1d..4e4f732889 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4876,7 +4876,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache,
goto cleanup;
}
} else {
- machine = virQEMUCapsGetDefaultMachine(qemuCaps);
+ machine = virQEMUCapsGetPreferredMachine(qemuCaps);
}
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
@@ -4935,8 +4935,12 @@ virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
}
+/*
+ * The preferred machine to use if none is listed explicitly
+ * Note that this may differ from QEMU's own default machine
+ */
const char *
-virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps)
+virQEMUCapsGetPreferredMachine(virQEMUCapsPtr qemuCaps)
{
if (!qemuCaps->nmachineTypes)
return NULL;
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 26813a908c..88e81be09b 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -605,7 +605,7 @@ bool virQEMUCapsSupportsGICVersion(virQEMUCapsPtr qemuCaps,
bool virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps,
const char *canonical_machine);
-const char *virQEMUCapsGetDefaultMachine(virQEMUCapsPtr qemuCaps);
+const char *virQEMUCapsGetPreferredMachine(virQEMUCapsPtr qemuCaps);
int virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
const char *binary,
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index 06e77fd586..3b94cad223 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -168,7 +168,7 @@ fillQemuCaps(virDomainCapsPtr domCaps,
if (!domCaps->machine &&
VIR_STRDUP(domCaps->machine,
- virQEMUCapsGetDefaultMachine(qemuCaps)) < 0)
+ virQEMUCapsGetPreferredMachine(qemuCaps)) < 0)
goto cleanup;
if (virQEMUCapsFillDomainCaps(caps, domCaps, qemuCaps,
--
2.17.1