add --version support to libvirtd

* qemud/qemud.c: add --version support to libvirtd, patch by
  Dave Allan
* AUTHORS: add Dave Allan
Daniel
This commit is contained in:
Daniel Veillard 2008-12-12 07:56:50 +00:00
parent 5257bac05a
commit f998f82598
3 changed files with 24 additions and 0 deletions

View File

@ -57,6 +57,7 @@ Patches have also been contributed by:
Shigeki Sakamoto <fj0588di@aa.jp.fujitsu.com> Shigeki Sakamoto <fj0588di@aa.jp.fujitsu.com>
Gerd von Egidy <lists@egidy.de> Gerd von Egidy <lists@egidy.de>
Itamar Heim <iheim@redhat.com> Itamar Heim <iheim@redhat.com>
Dave Allan <dallan@redhat.com>
[....send patches to get your name here....] [....send patches to get your name here....]

View File

@ -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> Fri Dec 12 08:34:47 CET 2008 Daniel Veillard <veillard@redhat.com>
* libvirt.spec.in: fix a conditional bug in spec file #460510, * libvirt.spec.in: fix a conditional bug in spec file #460510,

View File

@ -2272,6 +2272,13 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename)
return -1; 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. */ /* Print command-line usage. */
static void static void
usage (const char *argv0) usage (const char *argv0)
@ -2287,6 +2294,7 @@ Options:\n\
-l | --listen Listen for TCP/IP connections.\n\ -l | --listen Listen for TCP/IP connections.\n\
-t | --timeout <secs> Exit after timeout period.\n\ -t | --timeout <secs> Exit after timeout period.\n\
-f | --config <file> Configuration file.\n\ -f | --config <file> Configuration file.\n\
| --version Display version information.\n\
-p | --pid-file <file> Change name of PID file.\n\ -p | --pid-file <file> Change name of PID file.\n\
\n\ \n\
libvirt management daemon:\n\ libvirt management daemon:\n\
@ -2317,6 +2325,10 @@ libvirt management daemon:\n\
: "(disabled in ./configure)"); : "(disabled in ./configure)");
} }
enum {
OPT_VERSION = 129
};
#define MAX_LISTEN 5 #define MAX_LISTEN 5
int main(int argc, char **argv) { int main(int argc, char **argv) {
struct qemud_server *server = NULL; struct qemud_server *server = NULL;
@ -2333,6 +2345,7 @@ int main(int argc, char **argv) {
{ "config", required_argument, NULL, 'f'}, { "config", required_argument, NULL, 'f'},
{ "timeout", required_argument, NULL, 't'}, { "timeout", required_argument, NULL, 't'},
{ "pid-file", required_argument, NULL, 'p'}, { "pid-file", required_argument, NULL, 'p'},
{ "version", no_argument, NULL, OPT_VERSION },
{ "help", no_argument, NULL, '?' }, { "help", no_argument, NULL, '?' },
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
@ -2378,6 +2391,10 @@ int main(int argc, char **argv) {
remote_config_file = optarg; remote_config_file = optarg;
break; break;
case OPT_VERSION:
version (argv[0]);
return 0;
case '?': case '?':
usage (argv[0]); usage (argv[0]);
return 2; return 2;