Re: [PATCH] storage_backend_rbd: continue searching when failing in rbd_diff_iterate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 09/05/2016 11:45 PM, Chen Hanxiao wrote:
> From: Chen Hanxiao <chenhanxiao@xxxxxxxxx>
> 
> We try to find a snapshot that had no different between
> the current state of RBD image.
> If we failed in rbd_diff_iterate, just continue for the
> next search iteration.
> 
> Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxx>
> ---
>  src/storage/storage_backend_rbd.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 

Do you have an example where failing in rbd_diff_iterate[2] should be
allowed to continue?

AFAICT the code is designed to use the 'diff' variable to determine if
two "objects" are different. If they aren't, then next one is attempted.

If rbd_diff_iterate[2] returns a failure code, then something else is
wrong and the message displayed.

If you're seeing something different, then perhaps there's a bug in
rbd_diff_iterate[2]

John
> diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
> index 4dd4b24..2756c83 100644
> --- a/src/storage/storage_backend_rbd.c
> +++ b/src/storage/storage_backend_rbd.c
> @@ -831,9 +831,10 @@ virStorageBackendRBDSnapshotFindNoDiff(rbd_image_t image,
>  #endif
>  
>          if (r < 0) {
> -            virReportSystemError(-r, _("failed to iterate RBD snapshot %s@%s"),
> -                                 imgname, snaps[i].name);
> -            goto cleanup;
> +            VIR_DEBUG("failed to iterate RBD snapshot %s@%s,"
> +                      " rbd_diff return %d",
> +                      imgname, snaps[i].name, r);
> +            continue;
>          }
>  
>          /* If diff is still set to zero we found a snapshot without deltas */
> 

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]