[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/3] tools/libxenstat: small fixes in the Linux network collector


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Olivier Lambert <olivier.lambert@xxxxxxxxxx>
  • Date: Fri, 16 Oct 2026 09:12:56 +0000
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=vates.tech header.i="@vates.tech" header.h="From:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type:Feedback-ID"
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>
  • Delivery-date: Fri, 16 Oct 2026 09:14:03 +0000
  • Feedback-id: default:8631fc262581453bbf619ec5b2062170:Sweego
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.