def undo(self): assert(len(self.components) > 0) name = getSnapshotOriginDevName(self.lvolid) path = getDmDevPath(name) if os.path.exists(path): dmsetup_remove(name) self.path = None
def do(self): assert(len(self.components) > 0) name = getSnapshotOriginDevName(self.lvolid) path = getDmDevPath(name) if not os.path.exists(path): c = self.components[0] command = "echo 0 %s snapshot-origin %s | dmsetup create %s" % \ (gtos(self.capacity), c.path, name) execute_retry_not_path_exist(command, path, DMSETUP_RETRY_TIMES) self.path = path
def dm_resume(lvolid): name = getSnapshotOriginDevName(lvolid) path = getDmDevPath(name) if os.path.exists(path): command = "dmsetup resume %s" % name executecommand(command)