From e0dd134a34c04d06edc85a62e3a449a711a5ce58 Mon Sep 17 00:00:00 2001 From: Lon Hohberger Date: Mon, 4 Jan 2010 14:16:42 -0500 Subject: [PATCH] Revert "Sort plugins by type when printing them" This reverts commit 2707d32a8753c109489332270aab19d3a750133b. --- server/Makefile.in | 2 +- server/main.c | 15 ++------------- server/plugin.c | 22 ++++------------------ 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/server/Makefile.in b/server/Makefile.in index 577ea5d..b3baafb 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -36,7 +36,7 @@ MODULE_PATH=${libdir}/${PACKAGE_NAME} # # Module sources # -fence_virtd_SOURCES = main.c plugin.c config.c +fence_virtd_SOURCES = main.c plugin.c libvirt_so_SOURCES = libvirt.c virt.c uuid-test.c null_so_SOURCES = null.c libvirt_qpid_so_SOURCES = uuid-test.c diff --git a/server/main.c b/server/main.c index 71a1a01..9dfb33c 100644 --- a/server/main.c +++ b/server/main.c @@ -13,9 +13,6 @@ #include #include -/* configure.c */ -int do_configure(config_object_t *config, const char *filename); - void usage(void) @@ -24,7 +21,6 @@ usage(void) printf(" -F Do not daemonize.\n"); printf(" -f Use as configuration file.\n"); printf(" -d Set debugging level to .\n"); - printf(" -c Configuration mode.\n"); } @@ -41,11 +37,11 @@ main(int argc, char **argv) listener_context_t listener_ctx = NULL; backend_context_t backend_ctx = NULL; int debug_set = 0, foreground = 0; - int opt, configure = 0; + int opt; config = sc_init(); - while ((opt = getopt(argc, argv, "Ff:d:c")) != EOF) { + while ((opt = getopt(argc, argv, "Ff:d:")) != EOF) { switch(opt) { case 'F': printf("Background mode disabled\n"); @@ -58,9 +54,6 @@ main(int argc, char **argv) case 'd': debug_set = atoi(optarg); break; - case 'c': - configure = 1; - break; case 'h': case '?': usage(); @@ -70,10 +63,6 @@ main(int argc, char **argv) } } - if (configure) { - return do_configure(config, config_file); - } - if (sc_parse(config, config_file) != 0) { printf("Failed to parse %s\n", config_file); return -1; diff --git a/server/plugin.c b/server/plugin.c index 52ac311..d137b6b 100644 --- a/server/plugin.c +++ b/server/plugin.c @@ -94,28 +94,14 @@ void plugin_dump(void) { plugin_list_t *p; - int x, y; + int x; - y = 0; list_for(&server_plugins, p, x) { if (p->type == PLUGIN_BACKEND) { - if (!y) { - y = 1; - printf("Available backends:\n"); - } - printf(" %s %s\n", + printf("backend: %s %s\n", p->backend->name, p->backend->version); - } - } - - y = 0; - list_for(&server_plugins, p, x) { - if (p->type == PLUGIN_LISTENER) { - if (!y) { - y = 1; - printf("Available listeners:\n"); - } - printf(" %s %s\n", + } else if (p->type == PLUGIN_LISTENER) { + printf("listener: %s %s\n", p->listener->name, p->listener->version); } }