[libvirt] [PATCH v2 for 5.3.0] storage_backend_rbd: Ignore rbd_diff_iterate error() if needed

Ján Tomko jtomko at redhat.com
Tue May 21 12:03:58 UTC 2019


On Mon, Apr 29, 2019 at 04:39:40PM +0200, Michal Privoznik wrote:
>When cloning an RBD volume we try to find a snapshot which is
>not different to the image we're trying to clone. This boils down
>to calling rbd_diff_iterate() or rbd_diff_iterate2() on systems
>with newer ceph. These two are passed a callback -
>virStorageBackendRBDIterateCb() which sets @diff to 1 and returns
>-1. The idea is to stop iterating as soon as possible (i.e. we're
>iterating over a snapshot with some deltas). Unfortunately,
>returning a negative value from the callback means that iterate()
>function fails and thus we report an error:
>
>  virsh # vol-clone --pool rbd_image_root coreos_2023 coreos00.disk
>  error: Failed to clone vol from coreos_2023
>  error: failed to iterate RBD snapshot coreos_2023 at base: Operation not
>  permitted
>
>Therefore, report an error if and only if it doesn't originates
>in the callback.
>
>Reported on libvirt-users list:
>
>https://www.redhat.com/archives/libvirt-users/2019-April/msg00060.html
>
>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
>
>diff to v1:
>- Ignore error as suggested by Jason as it allows us to exit iteration
>early.
>
> src/storage/storage_backend_rbd.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>

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

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190521/8b36aee5/attachment-0001.sig>


More information about the libvir-list mailing list