domaincapstest: Use default machine type

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2016-04-28 18:01:18 +02:00
parent 7aa86f6358
commit f51e8a6282
2 changed files with 15 additions and 4 deletions

View File

@ -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'>

View File

@ -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 */