From b2751b57c2e11361e49525a029cba0dd6629dbf1 Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Tue, 9 Sep 2008 10:41:25 +0000 Subject: [PATCH] Processor: remove ChainOpCode This function was incompatible with the new locking system, and its usage has been removed from the code. For now LUs share code by calling common module-private functions in cmdlib.py, in the future they will use tasklets (when those will be implemented). Reviewed-by: iustinp --- lib/mcpu.py | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/lib/mcpu.py b/lib/mcpu.py index 7a426aa21..b6c9ffdc5 100644 --- a/lib/mcpu.py +++ b/lib/mcpu.py @@ -191,49 +191,6 @@ class Processor(object): return result - def ChainOpCode(self, op): - """Chain and execute an opcode. - - This is used by LUs when they need to execute a child LU. - - Args: - - opcode: the opcode to be executed - - """ - if not isinstance(op, opcodes.OpCode): - raise errors.ProgrammerError("Non-opcode instance passed" - " to ExecOpcode") - - lu_class = self.DISPATCH_TABLE.get(op.__class__, None) - if lu_class is None: - raise errors.OpCodeUnknown("Unknown opcode") - - if lu_class.REQ_BGL and not self.exclusive_BGL: - raise errors.ProgrammerError("LUs which require the BGL cannot" - " be chained to granular ones.") - - assert lu_class.REQ_BGL, "ChainOpCode is still BGL-only" - - if lu_class.REQ_WSSTORE: - sstore = ssconf.WritableSimpleStore() - else: - sstore = ssconf.SimpleStore() - - #do_hooks = lu_class.HPATH is not None - lu = lu_class(self, op, self.context, sstore) - lu.CheckPrereq() - #if do_hooks: - # hm = HooksMaster(rpc.call_hooks_runner, self, lu) - # h_results = hm.RunPhase(constants.HOOKS_PHASE_PRE) - # lu.HooksCallBack(constants.HOOKS_PHASE_PRE, - # h_results, self._feedback_fn, None) - result = lu.Exec(self._feedback_fn) - #if do_hooks: - # h_results = hm.RunPhase(constants.HOOKS_PHASE_POST) - # result = lu.HooksCallBack(constants.HOOKS_PHASE_POST, - # h_results, self._feedback_fn, result) - return result - def LogStep(self, current, total, message): """Log a change in LU execution progress. -- GitLab