提交 b1286526 编写于 作者: J Jiri Denemark

qemu: Drop qemuFeatureNoEffect

We already have virQEMUCapsCPUFilterFeatures for filtering features
which QEMU does not know about. Let's move osxsave and ospke from
qemuFeatureNoEffect there.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 2699e63f
......@@ -2823,6 +2823,11 @@ virQEMUCapsProbeQMPSEVCapabilities(virQEMUCapsPtr qemuCaps,
}
/*
* Filter for features which should never be passed to QEMU. Either because
* QEMU never supported them or they were dropped as they never did anything
* useful.
*/
bool
virQEMUCapsCPUFilterFeatures(const char *name,
void *opaque)
......@@ -2834,7 +2839,9 @@ virQEMUCapsCPUFilterFeatures(const char *name,
if (STREQ(name, "cmt") ||
STREQ(name, "mbm_total") ||
STREQ(name, "mbm_local"))
STREQ(name, "mbm_local") ||
STREQ(name, "osxsave") ||
STREQ(name, "ospke"))
return false;
return true;
......
......@@ -7038,27 +7038,6 @@ qemuBuildGlobalControllerCommandLine(virCommandPtr cmd,
return 0;
}
/**
* qemuFeatureNoEffect:
* @feature: CPU Feature
*
* Returns true, if the feature is known to have (never had) an effect on QEMU.
* Those features might be dropped in qemu without a longer deprecation cycle
* and must therefore be known e.g. to no more define them on command line.
*/
static bool
qemuFeatureNoEffect(virCPUFeatureDefPtr feature)
{
if (!feature->name)
return false;
if (STREQ(feature->name, "osxsave"))
return true;
if (STREQ(feature->name, "ospke"))
return true;
return false;
}
static int
qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
......@@ -7127,7 +7106,8 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver,
virBufferAsprintf(buf, ",vendor=%s", cpu->vendor_id);
for (i = 0; i < cpu->nfeatures; i++) {
if (qemuFeatureNoEffect(&(cpu->features[i])))
if (!virQEMUCapsCPUFilterFeatures(cpu->features[i].name,
(virArch *)&def->os.arch))
continue;
switch ((virCPUFeaturePolicy) cpu->features[i].policy) {
case VIR_CPU_FEATURE_FORCE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册