diff --git a/tools/virsh.c b/tools/virsh.c index 0d8ec5c80c7d6938005b56ee9bd8e043d60fc2cb..e14410bd5cfd8b71beba60f402974d684368316c 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -962,14 +962,14 @@ main(int argc, char **argv) if (!vshInit(ctl, cmdGroups, NULL)) exit(EXIT_FAILURE); + ctl->connname = vshStrdup(ctl, virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")); + if (!virshParseArgv(ctl, argc, argv) || !virshInit(ctl)) { virshDeinit(ctl); exit(EXIT_FAILURE); } - ctl->connname = vshStrdup(ctl, virGetEnvBlockSUID("VIRSH_DEFAULT_CONNECT_URI")); - if (!ctl->imode) { ret = vshCommandRun(ctl, ctl->cmd); } else {