From 5e13b7ab5e3d945f9c0530a9643cc1d0e0180749 Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 12 Jan 2010 15:25:50 +0100 Subject: [PATCH] Take disabled/forced CPU features into account When comparing x86 CPUs, features with 'disabled' policy were mistakenly required to be supported by the host CPU. Likewise, features with 'force' policy which were supported by host CPU would make CPUs incompatible if 'strict' match was used by guest CPU. This patch fixes both issues. Signed-off-by: Jiri Denemark --- src/cpu/cpu_x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 51f5d54346..42fdf49db4 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -829,11 +829,14 @@ x86Compute(virCPUDefPtr host, if (!(cpu_forbid = x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_FORBID))) goto error; + x86ModelSubtract(cpu_require, cpu_disable); + if ((diff = x86ModelCopy(host_model)) == NULL) goto no_memory; x86ModelSubtract(diff, cpu_require); x86ModelSubtract(diff, cpu_optional); + x86ModelSubtract(diff, cpu_force); for (i = 0; i < cpu_forbid->ncpuid; i++) { const struct cpuX86cpuid *cpuid1; -- 2.39.5