提交 385c1cc9 编写于 作者: J Jiri Denemark

qemu: Check non-migratable host CPU features

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: NJiri Denemark <jdenemar@redhat.com>
上级 91927c62
......@@ -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;
......
......@@ -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>
......
......@@ -314,7 +314,7 @@
<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'/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册