From 39c2a806038d52971a7abba3bf38576644ebdf3c Mon Sep 17 00:00:00 2001 From: Ricardo Dias Date: Tue, 27 Mar 2018 13:41:26 +0100 Subject: [PATCH] pybind/rbd: add `data_pool_id()` image function Fixes: http://tracker.ceph.com/issues/23609 Signed-off-by: Ricardo Dias (cherry picked from commit e127ec64b4fe900ec044521b130f7b83afd2161b) --- src/pybind/rbd/rbd.pyx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index 5fd8e63ce50..4829c96bf39 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -233,6 +233,7 @@ cdef extern from "rbd/librbd.h" nogil: int rbd_get_id(rbd_image_t image, char *id, size_t id_len) int rbd_get_block_name_prefix(rbd_image_t image, char *prefix, size_t prefix_len) + int64_t rbd_get_data_pool_id(rbd_image_t image) int rbd_get_parent_info2(rbd_image_t image, char *parent_poolname, size_t ppoolnamelen, char *parent_name, size_t pnamelen, @@ -1553,6 +1554,14 @@ cdef class Image(object): finally: free(prefix) + def data_pool_id(self): + """ + Get the pool id of the pool where the data of this RBD image is stored. + + :returns: int - the pool id + """ + return rbd_get_data_pool_id(self.image) + def parent_info(self): """ Get information about a cloned image's parent (if any) -- 2.47.3