提交 c0726e07 编写于 作者: J Ján Tomko

virsh: read default connection uri from env later

Postpone filling out the default connection in ctl->connname
after calling virshInit.

This allows printing help without a connection to the daemon.
上级 ec37cf54
......@@ -968,9 +968,6 @@ main(int argc, char **argv)
virFileActivateDirOverride(argv[0]);
if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
ctl->connname = vshStrdup(ctl, defaultConn);
if (!vshInit(ctl, cmdGroups, NULL))
exit(EXIT_FAILURE);
......@@ -980,6 +977,9 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}
if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
ctl->connname = vshStrdup(ctl, defaultConn);
if (!ctl->imode) {
ret = vshCommandRun(ctl, ctl->cmd);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册