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

[Xen-devel] libxenstat_linux.c xenstat_collect_networks regression

  • To: xen-devel@xxxxxxxxxxxxx
  • From: Bas Westerbaan <bas@xxxxxxxxxxxxxxx>
  • Date: Sun, 10 Dec 2017 16:56:51 +0100
  • Delivery-date: Sun, 10 Dec 2017 17:15:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


I just upgraded from 4.4 to 4.8 (going from Debian jessie to stretch) and hit a 
problem with xentop.  On 4.8 xentop shows only zeroes for network traffic.

I did some debugging and the problem appears to be that in 
xenstat_collect_networks (in libxenstat_linux.c) the following conditional is 

        if ((strstr(iface, devBridge) != NULL) &&
            (strstr(iface, devNoBridge) == NULL) &&
            ((domain = xenstat_node_domain(node, 0)) != NULL)) {

I use vif-route, so I have no bridge: devBridge points to an array of \0s.  So 
strstr says this empty string is a substring of vifn.0. Then it seems to act as 
if I am actually using a bridge and fails.

As a workaround I replaced the conditional with

        if ((devBridge[0] != 0) &&
            (strstr(iface, devBridge) != NULL) &&
            (strstr(iface, devNoBridge) == NULL) &&
            ((domain = xenstat_node_domain(node, 0)) != NULL)) {

This solved the problem for me, although I’m not sure at all if this solution 
is correct in general.


Xen-devel mailing list



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