diff --git a/include/fence_virt.h b/include/fence_virt.h new file mode 100644 index 0000000..442845b --- /dev/null +++ b/include/fence_virt.h @@ -0,0 +1,6 @@ +#ifndef _FENCE_VIRT_H +#define _FENCE_VIRT_H + +#define DEFAULT_CONFIG_FILE "/etc/fence_virt.conf" + +#endif diff --git a/server/main.c b/server/main.c index 37429c5..77129f7 100644 --- a/server/main.c +++ b/server/main.c @@ -6,6 +6,7 @@ #include /* Local includes */ +#include #include #include #include @@ -16,6 +17,7 @@ int main(int argc, char **argv) { char val[80]; + const char *config_file = DEFAULT_CONFIG_FILE; config_object_t *config; const plugin_t *p; srv_context_t mcast_context; @@ -30,10 +32,7 @@ main(int argc, char **argv) switch(opt) { case 'f': printf("Using %s\n", optarg); - if (sc_parse(config, optarg) != 0) { - printf("Failed to parse %s\n", optarg); - return -1; - } + config_file = optarg; break; case 'd': dset(atoi(optarg)); @@ -44,6 +43,10 @@ main(int argc, char **argv) } } + if (sc_parse(config, config_file) != 0) { + printf("Failed to parse %s\n", config_file); + return -1; + } if (!debug_set) { if (sc_get(config, "fence_virtd/@debug",