|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 0/3] tools/libxenstat: small fixes in the Linux network collector
While looking at xenstat_collect_networks() for commit 0c53660c1cf3
("tools/libxenstat: don't lose all VIFs when dom0 has no Linux bridge"),
I noticed a few more issues in xenstat_linux.c:
- getBridge() dereferences NULL when /sys/class/net can't be opened,
- after a failed /proc/net/dev header check, the next call skips the
check and parses the file anyway,
- parseNetDevLine() doesn't initialise all of its outputs (cleanup, no
functional change intended).
Patches 1 and 2 may be worth backporting. If so, patch 1 should go along
with 0c53660c1cf3: without it, the empty bridge name would make every
VIF disappear instead.
Testing: libxenstat builds with the usual tools CFLAGS (including
-Werror). I also tested the series on an XCP-ng 8.3 host (Xen 4.17.7,
Open vSwitch), applied with 0c53660c1cf3 on top of its libxenstat and
loaded via LD_LIBRARY_PATH:
- xentop reports the same networks and counters with and without the
series,
- with /sys/class/net made unavailable in a private mount namespace,
xentop no longer segfaults in readdir() called from
xenstat_collect_networks(),
- with an invalid /proc/net/dev bind-mounted over the real one, a second
xenstat_get_node() call fails again instead of parsing the file.
Olivier Lambert (3):
tools/libxenstat: don't crash when /sys/class/net can't be opened
tools/libxenstat: don't skip the /proc/net/dev check after a failure
tools/libxenstat: fix output initialisation in parseNetDevLine()
tools/libs/stat/xenstat_linux.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--
2.53.0
--
Olivier Lambert | Vates CEO
XCP-ng & Xen Orchestra - Vates solutions
Book a meeting with me: https://calrs.vates.tech/u/olivier-lambert
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |