]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virsh: fix missing return value
authorAlex Jia <ajia@redhat.com>
Mon, 27 Aug 2012 05:58:46 +0000 (13:58 +0800)
committerAlex Jia <ajia@redhat.com>
Mon, 27 Aug 2012 06:35:38 +0000 (14:35 +0800)
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>
tools/virsh-host.c

index da6089518cd1a4fe129dbe88da9c92aac62c684e..2f3b41399b2387aa988a1fc413a2810990ab816a 100644 (file)
@@ -701,11 +701,13 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
     judge = vshCommandOptInt(cmd, "timeout", &timeout);
     if (judge < 0) {
         vshError(ctl, "%s", _("timeout number has to be a number"));
+        goto cleanup;
     } else if (judge > 0) {
         judge = 1;
     }
     if (judge && timeout < 1) {
         vshError(ctl, "%s", _("timeout must be positive"));
+        goto cleanup;
     }
 
     if (vshCommandOptBool(cmd, "async")) {
@@ -719,6 +721,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd)
 
     if (judge > 1) {
         vshError(ctl, "%s", _("timeout, async and block options are exclusive"));
+        goto cleanup;
     }
     result = virDomainQemuAgentCommand(dom, guest_agent_cmd, timeout, flags);