[PATCH 0/3] Fix CI, build, and a typo
 
            Each in its respecive commit, obviously. Martin Kletzander (3): nwfilter: Fix erroneous pointer passing to g_clear_pointer python: Do not explicitly state variables are global when only read qemu_rdp: Fix a typo existance -> existence scripts/apibuild.py | 6 ------ src/nwfilter/nwfilter_gentech_driver.c | 4 ++-- src/qemu/qemu_rdp.c | 2 +- tools/virt-qemu-qmp-proxy | 1 - 4 files changed, 3 insertions(+), 10 deletions(-) -- 2.49.0
 
            From: Martin Kletzander <mkletzan@redhat.com> Commit 5de27c32a18f wanted to fix a possible double free, but by mistake did not pass a reference to the variable. This made virtnwfilterd coredump in our daily CI build. Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/nwfilter/nwfilter_gentech_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 0c12b54b8029..1465734a54f8 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -203,12 +203,12 @@ virNWFilterInstReset(virNWFilterInst *inst) for (i = 0; i < inst->nfilters; i++) virNWFilterObjUnlock(inst->filters[i]); - g_clear_pointer(inst->filters, g_free); + g_clear_pointer(&inst->filters, g_free); inst->nfilters = 0; for (i = 0; i < inst->nrules; i++) virNWFilterRuleInstFree(inst->rules[i]); - g_clear_pointer(inst->rules, g_free); + g_clear_pointer(&inst->rules, g_free); inst->nrules = 0; } -- 2.49.0
 
            From: Martin Kletzander <mkletzan@redhat.com> If a variable is not modified in a scope there is no need for the use of global in such scope. Without this patch build fails with: F824 `global ...` is unused: name is never assigned in scope It is a bit difficult to find more information on that message and error code, I found it here: https://docs.astral.sh/ruff/rules/global-variable-not-assigned/ Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- scripts/apibuild.py | 6 ------ tools/virt-qemu-qmp-proxy | 1 - 2 files changed, 7 deletions(-) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index 3ecc3eadf7b2..a30e87969aa6 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -818,8 +818,6 @@ class CParser: # Parse a comment block associate to a macro # def parseMacroComment(self, name, quiet=0): - global ignored_macros - if name[0:2] == '__': quiet = 1 if name in ignored_macros: @@ -895,8 +893,6 @@ class CParser: # as possible # def mergeFunctionComment(self, name, description, quiet=0): - global ignored_functions - if name == 'main': quiet = 1 if name[0:2] == '__': @@ -1135,8 +1131,6 @@ class CParser: self.lexer.push(tok) def token(self): - global ignored_words - token = self.lexer.token() while token is not None: if token[0] == 'comment': diff --git a/tools/virt-qemu-qmp-proxy b/tools/virt-qemu-qmp-proxy index dcdb24b9a9eb..39e98e9d5147 100755 --- a/tools/virt-qemu-qmp-proxy +++ b/tools/virt-qemu-qmp-proxy @@ -278,7 +278,6 @@ class QMPProxy(object): else: error = True except Exception as e: - global debug if debug: print("%s: %s" % (sys.argv[0], str(e))) print(traceback.format_exc()) -- 2.49.0
 
            From: Martin Kletzander <mkletzan@redhat.com> Signed-off-by: Martin Kletzander <mkletzan@redhat.com> --- src/qemu/qemu_rdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_rdp.c b/src/qemu/qemu_rdp.c index 0c48b87e7bad..919f5788bf8f 100644 --- a/src/qemu/qemu_rdp.c +++ b/src/qemu/qemu_rdp.c @@ -432,6 +432,6 @@ qemuRdpAvailable(const char *helper) g_autofree char *helperPath = NULL; /* This function was added corresponding to the first release of 'qemu-rdp' - * thus checking existance of the helper binary is sufficient. */ + * thus checking existence of the helper binary is sufficient. */ return !!(helperPath = virFindFileInPath(helper)); } -- 2.49.0
 
            On Wed, Apr 16, 2025 at 10:06:52 +0200, Martin Kletzander wrote:
Each in its respecive commit, obviously.
Martin Kletzander (3): nwfilter: Fix erroneous pointer passing to g_clear_pointer python: Do not explicitly state variables are global when only read qemu_rdp: Fix a typo existance -> existence
scripts/apibuild.py | 6 ------ src/nwfilter/nwfilter_gentech_driver.c | 4 ++-- src/qemu/qemu_rdp.c | 2 +- tools/virt-qemu-qmp-proxy | 1 - 4 files changed, 3 insertions(+), 10 deletions(-)
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
participants (2)
- 
                 Jiri Denemark Jiri Denemark
- 
                 Martin Kletzander Martin Kletzander