From 729bd0a37adbb20472500ab090c99ac684697fa0 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Fri, 24 May 2013 11:59:14 +0800 Subject: [PATCH] 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) --- tools/virsh-volume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 728bc23..a9abdc1 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 == '-') {