Skip to content

Commit d2181b0

Browse files
committed
fix: do not make base copy RO for QCOW2
If we make the base copy RO, the next live coalesce could fail on the call to tapdisk commit since the chain is only made RW at the activation. Signed-off-by: Damien Thenot <damien.thenot@vates.tech>
1 parent d4068f7 commit d2181b0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/LVMSR.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,8 +1864,12 @@ def _snapshot(self, snapType, cloneOp=False, cbtlog=None, cbt_consistency=None,
18641864
util.fistpoint.activate("LVHDRT_clone_vdi_after_parent_hidden", self.sr.uuid)
18651865

18661866
# set the base copy to ReadOnly
1867-
self.sr.lvmCache.setReadonly(self.lvname, True)
1868-
util.fistpoint.activate("LVHDRT_clone_vdi_after_parent_ro", self.sr.uuid)
1867+
if not self.cowutil.isCoalesceableOnRemote():
1868+
# For QCOW2, the whole chain need to be
1869+
# writable for tapdisk to do the coalesce.
1870+
# In this case, we don't mark the base copy RO.
1871+
self.sr.lvmCache.setReadonly(self.lvname, True)
1872+
util.fistpoint.activate("LVHDRT_clone_vdi_after_parent_ro", self.sr.uuid)
18691873

18701874
if hostRefs:
18711875
self.sr._updateSlavesOnClone(hostRefs, origOldLV,

0 commit comments

Comments
 (0)