char *socket_dir = NULL;
char *guests_file = NULL;
+char *libvirt_uri = NULL;
+int libvirt_uri_set_on_cmdline = 0;
+
int verbose = 0;
int verbose_set_on_cmdline = 0;
int foreground = 0;
" --help Display full usage\n"
" -c file | --config file\n"
" Configuration file (default: %s)\n"
+ " -C uri | --connect uri\n"
+ " Set libvirt connection URI (default: NULL)\n"
" -f | --foreground\n"
" Run in the foreground (don't fork)\n"
" -v Enable verbose messages (sent to syslog)\n",
{
static const apr_getopt_option_t options[] = {
{ "config", 'c', TRUE, "configuration file" },
+ { "connect", 'C', TRUE, "libvirt connection URI" },
{ "foreground", 'f', FALSE, "run in foreground (don't fork)" },
{ "verbose", 'v', FALSE, "enable verbose messages" },
{ "help", '?', FALSE, "display help" },
exit (1);
}
break;
+ case 'C':
+ libvirt_uri = optarg;
+ libvirt_uri_set_on_cmdline = 1;
+ break;
case 'f':
foreground = 1;
foreground_set_on_cmdline = 1;
/* Read the config file. */
read_main_conf_file ();
+ /* Connect to libvirt. */
+ init_libvirt ();
+
/* Monitor the socket directory. */
monitor_socket_dir ();
hval->sock = sock;
hval->request_max = 4096;
hval->request = apr_palloc (hval->pool, hval->request_max);
+ hval->lasttime = apr_hash_make (hval->pool);
/* Convert Unix fd into APR socket type. */
r = apr_os_sock_put (&hval->aprsock, &sock, hval->pool);
}
/* Difference between two timespec structures (r = a - b) */
-static struct timespec *
+struct timespec *
diff_timespec (struct timespec *r,
const struct timespec *a, const struct timespec *b)
{