]> xenbits.xensource.com Git - libvirt.git/commitdiff
vz: change printing format specifier for network statistics
authorMaxim Nestratov <mnestratov@virtuozzo.com>
Tue, 29 Nov 2016 18:07:38 +0000 (21:07 +0300)
committerMaxim Nestratov <mnestratov@virtuozzo.com>
Tue, 31 Jan 2017 14:05:20 +0000 (17:05 +0300)
This is necessary to be able to get statistics for venet0 or
"host-routed" adapter, which has -1 index and thus, its statistics
is shown as "net.nic4294967295".

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
src/vz/vz_sdk.c

index f89d3e69b8e3dd6bb04f7ee90d2c6e3c1ce7f27c..3f46de7081a2b374758688b96bf9ec9ea818c0d2 100644 (file)
@@ -4517,7 +4517,7 @@ prlsdkGetNetStats(PRL_HANDLE sdkstats, PRL_HANDLE sdkdom, const char *path,
     prlsdkCheckRetGoto(pret, cleanup);
 
 #define PRLSDK_GET_NET_COUNTER(VAL, NAME)                           \
-    if (virAsprintf(&name, "net.nic%d.%s", net_index, NAME) < 0)    \
+    if (virAsprintf(&name, "net.nic%u.%s", net_index, NAME) < 0)    \
         goto cleanup;                                               \
     if (prlsdkExtractStatsParam(sdkstats, name, &stats->VAL) < 0)   \
         goto cleanup;                                               \