]> 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>
Fri, 14 Jun 2024 07:20:25 +0000 (09:20 +0200)
commit6ef5be6bd6cf92b84fedd5958d20e79d53439968
tree893b4b6aa8c75b3030738c147caf5b953a524915
parent97252279a2cd852700f4b7931d51081f51300536
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>
(cherry picked from commit d7fd66ec9944653f3239ac82efe937efe71c4866)
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