[libvirt PATCH 04/23] qemu: remove use of the terms 'whitelist' and 'blacklist' from CPU code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When listing CPU models, we need to filter the data based on sets
of permitted and forbidden CPU models.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c | 18 +++++++++---------
 src/qemu/qemu_capabilities.h |  4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 484fff99e5..68fcbd3c4f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2256,8 +2256,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
 
 static virDomainCapsCPUModelsPtr
 virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
-                           const char **modelWhitelist,
-                           const char **modelBlacklist)
+                           const char **modelAllowed,
+                           const char **modelForbidden)
 {
     g_autoptr(virDomainCapsCPUModels) cpuModels = NULL;
     size_t i;
@@ -2268,10 +2268,10 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
     for (i = 0; i < defs->ncpus; i++) {
         qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i;
 
-        if (modelWhitelist && !virStringListHasString(modelWhitelist, cpu->name))
+        if (modelAllowed && !virStringListHasString(modelAllowed, cpu->name))
             continue;
 
-        if (modelBlacklist && virStringListHasString(modelBlacklist, cpu->name))
+        if (modelForbidden && virStringListHasString(modelForbidden, cpu->name))
             continue;
 
         if (virDomainCapsCPUModelsAdd(cpuModels, cpu->name, cpu->usable,
@@ -2286,15 +2286,15 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs,
 virDomainCapsCPUModelsPtr
 virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps,
                         virDomainVirtType type,
-                        const char **modelWhitelist,
-                        const char **modelBlacklist)
+                        const char **modelAllowed,
+                        const char **modelForbidden)
 {
     qemuMonitorCPUDefsPtr defs;
 
     if (!(defs = virQEMUCapsGetAccel(qemuCaps, type)->cpuModels))
         return NULL;
 
-    return virQEMUCapsCPUDefsToModels(defs, modelWhitelist, modelBlacklist);
+    return virQEMUCapsCPUDefsToModels(defs, modelAllowed, modelForbidden);
 }
 
 
@@ -5976,14 +5976,14 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCapsPtr qemuCaps,
     if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttype,
                                       VIR_CPU_MODE_CUSTOM,
                                       domCaps->machine)) {
-        const char *blacklist[] = { "host", NULL };
+        const char *forbidden[] = { "host", NULL };
         VIR_AUTOSTRINGLIST models = NULL;
 
         if (virCPUGetModels(domCaps->arch, &models) >= 0) {
             domCaps->cpu.custom = virQEMUCapsGetCPUModels(qemuCaps,
                                                           domCaps->virttype,
                                                           (const char **)models,
-                                                          blacklist);
+                                                          forbidden);
         } else {
             domCaps->cpu.custom = NULL;
         }
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index 92d42ed80b..ad93816d41 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -629,8 +629,8 @@ int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps,
                                  virDomainCapsCPUUsable usable);
 virDomainCapsCPUModelsPtr virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps,
                                                   virDomainVirtType type,
-                                                  const char **modelWhitelist,
-                                                  const char **modelBlacklist);
+                                                  const char **modelAllowed,
+                                                  const char **modelForbidden);
 int virQEMUCapsFetchCPUModels(qemuMonitorPtr mon,
                               virArch arch,
                               virDomainCapsCPUModelsPtr *cpuModels);
-- 
2.24.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux