]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Check non-migratable host CPU features v3.2.0-rc2
authorJiri Denemark <jdenemar@redhat.com>
Wed, 29 Mar 2017 09:00:32 +0000 (11:00 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 30 Mar 2017 07:59:42 +0000 (09:59 +0200)
CPU features which change their value from disabled to enabled between
two calls to query-cpu-model-expansion (the first with no extra
properties set and the second with 'migratable' property set to false)
can be marked as enabled and non-migratable in qemuMonitorCPUModelInfo.

Since the code consuming qemuMonitorCPUModelInfo currently ignores the
migratable flag, this change is effectively changing the CPU model
advertised in domain capabilities to contain all features (even those
which block migration). And this matches what we do for QEMU older than
2.9.0, when we detect all CPUID bits ourselves without asking QEMU.

As a result of this change

    <cpu mode='host-model'>
      <feature name='invtsc' policy='require'/>
    </cpu>

will work with all QEMU versions. Such CPU definition would be forbidden
with QEMU >= 2.9.0 without this patch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c
tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml
tests/qemucapabilitiesdata/caps_2.9.0.x86_64.xml

index 9726bce748802249d666396d09bedfb1a4b6c61c..b1245ad5dd7a33fa47927494c18e768c5467a3a5 100644 (file)
@@ -2864,8 +2864,12 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps,
                 prop->type != nmProp->type)
                 continue;
 
-            if (prop->value.boolean)
+            if (prop->value.boolean) {
                 prop->migratable = VIR_TRISTATE_BOOL_YES;
+            } else if (nmProp->value.boolean) {
+                prop->value.boolean = true;
+                prop->migratable = VIR_TRISTATE_BOOL_NO;
+            }
         }
 
         (*modelInfo)->migratability = true;
index a4ab74dcaff87aca8bc5b00171192ff9f9ccb64d..e8fe01d85e93de3411ab5ab8f8c63dff9c088354 100644 (file)
@@ -30,6 +30,7 @@
       <feature policy='require' name='clflushopt'/>
       <feature policy='require' name='xsaves'/>
       <feature policy='require' name='pdpe1gb'/>
+      <feature policy='require' name='invtsc'/>
     </mode>
     <mode name='custom' supported='yes'>
       <model usable='yes'>qemu64</model>
index 6efa8a668b0498b0997f70e74bf862bab2e20f56..6386c4ed0de4e3f42d08f1755e8093f4b6f5604f 100644 (file)
     <property name='svm' type='boolean' value='false'/>
     <property name='full-cpuid-auto-level' type='boolean' value='true' migratable='yes'/>
     <property name='hv-reset' type='boolean' value='false'/>
-    <property name='invtsc' type='boolean' value='false'/>
+    <property name='invtsc' type='boolean' value='true' migratable='no'/>
     <property name='sse3' type='boolean' value='true' migratable='yes'/>
     <property name='sse2' type='boolean' value='true' migratable='yes'/>
     <property name='est' type='boolean' value='false'/>