mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virsh: re-fix help printing without connection
Re-do 0217089 so it does not add regression for commit c0726e0 that allowed to print help without making a connection to the daemon.
This commit is contained in:
parent
ed5c929777
commit
384dde557b
@ -962,14 +962,16 @@ main(int argc, char **argv)
|
|||||||
if (!vshInit(ctl, cmdGroups, NULL))
|
if (!vshInit(ctl, cmdGroups, NULL))
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
|
|
||||||
ctl->connname = vshStrdup(ctl, virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI"));
|
|
||||||
|
|
||||||
if (!virshParseArgv(ctl, argc, argv) ||
|
if (!virshParseArgv(ctl, argc, argv) ||
|
||||||
!virshInit(ctl)) {
|
!virshInit(ctl)) {
|
||||||
virshDeinit(ctl);
|
virshDeinit(ctl);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ctl->connname)
|
||||||
|
ctl->connname = vshStrdup(ctl,
|
||||||
|
virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI"));
|
||||||
|
|
||||||
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