Skip to content

Commit cc05767

Browse files
committed
fix: leaf would not be paused for undo with QCOW2 (#162)
Because of QCOW2 live leaf coalesce, we could have a leaf not being paused `_updateSlavesOnUndoLeafCoalesce` will do refresh on the slave and fail. `ensurePaused` allow us to be in the expected state. Signed-off-by: Damien Thenot <damien.thenot@vates.tech>
1 parent 6afa0f4 commit cc05767

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/cleanup.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,10 @@ def delConfig(self, key):
606606
self.sr.xapi.removeFromConfigVDI(self, key)
607607
Util.log("Removed %s from %s" % (key, self))
608608

609+
def ensurePaused(self):
610+
if not self.getConfig(self.DB_VDI_PAUSED) == "true":
611+
self.pause(failfast=True)
612+
609613
def ensureUnpaused(self):
610614
if self.getConfig(self.DB_VDI_PAUSED) == "true":
611615
Util.log("Unpausing VDI %s" % self)
@@ -3509,6 +3513,7 @@ def _undoInterruptedCoalesceLeaf(self, childUuid, parentUuid):
35093513
parent._setHidden(True)
35103514
if not parent.lvReadonly:
35113515
self.lvmCache.setReadonly(parent.fileName, True)
3516+
child.ensurePaused()
35123517
self._updateSlavesOnUndoLeafCoalesce(parent, child)
35133518
util.fistpoint.activate("LVHDRT_coaleaf_undo_end", self.uuid)
35143519
Util.log("*** leaf-coalesce undo successful")

0 commit comments

Comments
 (0)