__init__.py (3325:55e7e009b618) __init__.py (3504:1d42c37f776b)
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 157 unchanged lines hidden (view full) ---

166 for i in cpuList:
167 if not isinstance(i, tuple):
168 raise RuntimeError, "List must have tuples of (oldCPU,newCPU)"
169
170 [old_cpus, new_cpus] = zip(*cpuList)
171
172 for cpu in old_cpus:
173 if not isinstance(cpu, objects.BaseCPU):
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 157 unchanged lines hidden (view full) ---

166 for i in cpuList:
167 if not isinstance(i, tuple):
168 raise RuntimeError, "List must have tuples of (oldCPU,newCPU)"
169
170 [old_cpus, new_cpus] = zip(*cpuList)
171
172 for cpu in old_cpus:
173 if not isinstance(cpu, objects.BaseCPU):
174 raise TypeError, "%s is not of type BaseCPU", cpu
174 raise TypeError, "%s is not of type BaseCPU" % cpu
175 for cpu in new_cpus:
176 if not isinstance(cpu, objects.BaseCPU):
175 for cpu in new_cpus:
176 if not isinstance(cpu, objects.BaseCPU):
177 raise TypeError, "%s is not of type BaseCPU", cpu
177 raise TypeError, "%s is not of type BaseCPU" % cpu
178
179 # Drain all of the individual CPUs
180 drain_event = cc_main.createCountedDrain()
181 unready_cpus = 0
182 for old_cpu in old_cpus:
183 unready_cpus += old_cpu.startDrain(drain_event, False)
184 # If we've got some objects that can't drain immediately, then simulate
185 if unready_cpus > 0:

--- 25 unchanged lines hidden ---
178
179 # Drain all of the individual CPUs
180 drain_event = cc_main.createCountedDrain()
181 unready_cpus = 0
182 for old_cpu in old_cpus:
183 unready_cpus += old_cpu.startDrain(drain_event, False)
184 # If we've got some objects that can't drain immediately, then simulate
185 if unready_cpus > 0:

--- 25 unchanged lines hidden ---