提交 ec0db69c 编写于 作者: P Peter Krempa

tests: qemu: Don't add fake machine types when testing with real data

Skip the step of adding all of the fake machine types which are required
for the legacy tests in case when we are testing with real capabilities.

Faking any data in the real capabilities undermines the point of testing
with real capabilities.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 60b580b9
......@@ -332,28 +332,32 @@ int qemuTestCapsCacheInsert(virFileCachePtr cache,
} else {
tmpCaps = virQEMUCapsNew();
}
virQEMUCapsSetArch(tmpCaps, i);
for (j = 0; qemu_machines[i][j] != NULL; j++) {
virQEMUCapsAddMachine(tmpCaps,
VIR_DOMAIN_VIRT_QEMU,
qemu_machines[i][j],
NULL,
NULL,
0,
false,
false);
}
for (j = 0; kvm_machines[i][j] != NULL; j++) {
virQEMUCapsAddMachine(tmpCaps,
VIR_DOMAIN_VIRT_KVM,
kvm_machines[i][j],
NULL,
NULL,
0,
false,
false);
virQEMUCapsSet(tmpCaps, QEMU_CAPS_KVM);
if (!virQEMUCapsHasMachines(tmpCaps)) {
virQEMUCapsSetArch(tmpCaps, i);
for (j = 0; qemu_machines[i][j] != NULL; j++) {
virQEMUCapsAddMachine(tmpCaps,
VIR_DOMAIN_VIRT_QEMU,
qemu_machines[i][j],
NULL,
NULL,
0,
false,
false);
}
for (j = 0; kvm_machines[i][j] != NULL; j++) {
virQEMUCapsAddMachine(tmpCaps,
VIR_DOMAIN_VIRT_KVM,
kvm_machines[i][j],
NULL,
NULL,
0,
false,
false);
virQEMUCapsSet(tmpCaps, QEMU_CAPS_KVM);
}
}
if (virFileCacheInsertData(cache, qemu_emulators[i], tmpCaps) < 0) {
virObjectUnref(tmpCaps);
return -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册