projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #3103 from rubenk/write_prometheus-fix-compiler-warning
[collectd.git]
/
src
/
virt.c
diff --git
a/src/virt.c
b/src/virt.c
index
876fe30
..
d44aeb7
100644
(file)
--- a/
src/virt.c
+++ b/
src/virt.c
@@
-22,10
+22,10
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
+#include "utils/ignorelist/ignorelist.h"
#include "utils_complain.h"
#include "utils_complain.h"
-#include "utils_ignorelist.h"
#include <libgen.h> /* for basename(3) */
#include <libvirt/libvirt.h>
#include <libgen.h> /* for basename(3) */
#include <libvirt/libvirt.h>
@@
-138,6
+138,9
@@
static const char *config_keys[] = {"Connection",
"Instances",
"ExtraStats",
"PersistentNotification",
"Instances",
"ExtraStats",
"PersistentNotification",
+
+ "ReportBlockDevices",
+ "ReportNetworkInterfaces",
NULL};
/* PersistentNotification is false by default */
NULL};
/* PersistentNotification is false by default */
@@
-719,7
+722,7
@@
static int get_block_info(struct lv_block_info *binfo,
ERROR(PLUGIN_NAME " plugin: %s failed: %s", (s), err->message); \
} while (0)
ERROR(PLUGIN_NAME " plugin: %s failed: %s", (s), err->message); \
} while (0)
-char *metadata_get_hostname(virDomainPtr dom) {
+
static
char *metadata_get_hostname(virDomainPtr dom) {
const char *xpath_str = NULL;
if (hm_xpath == NULL)
xpath_str = "/instance/name/text()";
const char *xpath_str = NULL;
if (hm_xpath == NULL)
xpath_str = "/instance/name/text()";
@@
-1429,7
+1432,7
@@
static int lv_domain_block_info(virDomainPtr dom, const char *path,
return -1;
}
return -1;
}
- virTypedParameterPtr params = calloc(
(size_t)
nparams, sizeof(*params));
+ virTypedParameterPtr params = calloc(nparams, sizeof(*params));
if (params == NULL) {
ERROR("virt plugin: alloc(%i) for block=%s parameters failed.", nparams,
path);
if (params == NULL) {
ERROR("virt plugin: alloc(%i) for block=%s parameters failed.", nparams,
path);
@@
-1499,7
+1502,7
@@
static int get_vcpu_stats(virDomainPtr domain, unsigned short nr_virt_cpu) {
int max_cpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
int cpu_map_len = VIR_CPU_MAPLEN(max_cpus);
int max_cpus = VIR_NODEINFO_MAXCPUS(nodeinfo);
int cpu_map_len = VIR_CPU_MAPLEN(max_cpus);
- virVcpuInfoPtr vinfo = calloc(nr_virt_cpu, sizeof(
vinfo[0]
));
+ virVcpuInfoPtr vinfo = calloc(nr_virt_cpu, sizeof(
*vinfo
));
if (vinfo == NULL) {
ERROR(PLUGIN_NAME " plugin: calloc failed.");
return -1;
if (vinfo == NULL) {
ERROR(PLUGIN_NAME " plugin: calloc failed.");
return -1;
@@
-1541,7
+1544,7
@@
static int get_pcpu_stats(virDomainPtr dom) {
return -1;
}
return -1;
}
- virTypedParameterPtr param = calloc(nparams, sizeof(
virTypedParameter
));
+ virTypedParameterPtr param = calloc(nparams, sizeof(
*param
));
if (param == NULL) {
ERROR(PLUGIN_NAME " plugin: alloc(%i) for cpu parameters failed.", nparams);
return -1;
if (param == NULL) {
ERROR(PLUGIN_NAME " plugin: alloc(%i) for cpu parameters failed.", nparams);
return -1;
@@
-1624,9
+1627,9
@@
static int get_domain_state_notify(virDomainPtr domain) {
static int get_memory_stats(virDomainPtr domain) {
virDomainMemoryStatPtr minfo =
static int get_memory_stats(virDomainPtr domain) {
virDomainMemoryStatPtr minfo =
- calloc(VIR_DOMAIN_MEMORY_STAT_NR, sizeof(
virDomainMemoryStatStruct
));
+ calloc(VIR_DOMAIN_MEMORY_STAT_NR, sizeof(
*minfo
));
if (minfo == NULL) {
if (minfo == NULL) {
- ERROR("virt plugin:
m
alloc failed.");
+ ERROR("virt plugin:
c
alloc failed.");
return -1;
}
return -1;
}