This naming better matches the semantics usage of the test. Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> --- src/libvirt_private.syms | 2 +- src/util/virfile.c | 2 +- src/util/virkmod.c | 24 ++++++++++++------------ src/util/virkmod.h | 2 +- src/util/virpci.c | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 42f8d7c222..c3ea3840d8 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2403,7 +2403,7 @@ virKeycodeValueTranslate; # util/virkmod.h virKModConfig; -virKModIsBlacklisted; +virKModIsProhibited; virKModLoad; virKModUnload; diff --git a/src/util/virfile.c b/src/util/virfile.c index 20260a2e58..58dfd29304 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -897,7 +897,7 @@ virFileNBDDeviceFindUnused(void) static bool virFileNBDLoadDriver(void) { - if (virKModIsBlacklisted(NBD_DRIVER)) { + if (virKModIsProhibited(NBD_DRIVER)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Failed to load nbd module: " "administratively prohibited")); diff --git a/src/util/virkmod.c b/src/util/virkmod.c index 12cb5920e8..9454581fa8 100644 --- a/src/util/virkmod.c +++ b/src/util/virkmod.c @@ -134,32 +134,32 @@ virKModUnload(const char *module) /** - * virKModIsBlacklisted: - * @module: Name of the module to check for on the blacklist + * virKModIsProhibited: + * @module: Name of the module to check * - * Search the output of the configuration data for the module being - * blacklisted. + * Determine if loading of @module is prohibited by admin + * configuration. * - * returns true when found blacklisted, false otherwise. + * returns true when found prohibited, false otherwise. */ bool -virKModIsBlacklisted(const char *module) +virKModIsProhibited(const char *module) { size_t i; - g_autofree char *drvblklst = NULL; + g_autofree char *drvmatch = NULL; g_autofree char *outbuf = NULL; - drvblklst = g_strdup_printf("blacklist %s\n", module); + drvmatch = g_strdup_printf("blacklist %s\n", module); /* modprobe will convert all '-' into '_', so we need to as well */ - for (i = 0; i < drvblklst[i]; i++) - if (drvblklst[i] == '-') - drvblklst[i] = '_'; + for (i = 0; i < drvmatch[i]; i++) + if (drvmatch[i] == '-') + drvmatch[i] = '_'; if (doModprobe("-c", NULL, &outbuf, NULL) < 0) return false; - if (strstr(outbuf, drvblklst)) + if (strstr(outbuf, drvmatch)) return true; return false; diff --git a/src/util/virkmod.h b/src/util/virkmod.h index f05cf83cf6..bd2fa1a1c7 100644 --- a/src/util/virkmod.h +++ b/src/util/virkmod.h @@ -28,5 +28,5 @@ char *virKModLoad(const char *, bool) ATTRIBUTE_NONNULL(1); char *virKModUnload(const char *) ATTRIBUTE_NONNULL(1); -bool virKModIsBlacklisted(const char *) +bool virKModIsProhibited(const char *) ATTRIBUTE_NONNULL(1); diff --git a/src/util/virpci.c b/src/util/virpci.c index 786b1393e6..e367d5d1e9 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -1023,10 +1023,10 @@ virPCIProbeStubDriver(virPCIStubDriver driver) } cleanup: - /* If we know failure was because of blacklist, let's report that; + /* If we know failure was because of admin config, let's report that; * otherwise, report a more generic failure message */ - if (virKModIsBlacklisted(drvname)) { + if (virKModIsProhibited(drvname)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to load PCI stub module %s: " "administratively prohibited"), -- 2.24.1