]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd: add rbd_clone4() API to take parent snapshot by ID
authorIlya Dryomov <idryomov@gmail.com>
Fri, 24 May 2024 10:06:09 +0000 (12:06 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 13 Jun 2024 12:08:46 +0000 (14:08 +0200)
commitd7fd66ec9944653f3239ac82efe937efe71c4866
tree838d9fa71a66097eb21d73e2a48423ae04fe4dab
parent533943d08f58c5da918adf473123357f85b341d5
librbd: add rbd_clone4() API to take parent snapshot by ID

Allow cloning from non-user snapshots -- namely snapshots in group
and mirror namespaces.  The motivation is to provide a building block
for cloning new groups from group snapshots ("rbd group snap create").
Otherwise, group snapshots as they are today can be used only for
rolling back the group as a whole, which is very limiting.

While at it, there doesn't seem to be anything wrong with making it
possible to clone from mirror snapshots as well.

Snapshots in a trash namespace can't be cloned from since they are
considered to be deleted.

Cloning from non-user snapshots is limited to clone v2 just because
protecting/unprotecting is limited to snapshots in a user namespace.
This happens to simplify some invariants.

Fixes: https://tracker.ceph.com/issues/64662
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
src/include/rbd/librbd.h
src/include/rbd/librbd.hpp
src/librbd/internal.cc
src/librbd/internal.h
src/librbd/librbd.cc
src/pybind/rbd/c_rbd.pxd
src/pybind/rbd/mock_rbd.pxi
src/pybind/rbd/rbd.pyx
src/test/pybind/test_rbd.py
src/test/rbd_mirror/test_ImageDeleter.cc
src/tracing/librbd.tp