Skip to content
Open
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
9 changes: 8 additions & 1 deletion drivers/lvhdutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def attachThin(journaler, srUuid, vdiUuid):
lock.release()


def detachThin(session, lvmCache, srUuid, vdiUuid):
def detachThinImpl(session, lvmCache, srUuid, vdiUuid):
"""Shrink the VDI to the minimal size if no one is using it"""
lvName = LV_PREFIX[vhdutil.VDI_TYPE_VHD] + vdiUuid
path = os.path.join(VG_LOCATION, VG_PREFIX + srUuid, lvName)
Expand All @@ -273,6 +273,13 @@ def detachThin(session, lvmCache, srUuid, vdiUuid):
lock.release()


def detachThin(session, lvmCache, srUuid, vdiUuid):
try:
detachThinImpl(session, lvmCache, srUuid, vdiUuid)
except Exception as e:
util.SMlog(f'Failed to detach properly VDI {vdiUuid}: {e}')


def createVHDJournalLV(lvmCache, jName, size):
"""Create a LV to hold a VHD journal"""
lvName = "%s_%s" % (JVHD_TAG, jName)
Expand Down