mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
qemuTestCapsCacheInsert*: Directly insert real capabilities
Real capabilities populate the binary name, while fake don't. We can directly insert the capabilities using the real binary name. This will allow to remove 'qemu_emulators' entries once all tests are converted to real capabilties. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
f0fec72e3f
commit
5810eb97ad
@ -533,24 +533,30 @@ qemuTestCapsCacheInsertImpl(virFileCache *cache,
|
|||||||
*
|
*
|
||||||
* before populating the cache;
|
* before populating the cache;
|
||||||
*/
|
*/
|
||||||
virArch arch = virQEMUCapsGetArch(caps);
|
/* caps->binary is populated only for real capabilities */
|
||||||
g_autoptr(virQEMUCaps) copyCaps = NULL;
|
if (virQEMUCapsGetBinary(caps)) {
|
||||||
virQEMUCaps *effCaps = caps;
|
if (qemuTestCapsCacheInsertData(cache, virQEMUCapsGetBinary(caps), caps) < 0)
|
||||||
|
|
||||||
if (arch_alias[arch] != VIR_ARCH_NONE)
|
|
||||||
arch = arch_alias[arch];
|
|
||||||
|
|
||||||
if (qemu_emulators[arch]) {
|
|
||||||
/* if we are dealing with fake caps we need to populate machine types */
|
|
||||||
if (!virQEMUCapsHasMachines(caps)) {
|
|
||||||
if (!(copyCaps = effCaps = virQEMUCapsNewCopy(caps)))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
qemuTestCapsPopulateFakeMachines(copyCaps, arch, hostOS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qemuTestCapsCacheInsertData(cache, qemu_emulators[arch], effCaps) < 0)
|
|
||||||
return -1;
|
return -1;
|
||||||
|
} else {
|
||||||
|
virArch arch = virQEMUCapsGetArch(caps);
|
||||||
|
g_autoptr(virQEMUCaps) copyCaps = NULL;
|
||||||
|
virQEMUCaps *effCaps = caps;
|
||||||
|
|
||||||
|
if (arch_alias[arch] != VIR_ARCH_NONE)
|
||||||
|
arch = arch_alias[arch];
|
||||||
|
|
||||||
|
if (qemu_emulators[arch]) {
|
||||||
|
/* if we are dealing with fake caps we need to populate machine types */
|
||||||
|
if (!virQEMUCapsHasMachines(caps)) {
|
||||||
|
if (!(copyCaps = effCaps = virQEMUCapsNewCopy(caps)))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
qemuTestCapsPopulateFakeMachines(copyCaps, arch, hostOS);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qemuTestCapsCacheInsertData(cache, qemu_emulators[arch], effCaps) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* in case when caps are missing or are missing architecture, we populate
|
/* in case when caps are missing or are missing architecture, we populate
|
||||||
|
Loading…
x
Reference in New Issue
Block a user