'Enable replication for a volume.
Returns required volume update.'

def _enable_replication(self, volume):

    vol_name = utils.convert_str(volume.name)
    with RBDVolumeProxy(self, vol_name) as image:
        had_exclusive_lock = (image.features() & self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK)
        had_journaling = (image.features() & self.rbd.RBD_FEATURE_JOURNALING)
        if (not had_exclusive_lock):
            image.update_features(self.rbd.RBD_FEATURE_EXCLUSIVE_LOCK, True)
        if (not had_journaling):
            image.update_features(self.rbd.RBD_FEATURE_JOURNALING, True)
        image.mirror_image_enable()
    driver_data = self._dumps({'had_journaling': bool(had_journaling), 'had_exclusive_lock': bool(had_exclusive_lock)})
    return {'replication_status': fields.ReplicationStatus.ENABLED, 'replication_driver_data': driver_data}
