mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
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. (cherry picked from commit c0726e0708762e571a7883cb0558cfec32459669)
This commit is contained in:
parent
849d1d7f75
commit
c38669e15b
@ -968,9 +968,6 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
virFileActivateDirOverride(argv[0]);
|
virFileActivateDirOverride(argv[0]);
|
||||||
|
|
||||||
if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
|
|
||||||
ctl->connname = vshStrdup(ctl, defaultConn);
|
|
||||||
|
|
||||||
if (!vshInit(ctl, cmdGroups, NULL))
|
if (!vshInit(ctl, cmdGroups, NULL))
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
@ -980,6 +977,9 @@ main(int argc, char **argv)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((defaultConn = virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")))
|
||||||
|
ctl->connname = vshStrdup(ctl, defaultConn);
|
||||||
|
|
||||||
if (!ctl->imode) {
|
if (!ctl->imode) {
|
||||||
ret = vshCommandRun(ctl, ctl->cmd);
|
ret = vshCommandRun(ctl, ctl->cmd);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user