goto out;
}
+ /* first remove features that were inherited from the CPU model and were
+ * explicitly forced, disabled, or made optional
+ */
+ x86DataSubtract(cpu_require->data, cpu_force->data);
+ x86DataSubtract(cpu_require->data, cpu_optional->data);
x86DataSubtract(cpu_require->data, cpu_disable->data);
result = x86ModelCompare(host_model, cpu_require);
if (result == SUBSET || result == UNRELATED) {
DO_TEST_COMPARE("x86", "host", "pentium3-amd", VIR_CPU_COMPARE_INCOMPATIBLE);
DO_TEST_COMPARE("x86", "host-amd", "pentium3-amd", VIR_CPU_COMPARE_SUPERSET);
DO_TEST_COMPARE("x86", "host-worse", "nehalem-force", VIR_CPU_COMPARE_IDENTICAL);
+ DO_TEST_COMPARE("x86", "host-SandyBridge", "exact-force-Haswell", VIR_CPU_COMPARE_IDENTICAL);
/* guest updates for migration
* automatically compares host CPU with the result */
--- /dev/null
+<cpu mode='custom' match='exact'>
+ <model fallback='allow'>Haswell</model>
+ <feature policy='force' name='pcid'/>
+ <feature policy='force' name='rtm'/>
+ <feature policy='force' name='invpcid'/>
+ <feature policy='force' name='erms'/>
+ <feature policy='force' name='bmi2'/>
+ <feature policy='optional' name='smep'/>
+ <feature policy='optional' name='avx2'/>
+ <feature policy='optional' name='hle'/>
+ <feature policy='force' name='bmi1'/>
+ <feature policy='force' name='fsgsbase'/>
+ <feature policy='disable' name='movbe'/>
+ <feature policy='disable' name='fma'/>
+</cpu>
--- /dev/null
+<cpu>
+ <arch>x86_64</arch>
+ <model>SandyBridge</model>
+ <vendor>Intel</vendor>
+ <topology sockets='1' cores='2' threads='2'/>
+</cpu>