]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix CPU comparison for x86 arch
authorJiri Denemark <jdenemar@redhat.com>
Wed, 7 Apr 2010 12:58:15 +0000 (14:58 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 7 Apr 2010 19:33:04 +0000 (21:33 +0200)
When comparing a CPU to host CPU, the result would be
VIR_CPU_COMPARE_SUPERSET (or even VIR_CPU_COMPARE_INCOMPATIBLE if strict
match was required) even though the two CPUs were identical.

src/cpu/cpu_x86.c

index 46a9fbbbc3b35b9e1070f0987c7e9649dfa39ad2..205528d1899c287fbd5691eff69762a3553da172 100644 (file)
@@ -963,8 +963,8 @@ x86Compute(virCPUDefPtr host,
     x86ModelSubtract(diff, cpu_disable);
     x86ModelSubtract(diff, cpu_force);
 
-    for (i = 0; i < host_model->ncpuid; i++) {
-        if (!x86cpuidMatch(host_model->cpuid + i, &cpuid_zero)) {
+    for (i = 0; i < diff->ncpuid; i++) {
+        if (!x86cpuidMatch(diff->cpuid + i, &cpuid_zero)) {
             ret = VIR_CPU_COMPARE_SUPERSET;
             break;
         }