[PATCH 5/7] qemu: Replace big condition in virQEMUCapsCPUFilterFeatures with array

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

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1d7ac9803d..f930ad2acf 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -3531,22 +3531,26 @@ virQEMUCapsProbeQMPSGXCapabilities(virQEMUCaps *qemuCaps,
  * QEMU never supported them or they were dropped as they never did anything
  * useful.
  */
+const char *ignoredFeatures[] = {
+    "cmt", "mbm_total", "mbm_local", /* never supported by QEMU */
+    "osxsave", "ospke",              /* dropped from QEMU */
+};
+
 bool
 virQEMUCapsCPUFilterFeatures(const char *name,
                              virCPUFeaturePolicy policy G_GNUC_UNUSED,
                              void *opaque)
 {
     virArch *arch = opaque;
+    size_t i;
 
     if (!ARCH_IS_X86(*arch))
         return true;
 
-    if (STREQ(name, "cmt") ||
-        STREQ(name, "mbm_total") ||
-        STREQ(name, "mbm_local") ||
-        STREQ(name, "osxsave") ||
-        STREQ(name, "ospke"))
-        return false;
+    for (i = 0; i < G_N_ELEMENTS(ignoredFeatures); i++) {
+        if (STREQ(name, ignoredFeatures[i]))
+            return false;
+    }
 
     return true;
 }
-- 
2.46.2




[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