From: Jiri Denemark Date: Wed, 7 Apr 2010 12:58:15 +0000 (+0200) Subject: Fix CPU comparison for x86 arch X-Git-Tag: v0.8.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e26997f62b1840aa42c69a41e872ca6be9d008a1;p=thirdparty%2Flibvirt.git Fix CPU comparison for x86 arch 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. --- diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 46a9fbbbc3..205528d189 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -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; }