mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
domaincapstest: Use default machine type
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
7aa86f6358
commit
f51e8a6282
@ -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'>
|
||||
|
@ -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 */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user