Skip to content

Commit

Permalink
refactor(cleanup.py): rename "*coalesceVHD" helpers to "*coalesceCowI…
Browse files Browse the repository at this point in the history
…mage"

Signed-off-by: Ronan Abhamon <[email protected]>
  • Loading branch information
Wescoeur committed Jan 8, 2025
1 parent afe4d39 commit 8f5dd01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ def _doCoalesce(self) -> None:
self.parent.validate(True)
self.parent._increaseSizeVirt(self.sizeVirt)
self.sr._updateSlavesOnResize(self.parent)
self._coalesceVHD(0)
self._coalesceCowImage(0)
self.parent.validate(True)
#self._verifyContents(0)
self.parent.updateBlockInfo()
Expand Down Expand Up @@ -898,7 +898,7 @@ def coalesce(self) -> int:
return vhdutil.coalesce(self.path) * 512

@staticmethod
def _doCoalesceVHD(vdi):
def _doCoalesceCowImage(vdi):
try:
startTime = time.time()
allocated_size = vdi.getAllocatedSize()
Expand All @@ -925,14 +925,14 @@ def _vdi_is_raw(self, vdi_path):
uuid = self.extractUuid(vdi_path)
return self.sr.vdis[uuid].vdi_type == VdiType.RAW

def _coalesceVHD(self, timeOut):
def _coalesceCowImage(self, timeOut):
Util.log(" Running VHD coalesce on %s" % self)
abortTest = lambda: IPCFlag(self.sr.uuid).test(FLAG_TYPE_ABORT)
try:
util.fistpoint.activate_custom_fn(
"cleanup_coalesceVHD_inject_failure",
util.inject_failure)
Util.runAbortable(lambda: VDI._doCoalesceVHD(self), None,
Util.runAbortable(lambda: VDI._doCoalesceCowImage(self), None,
self.sr.uuid, abortTest, VDI.POLL_INTERVAL, timeOut)
except:
#exception at this phase could indicate a failure in vhd coalesce
Expand Down Expand Up @@ -2522,7 +2522,7 @@ def _doCoalesceLeaf(self, vdi):
if vdi.getConfig(vdi.DB_LEAFCLSC) == vdi.LEAFCLSC_FORCE:
Util.log("Leaf-coalesce forced, will not use timeout")
timeout = 0
vdi._coalesceVHD(timeout)
vdi._coalesceCowImage(timeout)
util.fistpoint.activate("LVHDRT_coaleaf_after_coalesce", self.uuid)
vdi.parent.validate(True)
#vdi._verifyContents(timeout / 2)
Expand Down

0 comments on commit 8f5dd01

Please sign in to comment.