[libvirt] [PATCH] virsh: fix return value in storage vol name completor

Daniel P. Berrangé posted 1 patch 5 years, 2 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190211142230.2143-1-berrange@redhat.com
tools/virsh-completer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] virsh: fix return value in storage vol name completor
Posted by Daniel P. Berrangé 5 years, 2 months ago
The function must return a pointer, not a boolean. Fortunately 'false'
is equivalent to 'NULL' so this bug no had ill effect previously.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 tools/virsh-completer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/virsh-completer.c b/tools/virsh-completer.c
index e62226fc13..7c68e2e832 100644
--- a/tools/virsh-completer.c
+++ b/tools/virsh-completer.c
@@ -287,7 +287,7 @@ virshStorageVolNameCompleter(vshControl *ctl,
         return NULL;
 
     if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL)))
-        return false;
+        return NULL;
 
     if ((nvols = virStoragePoolListAllVolumes(pool, &vols, flags)) < 0)
         goto error;
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virsh: fix return value in storage vol name completor
Posted by Ján Tomko 5 years, 2 months ago
s/completor/completer/ in the commit summary

On Mon, Feb 11, 2019 at 02:22:30PM +0000, Daniel P. Berrangé wrote:
>The function must return a pointer, not a boolean. Fortunately 'false'
>is equivalent to 'NULL' so this bug no had ill effect previously.
>
>Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>---
> tools/virsh-completer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list