Remove use of problematic terminology

Following kernel recommendation here:
https://lkml.org/lkml/2020/7/4/229

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2020-09-23 14:33:17 -04:00
parent 12fe58cd91
commit 9c13d2f878
9 changed files with 34 additions and 34 deletions

View File

@ -1247,7 +1247,7 @@ Connect the guest to the host network. Examples for specifying the network type:
Tell virt-install not to add any default network interface. Tell virt-install not to add any default network interface.
If ``--network`` is omitted a single NIC will be created in the guest. If If ``--network`` is omitted a single NIC will be created in the guest. If
there is a bridge device in the host with a physical interface enslaved, there is a bridge device in the host with a physical interface attached,
that will be used for connectivity. Failing that, the virtual network that will be used for connectivity. Failing that, the virtual network
called ``default`` will be used. This option can be specified multiple called ``default`` will be used. This option can be specified multiple
times to setup more than one NIC. times to setup more than one NIC.

View File

@ -316,7 +316,7 @@ def testAddDiskSearchPermsFail(app, uri, tmpdir):
details = _open_app(app, "test-clone-simple", details = _open_app(app, "test-clone-simple",
break_setfacl=True) break_setfacl=True)
# Say 'Yes' and it should fail, then blacklist the paths # Say 'Yes' and it should fail, then denylist the paths
addhw = _open_addhw(app, details) addhw = _open_addhw(app, details)
tab = _select_hw(addhw, "Storage", "storage-tab") tab = _select_hw(addhw, "Storage", "storage-tab")
tab.find_fuzzy("Select or create", "radio").click() tab.find_fuzzy("Select or create", "radio").click()

View File

@ -10,7 +10,7 @@ from . import lib
def testConnectionBlacklist(app): def testConnectionBlacklist(app):
app.open( app.open(
extra_opts=["--test-options=object-blacklist=test-many-devices"]) extra_opts=["--test-options=object-denylist=test-many-devices"])
manager = app.topwin manager = app.topwin
def _delete_vm(vmname): def _delete_vm(vmname):
@ -25,7 +25,7 @@ def testConnectionBlacklist(app):
_delete_vm("test-arm-kernel") _delete_vm("test-arm-kernel")
_delete_vm("test-clone-full") _delete_vm("test-clone-full")
_delete_vm("test-clone-simple") _delete_vm("test-clone-simple")
app.sleep(.5) # Give events time to register to hit full blacklist path app.sleep(.5) # Give events time to register to hit full denylist path
lib.utils.check( lib.utils.check(
lambda: "test-many-devices" not in app.topwin.fmt_nodes()) lambda: "test-many-devices" not in app.topwin.fmt_nodes())

View File

@ -38,46 +38,46 @@ class _ObjectList(vmmGObject):
vmmGObject.__init__(self) vmmGObject.__init__(self)
self._objects = [] self._objects = []
self._blacklist = {} self._denylist = {}
self._lock = threading.Lock() self._lock = threading.Lock()
def _cleanup(self): def _cleanup(self):
self._objects = [] self._objects = []
def _blacklist_key(self, obj): def _denylist_key(self, obj):
return str(obj.__class__) + obj.get_name() return str(obj.__class__) + obj.get_name()
def add_blacklist(self, obj): def add_denylist(self, obj):
""" """
Add an object to the blacklist. Basically a list of objects we Add an object to the denylist. Basically a list of objects we
choose not to poll, because they threw an error at init time choose not to poll, because they threw an error at init time
:param obj: vmmLibvirtObject to blacklist :param obj: vmmLibvirtObject to denylist
:returns: number of added object to list :returns: number of added object to list
""" """
key = self._blacklist_key(obj) key = self._denylist_key(obj)
count = self._blacklist.get(key, 0) count = self._denylist.get(key, 0)
self._blacklist[key] = count + 1 self._denylist[key] = count + 1
return self._blacklist[key] return self._denylist[key]
def remove_blacklist(self, obj): def remove_denylist(self, obj):
""" """
:param obj: vmmLibvirtObject to remove from blacklist :param obj: vmmLibvirtObject to remove from denylist
:returns: True if object was blacklisted or False otherwise. :returns: True if object was denylisted or False otherwise.
""" """
key = self._blacklist_key(obj) key = self._denylist_key(obj)
return bool(self._blacklist.pop(key, 0)) return bool(self._denylist.pop(key, 0))
def in_blacklist(self, obj): def in_denylist(self, obj):
""" """
If an object is in list only once don't consider it blacklisted, If an object is in list only once don't consider it denylisted,
give it one more chance. give it one more chance.
:param obj: vmmLibvirtObject to check :param obj: vmmLibvirtObject to check
:returns: True if object is blacklisted :returns: True if object is denylisted
""" """
key = self._blacklist_key(obj) key = self._denylist_key(obj)
return self._blacklist.get(key, 0) >= _ObjectList.BLACKLIST_COUNT return self._denylist.get(key, 0) >= _ObjectList.BLACKLIST_COUNT
def remove(self, obj): def remove(self, obj):
""" """
@ -90,7 +90,7 @@ class _ObjectList(vmmGObject):
# Identity check is sufficient here, since we should never be # Identity check is sufficient here, since we should never be
# asked to remove an object that wasn't at one point in the list. # asked to remove an object that wasn't at one point in the list.
if obj not in self._objects: if obj not in self._objects:
return self.remove_blacklist(obj) return self.remove_denylist(obj)
self._objects.remove(obj) self._objects.remove(obj)
return True return True
@ -1060,11 +1060,11 @@ class vmmConnection(vmmGObject):
if initialize_failed: if initialize_failed:
log.debug("Blacklisting %s=%s", class_name, obj.get_name()) log.debug("Blacklisting %s=%s", class_name, obj.get_name())
count = self._objects.add_blacklist(obj) count = self._objects.add_denylist(obj)
log.debug("Object added in blacklist, count=%d", count) log.debug("Object added in denylist, count=%d", count)
return return
self._objects.remove_blacklist(obj) self._objects.remove_denylist(obj)
if not self._objects.add(obj): if not self._objects.add(obj):
log.debug("New %s=%s requested, but it's already tracked.", log.debug("New %s=%s requested, but it's already tracked.",
class_name, obj.get_name()) class_name, obj.get_name())
@ -1134,7 +1134,7 @@ class vmmConnection(vmmGObject):
gone_objects.extend(gone) gone_objects.extend(gone)
preexisting_objects.extend([o for o in master if o not in new]) preexisting_objects.extend([o for o in master if o not in new])
new = [n for n in new if not self._objects.in_blacklist(n)] new = [n for n in new if not self._objects.in_denylist(n)]
return new return new
new_vms = _process_objects("vms") new_vms = _process_objects("vms")

