提交 7b977686 编写于 作者: D Daniel P. Berrangé

qemu: remove use of the terms 'whitelist' and 'blacklist' from CPU code

When listing CPU models, we need to filter the data based on sets
of permitted and forbidden CPU models.
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 60e4d9d0
...@@ -2252,8 +2252,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, ...@@ -2252,8 +2252,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
static virDomainCapsCPUModelsPtr static virDomainCapsCPUModelsPtr
virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
const char **modelWhitelist, const char **modelAllowed,
const char **modelBlacklist) const char **modelForbidden)
{ {
g_autoptr(virDomainCapsCPUModels) cpuModels = NULL; g_autoptr(virDomainCapsCPUModels) cpuModels = NULL;
size_t i; size_t i;
...@@ -2264,10 +2264,10 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, ...@@ -2264,10 +2264,10 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
for (i = 0; i < defs->ncpus; i++) { for (i = 0; i < defs->ncpus; i++) {
qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i; qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i;
if (modelWhitelist && !virStringListHasString(modelWhitelist, cpu->name)) if (modelAllowed && !virStringListHasString(modelAllowed, cpu->name))
continue; continue;
if (modelBlacklist && virStringListHasString(modelBlacklist, cpu->name)) if (modelForbidden && virStringListHasString(modelForbidden, cpu->name))
continue; continue;
if (virDomainCapsCPUModelsAdd(cpuModels, cpu->name, cpu->usable, if (virDomainCapsCPUModelsAdd(cpuModels, cpu->name, cpu->usable,
...@@ -2282,15 +2282,15 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, ...@@ -2282,15 +2282,15 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
virDomainCapsCPUModelsPtr virDomainCapsCPUModelsPtr
virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps,
virDomainVirtType type, virDomainVirtType type,
const char **modelWhitelist, const char **modelAllowed,
const char **modelBlacklist) const char **modelForbidden)
{ {
qemuMonitorCPUDefsPtr defs; qemuMonitorCPUDefsPtr defs;
if (!(defs = virQEMUCapsGetAccel(qemuCaps, type)->cpuModels)) if (!(defs = virQEMUCapsGetAccel(qemuCaps, type)->cpuModels))
return NULL; return NULL;
return virQEMUCapsCPUDefsToModels(defs, modelWhitelist, modelBlacklist); return virQEMUCapsCPUDefsToModels(defs, modelAllowed, modelForbidden);
} }
...@@ -6005,14 +6005,14 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCapsPtr qemuCaps, ...@@ -6005,14 +6005,14 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCapsPtr qemuCaps,
if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttype, if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttype,
VIR_CPU_MODE_CUSTOM, VIR_CPU_MODE_CUSTOM,
domCaps->machine)) { domCaps->machine)) {
const char *blacklist[] = { "host", NULL }; const char *forbidden[] = { "host", NULL };
VIR_AUTOSTRINGLIST models = NULL; VIR_AUTOSTRINGLIST models = NULL;
if (virCPUGetModels(domCaps->arch, &models) >= 0) { if (virCPUGetModels(domCaps->arch, &models) >= 0) {
domCaps->cpu.custom = virQEMUCapsGetCPUModels(qemuCaps, domCaps->cpu.custom = virQEMUCapsGetCPUModels(qemuCaps,
domCaps->virttype, domCaps->virttype,
(const char **)models, (const char **)models,
blacklist); forbidden);
} else { } else {
domCaps->cpu.custom = NULL; domCaps->cpu.custom = NULL;
} }
......
...@@ -631,8 +631,8 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, ...@@ -631,8 +631,8 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
virDomainCapsCPUUsable usable); virDomainCapsCPUUsable usable);
virDomainCapsCPUModelsPtr virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, virDomainCapsCPUModelsPtr virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps,
virDomainVirtType type, virDomainVirtType type,
const char **modelWhitelist, const char **modelAllowed,
const char **modelBlacklist); const char **modelForbidden);
int virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, int virQEMUCapsFetchCPUModels(qemuMonitorPtr mon,
virArch arch, virArch arch,
virDomainCapsCPUModelsPtr *cpuModels); virDomainCapsCPUModelsPtr *cpuModels);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册