From: Osier Yang Date: Fri, 24 May 2013 03:59:14 +0000 (+0800) Subject: virsh: Fix regression of vol-resize X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2a3a725c33aba2046443d33eb473eb54517f61c8;p=libvirt.git virsh: Fix regression of vol-resize 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 --- diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index a222cca62e..e16a3852ce 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -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 == '-') {