mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virsh: do timing even for unusable connections
Time values were uninitialized if the connection wasn't usable.
This commit is contained in:
parent
dc04b2a737
commit
8b235d4057
@ -1562,20 +1562,20 @@ vshCommandRun(vshControl *ctl, const vshCmd *cmd)
|
||||
!(cmd->def->flags & VSH_CMD_FLAG_NOCONNECT))
|
||||
vshReconnect(ctl);
|
||||
|
||||
if (enable_timing)
|
||||
GETTIMEOFDAY(&before);
|
||||
|
||||
if ((cmd->def->flags & VSH_CMD_FLAG_NOCONNECT) ||
|
||||
vshConnectionUsability(ctl, ctl->conn)) {
|
||||
if (enable_timing)
|
||||
GETTIMEOFDAY(&before);
|
||||
|
||||
ret = cmd->def->handler(ctl, cmd);
|
||||
|
||||
if (enable_timing)
|
||||
GETTIMEOFDAY(&after);
|
||||
} else {
|
||||
/* connection is not usable, return error */
|
||||
ret = false;
|
||||
}
|
||||
|
||||
if (enable_timing)
|
||||
GETTIMEOFDAY(&after);
|
||||
|
||||
/* try to automatically catch disconnections */
|
||||
if (!ret &&
|
||||
((last_error != NULL) &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user