]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Skip virQEMUCapsCPUFilterFeatures on non-x86 CPUs
authorJiri Denemark <jdenemar@redhat.com>
Wed, 18 Jan 2017 13:05:26 +0000 (14:05 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 22 Feb 2017 11:09:00 +0000 (12:09 +0100)
All features the function is currently supposed to filter out are
specific to x86_64. We should avoid removing them on other
architectures. It seems to be quite unlikely other achitectures would
use the same names, but one can never be sure.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c

index e851eec7a7a4bbc9084cb537db94b4e55e78658f..a8bca74d8ca508a49b19c3d95eba708bbf592d90 100644 (file)
@@ -3032,8 +3032,13 @@ virQEMUCapsProbeQMPGICCapabilities(virQEMUCapsPtr qemuCaps,
 
 static bool
 virQEMUCapsCPUFilterFeatures(const char *name,
-                             void *opaque ATTRIBUTE_UNUSED)
+                             void *opaque)
 {
+    virQEMUCapsPtr qemuCaps = opaque;
+
+    if (!ARCH_IS_X86(qemuCaps->arch))
+        return true;
+
     if (STREQ(name, "cmt") ||
         STREQ(name, "mbm_total") ||
         STREQ(name, "mbm_local"))
@@ -3109,7 +3114,8 @@ virQEMUCapsCopyCPUModelFromHost(virQEMUCapsPtr qemuCaps,
         cpu->match = VIR_CPU_MATCH_EXACT;
 
         if (virCPUDefCopyModelFilter(cpu, caps->host.cpu, true,
-                                     virQEMUCapsCPUFilterFeatures, NULL) < 0)
+                                     virQEMUCapsCPUFilterFeatures,
+                                     qemuCaps) < 0)
             goto error;
     }