X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvirt.c;h=b9da68e71416938e3fa78c207d2663499b0273b9;hb=6164fe4456716e6dc36aaa2ab617b104a7ac5ff3;hp=dff8f71dcb9119c812ad9645f72ea2d5f010b824;hpb=0003c4d3c184f0f437499d6073cd023dc7b659c2;p=collectd.git diff --git a/src/virt.c b/src/virt.c index dff8f71d..b9da68e7 100644 --- a/src/virt.c +++ b/src/virt.c @@ -128,7 +128,7 @@ enum plginst_field { }; static enum plginst_field plugin_instance_format[PLGINST_MAX_FIELDS] = - { plginst_name }; + { plginst_none }; /* InterfaceFormat. */ enum if_field { @@ -327,8 +327,8 @@ lv_init (void) { if (virInitialize () != 0) return -1; - - return 0; + else + return 0; } static int @@ -417,8 +417,8 @@ lv_config (const char *key, const char *value) else if (strcasecmp (fields[i], "uuid") == 0) hostname_format[i] = hf_uuid; else { - sfree (value_copy); ERROR (PLUGIN_NAME " plugin: unknown HostnameFormat field: %s", fields[i]); + sfree (value_copy); return -1; } } @@ -449,13 +449,16 @@ lv_config (const char *key, const char *value) } for (i = 0; i < n; ++i) { - if (strcasecmp (fields[i], "name") == 0) + if (strcasecmp (fields[i], "none") == 0) { + plugin_instance_format[i] = plginst_none; + break; + } else if (strcasecmp (fields[i], "name") == 0) plugin_instance_format[i] = plginst_name; else if (strcasecmp (fields[i], "uuid") == 0) plugin_instance_format[i] = plginst_uuid; else { + ERROR (PLUGIN_NAME " plugin: unknown PluginInstanceFormat field: %s", fields[i]); sfree (value_copy); - ERROR (PLUGIN_NAME " plugin: unknown HostnameFormat field: %s", fields[i]); return -1; } }