Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
---
Notes:
Version 2:
- no change
Version 3:
- no change
src/qemu/qemu_capabilities.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 3d8a1c1721..33b91d23dc 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5276,24 +5276,17 @@ virQEMUCapsFillDomainCPUCaps(virCapsPtr caps,
if (virQEMUCapsIsCPUModeSupported(qemuCaps, caps, domCaps->virttype,
VIR_CPU_MODE_CUSTOM)) {
- virDomainCapsCPUModelsPtr filtered = NULL;
- char **models = NULL;
const char *blacklist[] = { "host", NULL };
+ VIR_AUTOSTRINGLIST models = NULL;
if (virCPUGetModels(domCaps->arch, &models) >= 0) {
- virDomainCapsCPUModelsPtr cpus;
-
- if (domCaps->virttype == VIR_DOMAIN_VIRT_KVM)
- cpus = qemuCaps->kvmCPUModels;
- else
- cpus = qemuCaps->tcgCPUModels;
-
- filtered = virDomainCapsCPUModelsFilter(cpus,
- (const char **)models,
- blacklist);
- virStringListFree(models);
+ domCaps->cpu.custom = virQEMUCapsGetCPUDefinitions(qemuCaps,
+ domCaps->virttype,
+ (const char **)models,
+ blacklist);
+ } else {
+ domCaps->cpu.custom = NULL;
}
- domCaps->cpu.custom = filtered;
}
return 0;
--
2.23.0