]> 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:00:05 +0000 (10:00 +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 728bc23a9214283a91f2f0f37bcd1cb9378c3962..a9abdc1b7acec89ffd7d950aa3170dc7789e3ca5 100644 (file)
@@ -1075,7 +1075,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 == '-') {