def deactivateNoRefcount(self, lvName): path = self._getPath(lvName) if self.checkLV(lvName): lvutil.deactivateNoRefcount(path) self.lvs[lvName].active = False else: util.SMlog("LVMCache.deactivateNoRefcount: no LV %s" % lvName) lvutil._lvmBugCleanup(path)
def deactivateVdi(sr_uuid, vdi_uuid, vhd_path): name_space = lvhdutil.NS_PREFIX_LVM + sr_uuid lock = Lock(vdi_uuid, name_space) lock.acquire() try: count = RefCounter.put(vdi_uuid, False, name_space) if count > 0: return try: lvutil.deactivateNoRefcount(vhd_path) except Exception, e: util.SMlog(" lv de-activate failed for %s with error %s" % (vhd_path, str(e))) RefCounter.get(vdi_uuid, False, name_space) finally: lock.release()