diff --git a/drivers/XE_SR_ERRORCODES.xml b/drivers/XE_SR_ERRORCODES.xml index ca4e3bc2..bfd97727 100755 --- a/drivers/XE_SR_ERRORCODES.xml +++ b/drivers/XE_SR_ERRORCODES.xml @@ -94,16 +94,16 @@ Invalid local path 226 - - ISOInvalidSMBversion - Given SMB version is not allowed. Choose either 1.0 or 3.0 - 227 - - - ISOInvalidXeMountOptions - Require "-o" along with xe-mount-isosr - 228 - + + ISOInvalidSMBversion + Given SMB version is not allowed. Choose either 1.0 or 3.0 + 227 + + + ISOInvalidXeMountOptions + Require "-o" along with xe-mount-isosr + 228 + @@ -752,6 +752,11 @@ An active FIST point was reached that causes the process to exit abnormally 203 + + LeafGCSkip + Gave up on leaf coalesce after leaf grew bigger than startbefore snapshot taken + 204 + XMLParse @@ -859,12 +864,12 @@ Failed to calculate changed blocks for given VDIs. 460 - + GenericException SM has thrown a generic python exception 1200 - + diff --git a/drivers/cleanup.py b/drivers/cleanup.py index c6787d99..b89154de 100755 --- a/drivers/cleanup.py +++ b/drivers/cleanup.py @@ -41,6 +41,7 @@ import fjournaler import lock import blktap2 +import xs_errors from refcounter import RefCounter from ipc import IPCFlag from lvmanager import LVActivator @@ -1587,14 +1588,13 @@ def coalesceLeaf(self, vdi, dryRun): vdi = self.getVDI(uuid) if vdi: vdi.delConfig(vdi.DB_LEAFCLSC) + except AbortException: + self.cleanup() + raise except (util.SMException, XenAPI.Failure), e: - if isinstance(e, AbortException): - self.cleanup() - raise - else: - self._failedCoalesceTargets.append(vdi) - Util.logException("leaf-coalesce") - Util.log("Leaf-coalesce failed, skipping") + self._failedCoalesceTargets.append(vdi) + Util.logException("leaf-coalesce") + Util.log("Leaf-coalesce failed on %s, skipping" % vdi) self.cleanup() def garbageCollect(self, dryRun = False): @@ -1786,7 +1786,7 @@ def _coalesceLeaf(self, vdi): "current %s. Abandoning attempts" % (prevSizeVHD, vdi.getSizeVHD())) vdi.setConfig(vdi.DB_LEAFCLSC, vdi.LEAFCLSC_OFFLINE) - return False + raise xs_errors.XenError('LeafGCSkip', opterr='VDI=%s' % vdi) return self._liveLeafCoalesce(vdi) def _snapshotCoalesce(self, vdi):