From: Osier Yang Date: Fri, 24 May 2013 03:59:14 +0000 (+0800) Subject: virsh: Fix regression of vol-resize X-Git-Tag: v1.0.5.7~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=729bd0a37adbb20472500ab090c99ac684697fa0;p=thirdparty%2Flibvirt.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 (cherry picked from commit 2a3a725c33aba2046443d33eb473eb54517f61c8) --- diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 728bc23a92..a9abdc1b7a 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -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 == '-') {