From: Pavel Rochnyack Date: Sun, 12 May 2019 19:59:23 +0000 (+0700) Subject: virt plugin: do not report empty metrics X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1b462dc4aaa6a45b6ce62b58f933b23c93c1743e;p=collectd.git virt plugin: do not report empty metrics --- diff --git a/src/virt.c b/src/virt.c index ff708642..2385f366 100644 --- a/src/virt.c +++ b/src/virt.c @@ -69,9 +69,9 @@ #endif /* - virConnectListAllDomains() appeared in 0.10.2 - Note that LIBVIR_CHECK_VERSION appeared a year later, so - in some systems which actually have virConnectListAllDomains() + virConnectListAllDomains() appeared in 0.10.2 (Sep 2012) + Note that LIBVIR_CHECK_VERSION appeared a year later (Dec 2013, libvirt-1.2.0), + so in some systems which actually have virConnectListAllDomains() we can't detect this. */ #if LIBVIR_CHECK_VERSION(0, 10, 2) @@ -1723,7 +1723,7 @@ static int get_memory_stats(virDomainPtr domain) { submit(domain, "swap_io", "out", &(value_t){.gauge = swap_out}, 1); } - if (min_flt > -1 || maj_flt > -1) { + if (min_flt > 0 || maj_flt > 0) { value_t values[] = { {.gauge = (gauge_t)min_flt}, {.gauge = (gauge_t)maj_flt}, };