Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml | 2 +-
tests/domaincapstest.c | 17 ++++++++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
index 32f981d..1e73ff1 100644
--- a/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
+++ b/tests/domaincapsschemadata/domaincaps-qemu_1.6.50-1.xml
@@ -1,7 +1,7 @@
<domainCapabilities>
<path>/usr/bin/qemu-system-x86_64</path>
<domain>kvm</domain>
- <machine>pc-1.2</machine>
+ <machine>pc-i440fx-1.7</machine>
<arch>x86_64</arch>
<vcpu max='255'/>
<os supported='yes'>
diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c
index f7a3868..d9d110a 100644
--- a/tests/domaincapstest.c
+++ b/tests/domaincapstest.c
@@ -96,6 +96,7 @@ static int
fillQemuCaps(virDomainCapsPtr domCaps,
const char *name,
virArch arch,
+ const char *machine,
virQEMUDriverConfigPtr cfg)
{
int ret = -1;
@@ -108,6 +109,16 @@ fillQemuCaps(virDomainCapsPtr domCaps,
!(qemuCaps = qemuTestParseCapabilities(path)))
goto cleanup;
+ if (machine &&
+ VIR_STRDUP(domCaps->machine,
+ virQEMUCapsGetCanonicalMachine(qemuCaps, machine)) < 0)
+ goto cleanup;
+
+ if (!domCaps->machine &&
+ VIR_STRDUP(domCaps->machine,
+ virQEMUCapsGetDefaultMachine(qemuCaps)) < 0)
+ goto cleanup;
+
if (virQEMUCapsFillDomainCaps(domCaps, qemuCaps,
cfg->loader, cfg->nloader) < 0)
goto cleanup;
@@ -187,7 +198,7 @@ test_virDomainCapsFormat(const void *opaque)
case CAPS_QEMU:
#if WITH_QEMU
- if (fillQemuCaps(domCaps, data->capsName, data->arch,
+ if (fillQemuCaps(domCaps, data->capsName, data->arch, data->machine,
data->capsOpaque) < 0)
goto cleanup;
#endif
@@ -258,8 +269,8 @@ mymain(void)
#if WITH_QEMU
DO_TEST_QEMU("qemu_1.6.50-1", "caps_1.6.50-1",
- "/usr/bin/qemu-system-x86_64", "pc-1.2",
VIR_ARCH_X86_64,
- VIR_DOMAIN_VIRT_KVM);
+ "/usr/bin/qemu-system-x86_64", NULL,
+ VIR_ARCH_X86_64, VIR_DOMAIN_VIRT_KVM);
#endif /* WITH_QEMU */
--
2.8.2