]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: add update_features to rbd.py
authorJason Dillaman <dillaman@redhat.com>
Thu, 12 Mar 2015 03:59:00 +0000 (23:59 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 6 Apr 2015 17:14:34 +0000 (13:14 -0400)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/pybind/rbd.py

index f0f58939d1189a790c5212fd1547583288966e58..239104fe6fd700f525d99bb0a263382b1b0e92a0 100644 (file)
@@ -535,6 +535,24 @@ class Image(object):
             raise make_ex(ret, 'error getting features for image' % (self.name))
         return features.value
 
+    def update_features(self, features, enabled):
+        """
+        Updates the features bitmask of the image by enabling/disabling
+        a single feature.  The feature must support the ability to be
+        dynamically enabled/disabled.
+
+        :param features: feature bitmask to enable/disable
+        :type features: int
+        :param enabled: whether to enable/disable the feature
+        :type enabled: bool
+        :raises: :class:`InvalidArgument`
+        """
+        ret = self.librbd.rbd_update_features(self.image, c_uint64(features),
+                                              c_uint8(enabled));
+        if ret != 0:
+            raise make_ex(ret, 'error updating features for image %s' %
+                               (self.name))
+
     def overlap(self):
         """
         Gets the number of overlapping bytes between the image and its parent