]> xenbits.xensource.com Git - 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)
committerOsier Yang <jyang@redhat.com>
Fri, 24 May 2013 08:55:39 +0000 (16:55 +0800)
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

tools/virsh-volume.c

index a222cca62eef7d51e80b5e25122c1097f6734211..e16a3852ceb559900494174cac6a7c659c35f2d8 100644 (file)
@@ -1076,7 +1076,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 == '-') {