diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 5276052c519..b69046b9022 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -2627,6 +2627,15 @@ remove_mirroring_image: int metadata_set(ImageCtx *ictx, const string &key, const string &value) { CephContext *cct = ictx->cct; + string start = ictx->METADATA_CONF_PREFIX; + size_t conf_prefix_len = start.size(); + + if(key.size() > conf_prefix_len && !key.compare(0,conf_prefix_len,start)) { + string subkey = key.substr(conf_prefix_len, key.size()-conf_prefix_len); + int r = cct->_conf->set_val(subkey.c_str(), value); + if (r < 0) + return r; + } ldout(cct, 20) << "metadata_set " << ictx << " key=" << key << " value=" << value << dendl; int r = ictx->state->refresh_if_required();