Skip to content

Commit 2ae18d2

Browse files
NambrokWescoeur
authored andcommitted
fix: do not make base copy RO for QCOW2 (#162)
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 7a70617 commit 2ae18d2

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)