domain.numatune: Remove cpuset_str_to_tuple
Left over from when we had vcpu pinning in the UI, not used anymore
This commit is contained in:
parent
5b2774b27a
commit
192da16f6b
|
@ -159,25 +159,6 @@ class TestXMLMisc(unittest.TestCase):
|
|||
finally:
|
||||
setattr(deviceinterface, "_default_bridge", origfunc)
|
||||
|
||||
def testCpustrToTuple(self):
|
||||
# Various testing our cpustr handling
|
||||
conn = self.conn
|
||||
base = [False] * 16
|
||||
|
||||
expect = base[:]
|
||||
expect[1] = expect[2] = expect[3] = True
|
||||
self.assertEqual(tuple(expect),
|
||||
virtinst.DomainNumatune.cpuset_str_to_tuple(conn, "1-3"))
|
||||
|
||||
expect = base[:]
|
||||
expect[1] = expect[3] = expect[5] = expect[10] = expect[11] = True
|
||||
self.assertEqual(tuple(expect),
|
||||
virtinst.DomainNumatune.cpuset_str_to_tuple(conn, "1,3,5,10-11"))
|
||||
|
||||
self.assertRaises(ValueError,
|
||||
virtinst.DomainNumatune.cpuset_str_to_tuple,
|
||||
conn, "16")
|
||||
|
||||
def testDiskNumbers(self):
|
||||
# Various testing our target generation
|
||||
self.assertEqual("a", DeviceDisk.num_to_target(1))
|
||||
|
|
|
@ -59,27 +59,6 @@ class DomainNumatune(XMLBuilder):
|
|||
raise ValueError(_("cpuset's pCPU numbers must be less "
|
||||
"than pCPUs."))
|
||||
|
||||
@staticmethod
|
||||
def cpuset_str_to_tuple(conn, cpuset):
|
||||
DomainNumatune.validate_cpuset(conn, cpuset)
|
||||
pinlist = [False] * get_phy_cpus(conn)
|
||||
|
||||
entries = cpuset.split(",")
|
||||
for e in entries:
|
||||
series = e.split("-", 1)
|
||||
|
||||
if len(series) == 1:
|
||||
pinlist[int(series[0])] = True
|
||||
continue
|
||||
|
||||
start = int(series[0])
|
||||
end = int(series[1])
|
||||
|
||||
for i in range(start, end + 1):
|
||||
pinlist[i] = True
|
||||
|
||||
return tuple(pinlist)
|
||||
|
||||
|
||||
MEMORY_MODES = ["interleave", "strict", "preferred"]
|
||||
|
||||
|
|
Loading…
Reference in New Issue