]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Remove CPU features functions calling for non-x86 platform.
authorLi Zhang <zhlcindy@linux.vnet.ibm.com>
Tue, 3 Sep 2013 06:28:23 +0000 (14:28 +0800)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 5 Sep 2013 11:31:09 +0000 (12:31 +0100)
CPU features are not supported on non-x86 and hasFeatures will be NULL.

This patch is to remove CPU features functions calling to avoid errors.

Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
src/qemu/qemu_command.c

index db97137b93e8b00f229e76f506d03027a1753c90..91ca86a3c3d8220fcc5644d0d8b72cdec70b39ba 100644 (file)
@@ -6447,7 +6447,6 @@ qemuBuildCpuArgStr(const virQEMUDriverPtr driver,
         (def->cpu->mode != VIR_CPU_MODE_CUSTOM || def->cpu->model)) {
         virCPUCompareResult cmp;
         const char *preferred;
-        int hasSVM;
 
         if (!host ||
             !host->model ||
@@ -6487,10 +6486,13 @@ qemuBuildCpuArgStr(const virQEMUDriverPtr driver,
         /* Only 'svm' requires --enable-nesting. The nested
          * 'vmx' patches now simply hook off the CPU features
          */
-        hasSVM = cpuHasFeature(data, "svm");
-        if (hasSVM < 0)
-            goto cleanup;
-        *hasHwVirt = hasSVM > 0 ? true : false;
+        if (def->os.arch == VIR_ARCH_X86_64 ||
+            def->os.arch == VIR_ARCH_I686) {
+            int hasSVM = cpuHasFeature(data, "svm");
+            if (hasSVM < 0)
+                goto cleanup;
+            *hasHwVirt = hasSVM > 0 ? true : false;
+        }
 
         if (cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH) {
             const char *mode = virCPUModeTypeToString(cpu->mode);