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: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2019-06-06 14:39:52 +02:00
parent 2699e63fc0
commit b12865260a
2 changed files with 10 additions and 23 deletions

View File

@ -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;

View File

@ -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: