Code

virt plugin: only gather stats for running domains
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 9 Dec 2014 16:06:43 +0000 (17:06 +0100)
committerMarc Fournier <marc.fournier@camptocamp.com>
Fri, 12 Dec 2014 21:47:51 +0000 (22:47 +0100)
Conflicts:
src/libvirt.c

src/libvirt.c

index 1f6287923fae47fbcd48bee83c660f66352da35c..4ab8bd5c1503e872cef86e168ceabd7e1abffb31 100644 (file)
@@ -306,6 +306,12 @@ lv_read (void)
             continue;
         }
 
+        if (info.state != VIR_DOMAIN_RUNNING)
+        {
+            /* only gather stats for running domains */
+            continue;
+        }
+
         cpu_submit (info.cpuTime, t, domains[i], "virt_cpu_total");
 
         vinfo = malloc (info.nrVirtCpu * sizeof (vinfo[0]));