X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fvirt.c;h=fd20c77ebd0a4b4e1ca02183c28e6f855adc32e5;hb=6378ec288f34ff250b2971a1452338a2b34c240a;hp=876fe30a2c93ba430402fc44b1bbc17708b3feb4;hpb=3db6326f553512b1d58a9dd284d4243211320f43;p=collectd.git diff --git a/src/virt.c b/src/virt.c index 876fe30a..fd20c77e 100644 --- a/src/virt.c +++ b/src/virt.c @@ -22,10 +22,10 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" +#include "utils/ignorelist/ignorelist.h" #include "utils_complain.h" -#include "utils_ignorelist.h" #include /* for basename(3) */ #include @@ -138,6 +138,9 @@ static const char *config_keys[] = {"Connection", "Instances", "ExtraStats", "PersistentNotification", + + "ReportBlockDevices", + "ReportNetworkInterfaces", NULL}; /* PersistentNotification is false by default */ @@ -1429,7 +1432,7 @@ static int lv_domain_block_info(virDomainPtr dom, const char *path, 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); @@ -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); - 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; @@ -1541,7 +1544,7 @@ static int get_pcpu_stats(virDomainPtr dom) { 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; @@ -1624,9 +1627,9 @@ static int get_domain_state_notify(virDomainPtr domain) { 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) { - ERROR("virt plugin: malloc failed."); + ERROR("virt plugin: calloc failed."); return -1; }