summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4928cae)
raw | patch | inline | side by side (parent: 4928cae)
author | Florian Forster <octo@collectd.org> | |
Fri, 28 Oct 2016 08:45:23 +0000 (10:45 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 28 Oct 2016 11:43:54 +0000 (13:43 +0200) |
src/virt.c | patch | blob | history |
diff --git a/src/virt.c b/src/virt.c
index 6d83a5c5694438531cbec809a3cf5688a2af3781..62b53dcca36606a10caefe4c0db6e2ba0ef14aec 100644 (file)
--- a/src/virt.c
+++ b/src/virt.c
&stats, sizeof stats) != 0)
continue;
- char *type_instance = NULL;
- if (blockdevice_format_basename && blockdevice_format == source)
- type_instance = strdup(basename(block_devices[i].path));
- else
- type_instance = strdup(block_devices[i].path);
+ char *type_instance = NULL;
+ if (blockdevice_format_basename && blockdevice_format == source)
+ type_instance = strdup(basename(block_devices[i].path));
+ else
+ type_instance = strdup(block_devices[i].path);
+
if ((stats.rd_req != -1) && (stats.wr_req != -1))
submit_derive2 ("disk_ops",
(derive_t) stats.rd_req, (derive_t) stats.wr_req,
submit_derive2 ("disk_octets",
(derive_t) stats.rd_bytes, (derive_t) stats.wr_bytes,
block_devices[i].dom, type_instance);
-
- sfree(type_instance);
+
+ sfree (type_instance);
} /* for (nr_block_devices) */
/* Get interface stats for each domain. */
struct _virDomainInterfaceStats stats;
char *display_name = NULL;
-
switch (interface_format) {
case if_address:
display_name = interface_devices[i].address;
xpath_ctx = xmlXPathNewContext (xml_doc);
/* Block devices. */
- char *bd_xmlpath = "/domain/devices/disk/target[@dev]";
- if (blockdevice_format == source)
- bd_xmlpath = "/domain/devices/disk/source[@dev]";
+ char *bd_xmlpath = "/domain/devices/disk/target[@dev]";
+ if (blockdevice_format == source)
+ bd_xmlpath = "/domain/devices/disk/source[@dev]";
xpath_obj = xmlXPathEval ((xmlChar *) bd_xmlpath, xpath_ctx);
if (xpath_obj == NULL || xpath_obj->type != XPATH_NODESET ||