Postpone filling out the default connection in ctl->connname
after calling virshInit.
This allows printing help without a connection to the daemon.
virFileActivateDirOverride(argv[0]);
- if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
- ctl->connname = vshStrdup(ctl, defaultConn);
-
if (!vshInit(ctl, cmdGroups, NULL))
exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
}
+ if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
+ ctl->connname = vshStrdup(ctl, defaultConn);
+
if (!ctl->imode) {
ret = vshCommandRun(ctl, ctl->cmd);
} else {