Blame SOURCES/virt-manager-domain.numatune-Remove-cpuset_str_to_tuple.patch

3d61c0
From 65fb5f48b9d52f3ea3d6789e524f50baf943c4d0 Mon Sep 17 00:00:00 2001
3d61c0
Message-Id: <65fb5f48b9d52f3ea3d6789e524f50baf943c4d0@dist-git>
3d61c0
From: Pavel Hrdina <phrdina@redhat.com>
3d61c0
Date: Mon, 4 Jun 2018 14:20:58 -0400
3d61c0
Subject: [PATCH] domain.numatune: Remove cpuset_str_to_tuple
3d61c0
3d61c0
From: Cole Robinson <crobinso@redhat.com>
3d61c0
3d61c0
Left over from when we had vcpu pinning in the UI, not used anymore
3d61c0
3d61c0
(cherry picked from commit 192da16f6bceae6734969d37b21d8bfef6d413fd)
3d61c0
3d61c0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1566818
3d61c0
3d61c0
Reviewed-by: Cole Robinson <crobinso@redhat.com>
3d61c0
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
3d61c0
---
3d61c0
 tests/xmlconfig.py         | 19 -------------------
3d61c0
 virtinst/domainnumatune.py | 21 ---------------------
3d61c0
 2 files changed, 40 deletions(-)
3d61c0
3d61c0
diff --git a/tests/xmlconfig.py b/tests/xmlconfig.py
3d61c0
index e55b1e51..ef835b87 100644
3d61c0
--- a/tests/xmlconfig.py
3d61c0
+++ b/tests/xmlconfig.py
3d61c0
@@ -166,25 +166,6 @@ class TestXMLMisc(unittest.TestCase):
3d61c0
         finally:
3d61c0
             setattr(deviceinterface, "_default_bridge", origfunc)
3d61c0
 
3d61c0
-    def testCpustrToTuple(self):
3d61c0
-        # Various testing our cpustr handling
3d61c0
-        conn = _default_conn
3d61c0
-        base = [False] * 16
3d61c0
-
3d61c0
-        expect = base[:]
3d61c0
-        expect[1] = expect[2] = expect[3] = True
3d61c0
-        self.assertEqual(tuple(expect),
3d61c0
-            virtinst.DomainNumatune.cpuset_str_to_tuple(conn, "1-3"))
3d61c0
-
3d61c0
-        expect = base[:]
3d61c0
-        expect[1] = expect[3] = expect[5] = expect[10] = expect[11] = True
3d61c0
-        self.assertEqual(tuple(expect),
3d61c0
-            virtinst.DomainNumatune.cpuset_str_to_tuple(conn, "1,3,5,10-11"))
3d61c0
-
3d61c0
-        self.assertRaises(ValueError,
3d61c0
-            virtinst.DomainNumatune.cpuset_str_to_tuple,
3d61c0
-            conn, "16")
3d61c0
-
3d61c0
     def testDiskNumbers(self):
3d61c0
         # Various testing our target generation
3d61c0
         self.assertEqual("a", VirtualDisk.num_to_target(1))
3d61c0
diff --git a/virtinst/domainnumatune.py b/virtinst/domainnumatune.py
3d61c0
index dbacc6cc..9788c9d4 100644
3d61c0
--- a/virtinst/domainnumatune.py
3d61c0
+++ b/virtinst/domainnumatune.py
3d61c0
@@ -71,27 +71,6 @@ class DomainNumatune(XMLBuilder):
3d61c0
                     raise ValueError(_("cpuset's pCPU numbers must be less "
3d61c0
                                        "than pCPUs."))
3d61c0
 
3d61c0
-    @staticmethod
3d61c0
-    def cpuset_str_to_tuple(conn, cpuset):
3d61c0
-        DomainNumatune.validate_cpuset(conn, cpuset)
3d61c0
-        pinlist = [False] * get_phy_cpus(conn)
3d61c0
-
3d61c0
-        entries = cpuset.split(",")
3d61c0
-        for e in entries:
3d61c0
-            series = e.split("-", 1)
3d61c0
-
3d61c0
-            if len(series) == 1:
3d61c0
-                pinlist[int(series[0])] = True
3d61c0
-                continue
3d61c0
-
3d61c0
-            start = int(series[0])
3d61c0
-            end = int(series[1])
3d61c0
-
3d61c0
-            for i in range(start, end + 1):
3d61c0
-                pinlist[i] = True
3d61c0
-
3d61c0
-        return tuple(pinlist)
3d61c0
-
3d61c0
 
3d61c0
     MEMORY_MODES = ["interleave", "strict", "preferred"]
3d61c0
 
3d61c0
-- 
3d61c0
2.20.1
3d61c0