projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/master'
[collectd.git]
/
src
/
virt.c
diff --git
a/src/virt.c
b/src/virt.c
index
9cfdb05
..
11481a4
100644
(file)
--- a/
src/virt.c
+++ b/
src/virt.c
@@
-1004,7
+1004,7
@@
static void vcpu_submit(derive_t value, virDomainPtr dom, int vcpu_nr,
const char *type) {
char type_instance[DATA_MAX_NAME_LEN];
const char *type) {
char type_instance[DATA_MAX_NAME_LEN];
- snprintf(type_instance, sizeof(type_instance), "%d", vcpu_nr);
+ s
s
nprintf(type_instance, sizeof(type_instance), "%d", vcpu_nr);
submit(dom, type, type_instance, &(value_t){.derive = value}, 1);
}
submit(dom, type, type_instance, &(value_t){.derive = value}, 1);
}
@@
-1026,7
+1026,7
@@
static void disk_block_stats_submit(struct lv_block_stats *bstats,
}
char flush_type_instance[DATA_MAX_NAME_LEN];
}
char flush_type_instance[DATA_MAX_NAME_LEN];
- snprintf(flush_type_instance, sizeof(flush_type_instance), "flush-%s",
+ s
s
nprintf(flush_type_instance, sizeof(flush_type_instance), "flush-%s",
type_instance);
if ((bstats->bi.rd_req != -1) && (bstats->bi.wr_req != -1))
type_instance);
if ((bstats->bi.rd_req != -1) && (bstats->bi.wr_req != -1))
@@
-1130,7
+1130,7
@@
static void domain_state_submit_notif(virDomainPtr dom, int state, int reason) {
const char *reason_str = "N/A";
#endif
const char *reason_str = "N/A";
#endif
- snprintf(msg, sizeof(msg), "Domain state: %s. Reason: %s", state_str,
+ s
s
nprintf(msg, sizeof(msg), "Domain state: %s. Reason: %s", state_str,
reason_str);
int severity;
reason_str);
int severity;
@@
-1578,7
+1578,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);
char type_instance[DATA_MAX_NAME_LEN];
bool is_set = VIR_CPU_USABLE(cpu_maps, cpu_map_len, vcpu, cpu);
- snprintf(type_instance, sizeof(type_instance), "vcpu_%d-cpu_%d", vcpu, cpu);
+ s
s
nprintf(type_instance, sizeof(type_instance), "vcpu_%d-cpu_%d", vcpu, cpu);
submit(dom, "cpu_affinity", type_instance, &(value_t){.gauge = is_set}, 1);
}
}
submit(dom, "cpu_affinity", type_instance, &(value_t){.gauge = is_set}, 1);
}
}
@@
-2396,7
+2396,7
@@
static int lv_init_instance(size_t i, plugin_read_cb callback) {
memset(lv_ud, 0, sizeof(*lv_ud));
memset(lv_ud, 0, sizeof(*lv_ud));
- snprintf(inst->tag, sizeof(inst->tag), "%s-%" PRIsz, PLUGIN_NAME, i);
+ s
s
nprintf(inst->tag, sizeof(inst->tag), "%s-%" PRIsz, PLUGIN_NAME, i);
inst->id = i;
user_data_t *ud = &(lv_ud->ud);
inst->id = i;
user_data_t *ud = &(lv_ud->ud);
@@
-2466,7
+2466,7
@@
static int lv_domain_get_tag(xmlXPathContextPtr xpath_ctx, const char *dom_name,
goto done;
}
goto done;
}
- snprintf(xpath_str, sizeof(xpath_str), "/domain/metadata/%s:%s/text()",
+ s
s
nprintf(xpath_str, sizeof(xpath_str), "/domain/metadata/%s:%s/text()",
METADATA_VM_PARTITION_PREFIX, METADATA_VM_PARTITION_ELEMENT);
xpath_obj = xmlXPathEvalExpression((xmlChar *)xpath_str, xpath_ctx);
if (xpath_obj == NULL) {
METADATA_VM_PARTITION_PREFIX, METADATA_VM_PARTITION_ELEMENT);
xpath_obj = xmlXPathEvalExpression((xmlChar *)xpath_str, xpath_ctx);
if (xpath_obj == NULL) {
@@
-2669,7
+2669,7
@@
static void lv_add_network_interfaces(struct lv_read_state *state,
break;
case if_number: {
char number_string[4];
break;
case if_number: {
char number_string[4];
- snprintf(number_string, sizeof(number_string), "%d", itf_number);
+ s
s
nprintf(number_string, sizeof(number_string), "%d", itf_number);
if (ignore_device_match(il_interface_devices, domname, number_string) !=
0)
device_ignored = true;
if (ignore_device_match(il_interface_devices, domname, number_string) !=
0)
device_ignored = true;
@@
-2970,7
+2970,7
@@
static int add_interface_device(struct lv_read_state *state, virDomainPtr dom,
}
char number_string[21];
}
char number_string[21];
- snprintf(number_string, sizeof(number_string), "interface-%u", number);
+ s
s
nprintf(number_string, sizeof(number_string), "interface-%u", number);
char *number_copy = strdup(number_string);
if (!number_copy) {
sfree(path_copy);
char *number_copy = strdup(number_string);
if (!number_copy) {
sfree(path_copy);
@@
-3009,7
+3009,7
@@
static int ignore_device_match(ignorelist_t *il, const char *domname,
ERROR(PLUGIN_NAME " plugin: malloc failed.");
return 0;
}
ERROR(PLUGIN_NAME " plugin: malloc failed.");
return 0;
}
- snprintf(name, n, "%s:%s", domname, devpath);
+ s
s
nprintf(name, n, "%s:%s", domname, devpath);
int r = ignorelist_match(il, name);
sfree(name);
return r;
int r = ignorelist_match(il, name);
sfree(name);
return r;