X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fvirt.c;h=174db2fabff2cd6089fc71d61e0514f116e1d31d;hp=b3e34f4ec4b9d66d30124162ae0177182678c708;hb=1159cb5d383c55a80a0db100b8f7aadcf44740a5;hpb=be126043c2be20399d7670fe194645292018bde0 diff --git a/src/virt.c b/src/virt.c index b3e34f4e..174db2fa 100644 --- a/src/virt.c +++ b/src/virt.c @@ -444,12 +444,10 @@ static void init_block_info(struct lv_block_info *binfo) { #ifdef HAVE_BLOCK_STATS_FLAGS #define GET_BLOCK_INFO_VALUE(NAME, FIELD) \ - do { \ - if (!strcmp(param[i].field, NAME)) { \ - binfo->FIELD = param[i].value.l; \ - continue; \ - } \ - } while (0) + if (!strcmp(param[i].field, NAME)) { \ + binfo->FIELD = param[i].value.l; \ + continue; \ + } static int get_block_info(struct lv_block_info *binfo, virTypedParameterPtr param, int nparams) { @@ -753,7 +751,7 @@ static void disk_submit(struct lv_block_info *binfo, virDomainPtr dom, char flush_type_instance[DATA_MAX_NAME_LEN]; snprintf(flush_type_instance, sizeof(flush_type_instance), "flush-%s", - type_instance); + type_instance); if ((binfo->bi.rd_req != -1) && (binfo->bi.wr_req != -1)) submit_derive2("disk_ops", (derive_t)binfo->bi.rd_req, @@ -829,7 +827,7 @@ static void domain_state_submit(virDomainPtr dom, int state, int reason) { #endif snprintf(msg, sizeof(msg), "Domain state: %s. Reason: %s", state_str, - reason_str); + reason_str); int severity; switch (state) { @@ -1180,8 +1178,7 @@ static void vcpu_pin_submit(virDomainPtr dom, int max_cpus, int vcpu, char type_instance[DATA_MAX_NAME_LEN]; _Bool is_set = VIR_CPU_USABLE(cpu_maps, cpu_map_len, vcpu, cpu) ? 1 : 0; - snprintf(type_instance, sizeof(type_instance), "vcpu_%d-cpu_%d", vcpu, - cpu); + snprintf(type_instance, sizeof(type_instance), "vcpu_%d-cpu_%d", vcpu, cpu); submit(dom, "cpu_affinity", type_instance, &(value_t){.gauge = is_set}, 1); } } @@ -1722,7 +1719,7 @@ static int lv_domain_get_tag(xmlXPathContextPtr xpath_ctx, const char *dom_name, } snprintf(xpath_str, sizeof(xpath_str), "/domain/metadata/%s:%s/text()", - METADATA_VM_PARTITION_PREFIX, METADATA_VM_PARTITION_ELEMENT); + METADATA_VM_PARTITION_PREFIX, METADATA_VM_PARTITION_ELEMENT); xpath_obj = xmlXPathEvalExpression((xmlChar *)xpath_str, xpath_ctx); if (xpath_obj == NULL) { ERROR(PLUGIN_NAME " plugin: xmlXPathEval(%s) failed on domain %s",