mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
virsh: fix missing return value
Although virsh command raises a correct error information, the command status returns 0(true), this patch is used for fixing this issue. Signed-off-by: Alex Jia <ajia@redhat.com>
This commit is contained in:
parent
e9aaf806f1
commit
34c5ab9566
@ -701,11 +701,13 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
|
|||||||
judge = vshCommandOptInt(cmd, "timeout", &timeout);
|
judge = vshCommandOptInt(cmd, "timeout", &timeout);
|
||||||
if (judge < 0) {
|
if (judge < 0) {
|
||||||
vshError(ctl, "%s", _("timeout number has to be a number"));
|
vshError(ctl, "%s", _("timeout number has to be a number"));
|
||||||
|
goto cleanup;
|
||||||
} else if (judge > 0) {
|
} else if (judge > 0) {
|
||||||
judge = 1;
|
judge = 1;
|
||||||
}
|
}
|
||||||
if (judge && timeout < 1) {
|
if (judge && timeout < 1) {
|
||||||
vshError(ctl, "%s", _("timeout must be positive"));
|
vshError(ctl, "%s", _("timeout must be positive"));
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vshCommandOptBool(cmd, "async")) {
|
if (vshCommandOptBool(cmd, "async")) {
|
||||||
@ -719,6 +721,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
if (judge > 1) {
|
if (judge > 1) {
|
||||||
vshError(ctl, "%s", _("timeout, async and block options are exclusive"));
|
vshError(ctl, "%s", _("timeout, async and block options are exclusive"));
|
||||||
|
goto cleanup;
|
||||||
}
|
}
|
||||||
result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
|
result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user