All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Eduardo Otubo" <otubo@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	qemu-block@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Michael Roth" <michael.roth@amd.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Max Reitz" <mreitz@redhat.com>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH 04/12] qga: Replace the word 'blacklist'
Date: Tue,  2 Feb 2021 21:58:16 +0100	[thread overview]
Message-ID: <20210202205824.1085853-5-philmd@redhat.com> (raw)
In-Reply-To: <20210202205824.1085853-1-philmd@redhat.com>

Follow the inclusive terminology from the "Conscious Language in your
Open Source Projects" guidelines [*] and replace the word "blacklist"
appropriately.

[*] https://github.com/conscious-lang/conscious-lang-docs/blob/main/faq.md

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 qga/guest-agent-core.h |  2 +-
 qga/commands-posix.c   | 14 +++++------
 qga/commands-win32.c   | 10 ++++----
 qga/main.c             | 57 +++++++++++++++++++++---------------------
 4 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/qga/guest-agent-core.h b/qga/guest-agent-core.h
index 9d01ea9c82a..90ce6a91a0a 100644
--- a/qga/guest-agent-core.h
+++ b/qga/guest-agent-core.h
@@ -24,7 +24,7 @@ typedef struct GACommandState GACommandState;
 extern GAState *ga_state;
 extern QmpCommandList ga_commands;
 
-GList *ga_command_blacklist_init(GList *blacklist);
+GList *ga_command_denylist_init(GList *denylist);
 void ga_command_state_init(GAState *s, GACommandState *cs);
 void ga_command_state_add(GACommandState *cs,
                           void (*init)(void),
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 8dd94a33144..a23f11d9d20 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -3071,8 +3071,8 @@ qmp_guest_fstrim(bool has_minimum, int64_t minimum, Error **errp)
 }
 #endif
 
-/* add unsupported commands to the blacklist */
-GList *ga_command_blacklist_init(GList *blacklist)
+/* add unsupported commands to the denylist */
+GList *ga_command_denylist_init(GList *denylist)
 {
 #if !defined(__linux__)
     {
@@ -3086,7 +3086,7 @@ GList *ga_command_blacklist_init(GList *blacklist)
         char **p = (char **)list;
 
         while (*p) {
-            blacklist = g_list_append(blacklist, g_strdup(*p++));
+            denylist = g_list_append(denylist, g_strdup(*p++));
         }
     }
 #endif
@@ -3101,18 +3101,18 @@ GList *ga_command_blacklist_init(GList *blacklist)
         char **p = (char **)list;
 
         while (*p) {
-            blacklist = g_list_append(blacklist, g_strdup(*p++));
+            denylist = g_list_append(denylist, g_strdup(*p++));
         }
     }
 #endif
 
 #if !defined(CONFIG_FSTRIM)
-    blacklist = g_list_append(blacklist, g_strdup("guest-fstrim"));
+    denylist = g_list_append(denylist, g_strdup("guest-fstrim"));
 #endif
 
-    blacklist = g_list_append(blacklist, g_strdup("guest-get-devices"));
+    denylist = g_list_append(denylist, g_strdup("guest-get-devices"));
 
-    return blacklist;
+    return denylist;
 }
 
 /* register init/cleanup routines for stateful command groups */
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index a00e6cb1655..f7a1644a423 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -2004,8 +2004,8 @@ GuestMemoryBlockInfo *qmp_guest_get_memory_block_info(Error **errp)
     return NULL;
 }
 
