From: Jason Dillaman Date: Thu, 12 Mar 2015 03:59:00 +0000 (-0400) Subject: pybind: add update_features to rbd.py X-Git-Tag: v9.0.0~37^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=82affca7273dd97f2a2fe6da07a9725d2a6f4e92;p=ceph.git pybind: add update_features to rbd.py Signed-off-by: Jason Dillaman --- diff --git a/src/pybind/rbd.py b/src/pybind/rbd.py index f0f58939d118..239104fe6fd7 100644 --- a/src/pybind/rbd.py +++ b/src/pybind/rbd.py @@ -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