]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Fix regression of vol-resize
authorOsier Yang <jyang@redhat.com>
Fri, 24 May 2013 03:59:14 +0000 (11:59 +0800)
committerJán Tomko <jtomko@redhat.com>
Thu, 3 Oct 2013 08:35:19 +0000 (10:35 +0200)
Introduced by commit 1daa4ba33acf. vshCommandOptStringReq returns
0 on *success* or the option is not required && not present, both
are right result. Error out when returning 0 is not correct.
the caller, it doesn't have to check wether it
(cherry picked from commit 2a3a725c33aba2046443d33eb473eb54517f61c8)

tools/virsh-volume.c

index 2a86c424d76e6be999174b495ae4a21328866cb9..dcce8353d8bbe95653e70a8a393843f6734d2e04 100644 (file)
@@ -1099,7 +1099,7 @@ cmdVolResize(vshControl *ctl, const vshCmd *cmd)
     if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
         return false;
 
-    if (vshCommandOptStringReq(ctl, cmd, "capacity", &capacityStr) <= 0)
+    if (vshCommandOptStringReq(ctl, cmd, "capacity", &capacityStr) < 0)
         goto cleanup;
     virSkipSpaces(&capacityStr);
     if (*capacityStr == '-') {