[libvirt] [PATCH 0/2] Fix build after commit 87b4c10c6cf02251dd8c29b5b895bebc6ec297f9

My gcc didn't whine about the uninitialized variable. This series tries to fix and then actually fixes the bug. Sorry for the inconvenience. I'm putting on my brown bag and upgrading my GCC. Series pushed as a build-breaker. Peter Krempa (2): xen: Initialize variable before using xen: Actually fix the uninitialized variable src/xen/xend_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.8.1.1

Commit 87b4c10c6cf02251dd8c29b5b895bebc6ec297f9 added code that may call the virCapabilitiesClearHostNUMACellCPUTopology function with uninitialized second argument. Although the value wouldn't be used some compilers whine about that. --- Pushed as build-breaker. Thanks to John Ferlan for reporting. src/xen/xend_internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index d0e54a8..98ea6b4 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -1115,7 +1115,7 @@ sexpr_to_xend_topology(const struct sexpr *root, virCapsHostNUMACellCPUPtr cpuInfo = NULL; int cell, cpu, nb_cpus; int n = 0; - int numCpus; + int numCpus = 0; nodeToCpu = sexpr_node(root, "node/node_to_cpu"); if (nodeToCpu == NULL) -- 1.8.1.1

0eedb1d9bff672b24d6957dfaa0a8b42d9e851a7 fixed the wrong variable --- Pushed as a build-breaker fix. src/xen/xend_internal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c index 98ea6b4..b03b7bc 100644 --- a/src/xen/xend_internal.c +++ b/src/xen/xend_internal.c @@ -1113,9 +1113,9 @@ sexpr_to_xend_topology(const struct sexpr *root, const char *nodeToCpu; const char *cur; virCapsHostNUMACellCPUPtr cpuInfo = NULL; - int cell, cpu, nb_cpus; + int cell, cpu, nb_cpus = 0; int n = 0; - int numCpus = 0; + int numCpus; nodeToCpu = sexpr_node(root, "node/node_to_cpu"); if (nodeToCpu == NULL) -- 1.8.1.1
participants (1)
-
Peter Krempa