RBD().clone(ioctx, PARENT_IMG_NAME, 'snap1', ioctx, CLONE_IMG_NAME,
features=features)
with Image(ioctx, CLONE_IMG_NAME) as image:
+ print("enabling object map")
+ assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0)
+ image.update_features(RBD_FEATURE_OBJECT_MAP, True)
+ assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
+ assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)
+
print("acquiring exclusive lock")
offset = 0
data = os.urandom(512)
print("rename")
RBD().rename(ioctx, CLONE_IMG_NAME, CLONE_IMG_RENAME);
- assert(not image.is_exclusive_lock_owner())
with Image(ioctx, CLONE_IMG_RENAME) as image:
print("flatten")
assert(list(image.list_snaps()) == [])
print("rebuild object map")
- assert((image.features() & RBD_FEATURE_OBJECT_MAP) == 0)
- image.update_features(RBD_FEATURE_OBJECT_MAP, True)
+ assert((image.features() & RBD_FEATURE_OBJECT_MAP) != 0)
assert((image.flags() & RBD_FLAG_OBJECT_MAP_INVALID) != 0)
image.rebuild_object_map()
assert(not image.is_exclusive_lock_owner())