Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libs/sm/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,6 +1007,9 @@ def _setParent(self, parent):
Util.log("Failed to update %s with vhd-parent field %s" % \
(self.uuid, self.parentUuid))

def _ensureParentActiveForRelink(self):
pass

def isHidden(self):
if self._hidden is None:
self._loadInfoHidden()
Expand Down Expand Up @@ -1405,6 +1408,9 @@ def _activateChain(self):
def _deactivate(self):
self.sr.lvActivator.deactivate(self.uuid, False)

def _ensureParentActiveForRelink(self):
self.parent._activate()

def _increaseSizeVirt(self, size, atomic=True):
"ensure the virtual size of 'self' is at least 'size'"
self._activate()
Expand Down Expand Up @@ -1997,6 +2003,10 @@ def _coalesce(self, vdi):
# this means we had done the actual coalescing already and just
# need to finish relinking and/or refreshing the children
Util.log("==> Coalesce apparently already done: skipping")

# The parent volume must be active for the parent change to occur.
# The parent volume may become inactive if the host is rebooted.
vdi._ensureParentActiveForRelink()
else:
# JRN_COALESCE is used to check which VDI is being coalesced in
# order to decide whether to abort the coalesce. We remove the
Expand Down
Loading