mirror of https://github.com/ceph/go-ceph
rbd/features: add Image.UpdateFeatures()
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
20031cf70f
commit
6284986e01
|
@ -106,3 +106,20 @@ func (image *Image) GetFeatures() (features uint64, err error) {
|
|||
|
||||
return features, nil
|
||||
}
|
||||
|
||||
// UpdateFeatures updates the features on the Image.
|
||||
//
|
||||
// Implements:
|
||||
// int rbd_update_features(rbd_image_t image, uint64_t features,
|
||||
// uint8_t enabled);
|
||||
func (image *Image) UpdateFeatures(features uint64, enabled bool) error {
|
||||
if image.image == nil {
|
||||
return RbdErrorImageNotOpen
|
||||
}
|
||||
|
||||
cEnabled := C.uint8_t(0)
|
||||
if enabled {
|
||||
cEnabled = 1
|
||||
}
|
||||
return getError(C.rbd_update_features(image.image, C.uint64_t(features), cEnabled))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue