Skip to contentSkip to conversation

libxl: Initialize valid_devs in output_topologyinfo()

PATCH In review Boris Ostrovsky 3 participants 3 messages May 15, 2015 – May 21, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: Initialize valid_devs in output_topologyinfo()

Commit e78e8b9bb649 ("libxl: Add interface for querying hypervisor about PCI topology") neglected to initialize valid_devs. This may result in not printing a message to console if no IO topology information is available and, more importantly, may break non-debug builds on some versions of gcc.

---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/libxl/xl_cmdimpl.c +1 -1
index 373aa37..6d60ce4 100644
@@ -5423,7 +5423,7 @@ static void output_topologyinfo(void)
     libxl_cputopology *cpuinfo;
     int i, nr;
     libxl_pcitopology *pciinfo;
-    int valid_devs;
+    int valid_devs = 0;
 
 
     cpuinfo = libxl_get_cpu_topology(ctx, &nr);
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Boris Ostrovsky

Commit e78e8b9bb649 ("libxl: Add interface for querying hypervisor about PCI topology") neglected to initialize valid_devs. This may result in not printing a message to console if no IO topology information is available and, more importantly, may break non-debug builds on some versions of gcc.

Quoted 19 lines
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/libxl/xl_cmdimpl.c +1 -1
index 373aa37..6d60ce4 100644
@@ -5423,7 +5423,7 @@ static void output_topologyinfo(void)
     libxl_cputopology *cpuinfo;
     int i, nr;
     libxl_pcitopology *pciinfo;
-    int valid_devs;
+    int valid_devs = 0;
 
 
     cpuinfo = libxl_get_cpu_topology(ctx, &nr);
Signature · 1 line
1.7.1
#2 lore raw
Quoted 11 lines · Wei Liu
Quoted 8 lines · Boris Ostrovsky

Commit e78e8b9bb649 ("libxl: Add interface for querying hypervisor about PCI topology") neglected to initialize valid_devs. This may result in not printing a message to console if no IO topology information is available and, more importantly, may break non-debug builds on some versions of gcc.

Thanks, but I already just applied a similar looking patch from Charles Arnold.

Quoted 20 lines
Quoted 20 lines
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/libxl/xl_cmdimpl.c +1 -1
index 373aa37..6d60ce4 100644
@@ -5423,7 +5423,7 @@ static void output_topologyinfo(void)
     libxl_cputopology *cpuinfo;
     int i, nr;
     libxl_pcitopology *pciinfo;
-    int valid_devs;
+    int valid_devs = 0;
 
 
     cpuinfo = libxl_get_cpu_topology(ctx, &nr);
Signature · 1 line
1.7.1