-/* add unsupported commands to the blacklist */
-GList *ga_command_blacklist_init(GList *blacklist)
+/* add unsupported commands to the denylist */
+GList *ga_command_denylist_init(GList *denylist)
 {
     const char *list_unsupported[] = {
         "guest-suspend-hybrid",
@@ -2016,7 +2016,7 @@ GList *ga_command_blacklist_init(GList *blacklist)
     char **p = (char **)list_unsupported;
 
     while (*p) {
-        blacklist = g_list_append(blacklist, g_strdup(*p++));
+        denylist = g_list_append(denylist, g_strdup(*p++));
     }
 
     if (!vss_init(true)) {
@@ -2027,11 +2027,11 @@ GList *ga_command_blacklist_init(GList *blacklist)
         p = (char **)list;
 
         while (*p) {
-            blacklist = g_list_append(blacklist, g_strdup(*p++));
+            denylist = g_list_append(denylist, g_strdup(*p++));
         }
     }
 
-    return blacklist;
+    return denylist;
 }
 
 /* register init/cleanup routines for stateful command groups */
diff --git a/qga/main.c b/qga/main.c
index 66177b9e93d..4dbcc62ac9d 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -88,7 +88,7 @@ struct GAState {
 #endif
     bool delimit_response;
     bool frozen;
-    GList *blacklist;
+    GList *denylist;
     char *state_filepath_isfrozen;
     struct {
         const char *log_filepath;
@@ -108,7 +108,7 @@ struct GAState *ga_state;
 QmpCommandList ga_commands;
 
 /* commands that are safe to issue while filesystems are frozen */
-static const char *ga_freeze_whitelist[] = {
+static const char *ga_freeze_allowlist[] = {
     "guest-ping",
     "guest-info",
     "guest-sync",
@@ -362,31 +362,31 @@ static gint ga_strcmp(gconstpointer str1, gconstpointer str2)
 }
 
 /* disable commands that aren't safe for fsfreeze */
-static void ga_disable_non_whitelisted(const QmpCommand *cmd, void *opaque)
+static void ga_disable_not_allowed(const QmpCommand *cmd, void *opaque)
 {
-    bool whitelisted = false;
+    bool allowed = false;
     int i = 0;
     const char *name = qmp_command_name(cmd);
 
-    while (ga_freeze_whitelist[i] != NULL) {
-        if (strcmp(name, ga_freeze_whitelist[i]) == 0) {
-            whitelisted = true;
+    while (ga_freeze_allowlist[i] != NULL) {
+        if (strcmp(name, ga_freeze_allowlist[i]) == 0) {
+            allowed = true;
         }
         i++;
     }
-    if (!whitelisted) {
+    if (!allowed) {
         g_debug("disabling command: %s", name);
         qmp_disable_command(&ga_commands, name);
     }
 }
 
-/* [re-]enable all commands, except those explicitly blacklisted by user */
-static void ga_enable_non_blacklisted(const QmpCommand *cmd, void *opaque)
+/* [re-]enable all commands, except those explicitly denylisted by user */
+static void ga_enable_non_denylisted(const QmpCommand *cmd, void *opaque)
 {
-    GList *blacklist = opaque;
+    GList *denylist = opaque;
     const char *name = qmp_command_name(cmd);
 
-    if (g_list_find_custom(blacklist, name, ga_strcmp) == NULL &&
+    if (g_list_find_custom(denylist, name, ga_strcmp) == NULL &&
         !qmp_command_is_enabled(cmd)) {
         g_debug("enabling command: %s", name);
         qmp_enable_command(&ga_commands, name);
@@ -425,8 +425,8 @@ void ga_set_frozen(GAState *s)
     if (ga_is_frozen(s)) {
         return;
     }
-    /* disable all non-whitelisted (for frozen state) commands */
-    qmp_for_each_command(&ga_commands, ga_disable_non_whitelisted, NULL);
+    /* disable all commands not allowed (for frozen state) */
+    qmp_for_each_command(&ga_commands, ga_disable_not_allowed, NULL);
     g_warning("disabling logging due to filesystem freeze");
     ga_disable_logging(s);
     s->frozen = true;
@@ -464,8 +464,8 @@ void ga_unset_frozen(GAState *s)
         s->deferred_options.pid_filepath = NULL;
     }
 
-    /* enable all disabled, non-blacklisted commands */
-    qmp_for_each_command(&ga_commands, ga_enable_non_blacklisted, s->blacklist);
+    /* enable all disabled, non-denylisted commands */
+    qmp_for_each_command(&ga_commands, ga_enable_non_denylisted, s->denylist);
     s->frozen = false;
     if (!ga_delete_file(s->state_filepath_isfrozen)) {
         g_warning("unable to delete %s, fsfreeze may not function properly",
@@ -896,9 +896,10 @@ int64_t ga_get_fd_handle(GAState *s, Error **errp)
     int64_t handle;
 
     g_assert(s->pstate_filepath);
-    /* we blacklist commands and avoid operations that potentially require
-     * writing to disk when we're in a frozen state. this includes opening
-     * new files, so we should never get here in that situation
+    /*
+     * We have commands in a denylist and avoid operations that potentially
+     * require writing to disk when we're in a frozen state. this includes
+     * opening new files, so we should never get here in that situation
      */
     g_assert(!ga_is_frozen(s));
 
@@ -950,8 +951,8 @@ struct GAConfig {
 #ifdef _WIN32
     const char *service;
 #endif
-    gchar *bliststr; /* blacklist may point to this string */
-    GList *blacklist;
+    gchar *bliststr; /* denylist may point to this string */
+    GList *denylist;
     int daemonize;
     GLogLevelFlags log_level;
     int dumpconf;
@@ -1171,7 +1172,7 @@ static void config_parse(GAConfig *config, int argc, char **argv)
                 qmp_for_each_command(&ga_commands, ga_print_cmd, NULL);
                 exit(EXIT_SUCCESS);
             }
-            config->blacklist = g_list_concat(config->blacklist,
+            config->denylist = g_list_concat(config->denylist,
                                              split_list(optarg, ","));
             break;
         }
@@ -1226,7 +1227,7 @@ static void config_free(GAConfig *config)
 #ifdef CONFIG_FSFREEZE
     g_free(config->fsfreeze_hook);
 #endif
-    g_list_free_full(config->blacklist, g_free);
+    g_list_free_full(config->denylist, g_free);
     g_free(config);
 }
 
@@ -1308,7 +1309,7 @@ static GAState *initialize_agent(GAConfig *config, int socket_activation)
             s->deferred_options.log_filepath = config->log_filepath;
         }
         ga_disable_logging(s);
-        qmp_for_each_command(&ga_commands, ga_disable_non_whitelisted, NULL);
+        qmp_for_each_command(&ga_commands, ga_disable_not_allowed, NULL);
     } else {
         if (config->daemonize) {
             become_daemon(config->pid_filepath);
@@ -1332,10 +1333,10 @@ static GAState *initialize_agent(GAConfig *config, int socket_activation)
         return NULL;
     }
 
-    config->blacklist = ga_command_blacklist_init(config->blacklist);
-    if (config->blacklist) {
-        GList *l = config->blacklist;
-        s->blacklist = config->blacklist;
+    config->denylist = ga_command_denylist_init(config->denylist);
+    if (config->denylist) {
+        GList *l = config->denylist;
+        s->denylist = config->denylist;
         do {
             g_debug("disabling command: %s", (char *)l->data);
             qmp_disable_command(&ga_commands, l->data);
-- 
2.26.2



  parent reply	other threads:[~2021-02-02 21:04 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 20:58 [PATCH 00/12] misc: Replace the words 'blacklist/whitelist' Philippe Mathieu-Daudé
2021-02-02 20:58 ` [PATCH 01/12] ui: Replace the word 'whitelist' Philippe Mathieu-Daudé
2021-02-03  9:43   ` Gerd Hoffmann
2021-02-03 10:04   ` Daniel P. Berrangé
2021-02-04  9:04     ` Philippe Mathieu-Daudé
2021-02-02 20:58 ` [PATCH 02/12] qga: Rename config key 'blacklist' as 'denylist' Philippe Mathieu-Daudé
2021-02-03 10:17   ` Daniel P. Berrangé
2021-02-04  9:45   ` Michal Suchánek
2021-02-04 12:29     ` Michal Suchánek
2021-02-02 20:58 ` [PATCH 03/12] qga: Replace '--blacklist' command line option by '--denylist' Philippe Mathieu-Daudé
2021-02-03 10:09   ` Daniel P. Berrangé
2021-02-03 12:45     ` BALATON Zoltan
2021-02-03 15:47       ` Kevin Wolf
2021-02-03 16:02         ` Michael Roth
2022-07-18 16:17           ` Thomas Huth
2021-02-02 20:58 ` Philippe Mathieu-Daudé [this message]
2021-02-03 10:10   ` [PATCH 04/12] qga: Replace the word 'blacklist' Daniel P. Berrangé
2021-02-02 20:58 ` [PATCH 05/12] tools/virtiofsd: Replace the word 'whitelist' Philippe Mathieu-Daudé
2021-02-03  9:08   ` Dr. David Alan Gilbert
2021-02-03 10:11   ` Daniel P. Berrangé
2021-02-02 20:58 ` [PATCH 06/12] scripts/tracetool: " Philippe Mathieu-Daudé
2021-02-03 10:12   ` Daniel P. Berrangé
2021-02-03 14:31   ` Stefan Hajnoczi
2021-02-02 20:58 ` [PATCH 07/12] scripts/device-crash-test: " Philippe Mathieu-Daudé
2021-02-03  9:14   ` Philippe Mathieu-Daudé
2021-02-03 10:14   ` Daniel P. Berrangé
2021-02-02 20:58 ` [PATCH 08/12] seccomp: Replace the word 'blacklist' Philippe Mathieu-Daudé
2021-02-03 10:15   ` Daniel P. Berrangé
2021-02-03 10:41     ` Eduardo Otubo
2021-02-02 20:58 ` [PATCH 09/12] qemu-options: " Philippe Mathieu-Daudé
2021-02-03 10:25   ` Daniel P. Berrangé
2021-02-04  9:09     ` Philippe Mathieu-Daudé
2021-02-02 20:58 ` [PATCH 10/12] tests/qemu-iotests: Replace the words 'blacklist/whitelist' Philippe Mathieu-Daudé
2021-02-03 10:28   ` Daniel P. Berrangé
2021-02-03 15:41     ` Kevin Wolf
2021-02-03 15:50       ` Daniel P. Berrangé
2021-02-02 20:58 ` [PATCH 11/12] tests/fp/fp-test: Replace the word 'blacklist' Philippe Mathieu-Daudé
2021-02-03  9:20   ` Alex Bennée
2021-02-03 10:29   ` Daniel P. Berrangé
2021-02-02 20:58 ` [PATCH 12/12] hw/vfio/pci-quirks: " Philippe Mathieu-Daudé
2021-02-02 22:13   ` Alex Williamson
2021-02-03 10:30   ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210202205824.1085853-5-philmd@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=alex.williamson@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=dgilbert@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=mreitz@redhat.com \
    --cc=otubo@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.