View File

@ -157,7 +157,7 @@ class CLITestOptionsClass:
Spice doesn't return values here when we are just testing Spice doesn't return values here when we are just testing
against seabios in uitests, this fakes it to hit more code paths against seabios in uitests, this fakes it to hit more code paths
* fake-systray: Enable the fake systray window * fake-systray: Enable the fake systray window
* object-blacklist=NAME: Make object initialize for that name * object-denylist=NAME: Make object initialize for that name
fail to test some connection code paths fail to test some connection code paths
* conn-crash: Test connection abruptly closing like when * conn-crash: Test connection abruptly closing like when
libvirtd is restarted. libvirtd is restarted.
@ -207,7 +207,7 @@ class CLITestOptionsClass:
self.fake_vnc_username = _get("fake-vnc-username") self.fake_vnc_username = _get("fake-vnc-username")
self.fake_console_resolution = _get("fake-console-resolution") self.fake_console_resolution = _get("fake-console-resolution")
self.fake_systray = _get("fake-systray") self.fake_systray = _get("fake-systray")
self.object_blacklist = _get_value("object-blacklist") self.object_denylist = _get_value("object-denylist")
self.conn_crash = _get("conn-crash") self.conn_crash = _get("conn-crash")
self.fake_agent_event = _get_value("fake-agent-event") self.fake_agent_event = _get_value("fake-agent-event")
self.fake_nodedev_event = _get_value("fake-nodedev-event") self.fake_nodedev_event = _get_value("fake-nodedev-event")

View File

@ -393,7 +393,7 @@ class vmmDomain(vmmLibvirtObject):
self.get_uuid() == "00000000-0000-0000-0000-000000000000"): self.get_uuid() == "00000000-0000-0000-0000-000000000000"):
# We don't want virt-manager to track Domain-0 since it # We don't want virt-manager to track Domain-0 since it
# doesn't work with our UI. Raising an error will ensures it # doesn't work with our UI. Raising an error will ensures it
# is blacklisted. # is denylisted.
raise RuntimeError( # pragma: no cover raise RuntimeError( # pragma: no cover
"Can't track Domain-0 as a vmmDomain") "Can't track Domain-0 as a vmmDomain")

View File

@ -171,7 +171,7 @@ class vmmLibvirtObject(vmmGObject):
initialize_failed = False initialize_failed = False
try: try:
if self.config.CLITestOptions.object_blacklist == self._name: if self.config.CLITestOptions.object_denylist == self._name:
raise RuntimeError("fake initialization error") raise RuntimeError("fake initialization error")
self._init_libvirt_state() self._init_libvirt_state()

View File

@ -132,7 +132,7 @@ class DeviceGraphics(Device):
def _spice_supported(self): def _spice_supported(self):
if not self.conn.is_qemu() and not self.conn.is_test(): if not self.conn.is_qemu() and not self.conn.is_test():
return False return False
# Spice has issues on some host arches, like ppc, so whitelist it # Spice has issues on some host arches, like ppc, so allow it
if self.conn.caps.host.cpu.arch not in ["i686", "x86_64"]: if self.conn.caps.host.cpu.arch not in ["i686", "x86_64"]:
return False return False
return True return True

View File

@ -72,7 +72,7 @@ def _host_default_bridge():
return dev # pragma: no cover return dev # pragma: no cover
# Old style, peth0 == phys dev, eth0 == netloop, xenbr0 == bridge, # Old style, peth0 == phys dev, eth0 == netloop, xenbr0 == bridge,
# vif0.0 == netloop enslaved, eth0 == default route # vif0.0 == netloop attached, eth0 == default route
try: try:
defn = int(dev[-1]) defn = int(dev[-1])
except Exception: # pragma: no cover except Exception: # pragma: no cover