[libvirt] [PATCH] virStorageSourceChainHasManagedPR: Check propely

Michal Privoznik posted 1 patch 4 years, 10 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/c779da87ef495a61eea8ee5587ed088a7ced21ae.1561133505.git.mprivozn@redhat.com
src/util/virstoragefile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] virStorageSourceChainHasManagedPR: Check propely
Posted by Michal Privoznik 4 years, 10 months ago
In the virStorageSourceChainHasManagedPR() function we iterate
over whole backing chain trying to determine if one of the layers
has managed PR configured. But due to a typo we in fact check the
top layer only.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Pushed under trivial rule.

 src/util/virstoragefile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 2b1c0a5b8e..f7495ab6da 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2083,7 +2083,7 @@ virStorageSourceChainHasManagedPR(virStorageSourcePtr src)
     virStorageSourcePtr n;
 
     for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
-        if (virStoragePRDefIsManaged(src->pr))
+        if (virStoragePRDefIsManaged(n->pr))
             return true;
     }
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virStorageSourceChainHasManagedPR: Check propely
Posted by Eric Blake 4 years, 10 months ago
On 6/21/19 11:11 AM, Michal Privoznik wrote:

s/propely/properly in the subject

> In the virStorageSourceChainHasManagedPR() function we iterate
> over whole backing chain trying to determine if one of the layers
> has managed PR configured. But due to a typo we in fact check the
> top layer only.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> 
> Pushed under trivial rule.

Oh well, my review is too late.

> 
>  src/util/virstoragefile.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
> index 2b1c0a5b8e..f7495ab6da 100644
> --- a/src/util/virstoragefile.c
> +++ b/src/util/virstoragefile.c
> @@ -2083,7 +2083,7 @@ virStorageSourceChainHasManagedPR(virStorageSourcePtr src)
>      virStorageSourcePtr n;
>  
>      for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) {
> -        if (virStoragePRDefIsManaged(src->pr))
> +        if (virStoragePRDefIsManaged(n->pr))
>              return true;
>      }
>  
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

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