]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
add --version support to libvirtd
authorDaniel Veillard <veillard@redhat.com>
Fri, 12 Dec 2008 07:56:50 +0000 (07:56 +0000)
committerDaniel Veillard <veillard@redhat.com>
Fri, 12 Dec 2008 07:56:50 +0000 (07:56 +0000)
* qemud/qemud.c: add --version support to libvirtd, patch by
  Dave Allan
* AUTHORS: add Dave Allan
Daniel

AUTHORS
ChangeLog
qemud/qemud.c

diff --git a/AUTHORS b/AUTHORS
index 4f7dfa22aab5d24b525048dd327bbfbb472cc009..a8ec325000d45d40b4def581ed31d9608afbc074 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -57,6 +57,7 @@ Patches have also been contributed by:
   Shigeki Sakamoto     <fj0588di@aa.jp.fujitsu.com>
   Gerd von Egidy       <lists@egidy.de>
   Itamar Heim          <iheim@redhat.com>
+  Dave Allan           <dallan@redhat.com>
 
   [....send patches to get your name here....]
 
index ebd0a55d805c12d68fe40860ab97321c02bec78c..5b9a66900bacaaa4d679c06ff42fd2a82ac5d9f6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Dec 12 08:54:40 CET 2008 Daniel Veillard <veillard@redhat.com>
+
+       * 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 <veillard@redhat.com>
 
        * libvirt.spec.in: fix a conditional bug in spec file #460510,
index f35d0fdb05860fa6a25d78c68e7439d67cf75f24..b10d68022680226c50eb4eb1754067c5050cecf7 100644 (file)
@@ -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 <secs>  Exit after timeout period.\n\
   -f | --config <file>   Configuration file.\n\
+     | --version         Display version information.\n\
   -p | --pid-file <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;