static int v5_df(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_value;
/* Can't upgrade if both instances have been set. */
if ((vl->plugin_instance[0] != 0) && (vl->type_instance[0] != 0))
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = &new_value;
+ new_vl.values = &(value_t){.gauge = NAN};
new_vl.values_len = 1;
new_vl.meta = NULL;
static int v5_mysql_qcache(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_value;
if (vl->values_len != 5)
return (FC_TARGET_STOP);
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = &new_value;
+ new_vl.values = &(value_t){.gauge = NAN};
new_vl.values_len = 1;
new_vl.meta = NULL;
static int v5_mysql_threads(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_value;
if (vl->values_len != 4)
return (FC_TARGET_STOP);
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = &new_value;
+ new_vl.values = &(value_t){.gauge = NAN};
new_vl.values_len = 1;
new_vl.meta = NULL;
static int v5_zfs_arc_counts(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_value;
_Bool is_hits;
if (vl->values_len != 4)
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = &new_value;
+ new_vl.values = &(value_t){.gauge = NAN};
new_vl.values_len = 1;
new_vl.meta = NULL;
static int v5_zfs_arc_l2_bytes(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_values[2];
if (vl->values_len != 2)
return (FC_TARGET_STOP);
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = new_values;
- new_vl.values_len = 2;
new_vl.meta = NULL;
/* Change the type/-instance to "io_octets-L2" */
sstrncpy(new_vl.type_instance, "L2", sizeof(new_vl.type_instance));
/* Copy the actual values. */
- new_vl.values[0].derive = (derive_t)vl->values[0].counter;
- new_vl.values[1].derive = (derive_t)vl->values[1].counter;
+ value_t values[] = {
+ {.derive = (derive_t)vl->values[0].counter},
+ {.derive = (derive_t)vl->values[1].counter},
+ };
+ new_vl.values = values;
+ new_vl.values_len = STATIC_ARRAY_SIZE(values);
/* Dispatch new value lists instead of this one */
plugin_dispatch_values(&new_vl);
static int v5_zfs_arc_l2_size(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_value;
if (vl->values_len != 1)
return (FC_TARGET_STOP);
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = &new_value;
+ new_vl.values = &(value_t){.gauge = NAN};
new_vl.values_len = 1;
new_vl.meta = NULL;
static int v5_zfs_arc_ratio(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_value;
if (vl->values_len != 1)
return (FC_TARGET_STOP);
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = &new_value;
+ new_vl.values = &(value_t){.gauge = NAN};
new_vl.values_len = 1;
new_vl.meta = NULL;
static int v5_zfs_arc_size(const data_set_t *ds, value_list_t *vl) /* {{{ */
{
value_list_t new_vl;
- value_t new_value;
if (vl->values_len != 4)
return (FC_TARGET_STOP);
memcpy(&new_vl, vl, sizeof(new_vl));
/* Reset data we can't simply copy */
- new_vl.values = &new_value;
+ new_vl.values = &(value_t){.gauge = NAN};
new_vl.values_len = 1;
new_vl.meta = NULL;
tproc.invoke = v5_invoke;
fc_register_target("v5upgrade", tproc);
} /* module_register */
-
-/* vim: set sw=2 sts=2 tw=78 et fdm=marker : */