g_autoptr(virURI) uri = NULL;
g_autofree char *driver = NULL;
remoteDriverTransport transport;
+ int mode = REMOTE_DRIVER_MODE_AUTO;
+ const char *mode_str = NULL;
gboolean version = false;
gboolean readonly = false;
g_autofree char *sock_path = NULL;
{ NULL, '\0', 0, 0, NULL, NULL, NULL }
};
unsigned int flags;
+ size_t i;
context = g_option_context_new("URI - libvirt socket proxy");
g_option_context_set_summary(context,
if (readonly)
flags |= REMOTE_DRIVER_OPEN_RO;
+ for (i = 0; i < uri->paramsCount; i++) {
+ virURIParam *var = &uri->params[i];
+
+ if (STRCASEEQ(var->name, "mode")) {
+ mode_str = var->value;
+ continue;
+ }
+ }
+
+ if (mode_str &&
+ (mode = remoteDriverModeTypeFromString(mode_str)) < 0) {
+ g_printerr(_("%s: unknown remote mode '%s'"), argv[0], mode_str);
+ exit(EXIT_FAILURE);
+ }
+
sock_path = remoteGetUNIXSocket(transport,
- REMOTE_DRIVER_MODE_AUTO,
+ mode,
driver,
flags,
&daemon_path);