[PATCH 05/22] qemu: Use virQEMUCapsGetCPUDefinitions more

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 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 dac3d3b633..255ae8e665 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5256,24 +5256,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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux