]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/rbd: add `data_pool_id()` image function
authorRicardo Dias <rdias@suse.com>
Tue, 27 Mar 2018 12:41:26 +0000 (13:41 +0100)
committerRicardo Dias <rdias@suse.com>
Mon, 9 Apr 2018 14:55:32 +0000 (15:55 +0100)
Fixes: http://tracker.ceph.com/issues/23609
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/pybind/rbd/rbd.pyx

index ce120fae2307ca7ae12d0d702f210e7a4d7a9549..669b45d0e1b4f3a68a1a3da9accba6afb0f105a6 100644 (file)
@@ -291,6 +291,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,
@@ -1995,6 +1996,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)