diff --git a/AUTHORS b/AUTHORS index 4f7dfa22aa..a8ec325000 100644 --- a/AUTHORS +++ b/AUTHORS @@ -57,6 +57,7 @@ Patches have also been contributed by: Shigeki Sakamoto Gerd von Egidy Itamar Heim + Dave Allan [....send patches to get your name here....] diff --git a/ChangeLog b/ChangeLog index ebd0a55d80..5b9a66900b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Dec 12 08:54:40 CET 2008 Daniel Veillard + + * qemud/qemud.c: add --version support to libvirtd, patch by + Dave Allan + * AUTHORS: add Dave Allan + Fri Dec 12 08:34:47 CET 2008 Daniel Veillard * libvirt.spec.in: fix a conditional bug in spec file #460510, diff --git a/qemud/qemud.c b/qemud/qemud.c index f35d0fdb05..b10d680226 100644 --- a/qemud/qemud.c +++ b/qemud/qemud.c @@ -2272,6 +2272,13 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) return -1; } +/* Display version information. */ +static void +version (const char *argv0) +{ + printf ("%s (%s) %s\n", argv0, PACKAGE_NAME, PACKAGE_VERSION); +} + /* Print command-line usage. */ static void usage (const char *argv0) @@ -2287,6 +2294,7 @@ Options:\n\ -l | --listen Listen for TCP/IP connections.\n\ -t | --timeout Exit after timeout period.\n\ -f | --config Configuration file.\n\ + | --version Display version information.\n\ -p | --pid-file Change name of PID file.\n\ \n\ libvirt management daemon:\n\ @@ -2317,6 +2325,10 @@ libvirt management daemon:\n\ : "(disabled in ./configure)"); } +enum { + OPT_VERSION = 129 +}; + #define MAX_LISTEN 5 int main(int argc, char **argv) { struct qemud_server *server = NULL; @@ -2333,6 +2345,7 @@ int main(int argc, char **argv) { { "config", required_argument, NULL, 'f'}, { "timeout", required_argument, NULL, 't'}, { "pid-file", required_argument, NULL, 'p'}, + { "version", no_argument, NULL, OPT_VERSION }, { "help", no_argument, NULL, '?' }, {0, 0, 0, 0} }; @@ -2378,6 +2391,10 @@ int main(int argc, char **argv) { remote_config_file = optarg; break; + case OPT_VERSION: + version (argv[0]); + return 0; + case '?': usage (argv[0]); return 2;