[KVM-Autotest][PATCH 2/5] virt: Add aliases to class Flag.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch solve problem with doubled  name of cpuflags
sse4_1, sse4.1 etc. in cpuflag test.

Signed-off-by: Jiří Župka <jzupka@xxxxxxxxxx>
---
 client/virt/virt_utils.py |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/client/virt/virt_utils.py b/client/virt/virt_utils.py
index a367ffe..20ed4ba 100644
--- a/client/virt/virt_utils.py
+++ b/client/virt/virt_utils.py
@@ -1294,8 +1294,12 @@ class Flag(str):
     """
     Class for easy merge cpuflags.
     """
-    def __init__(self,  *args, **kwargs):
-        super(Flag, self).__init__( *args, **kwargs)
+    aliases = {}
+
+    def __new__(cls, flag):
+        if flag in Flag.aliases:
+            flag = Flag.aliases[flag]
+        return str.__new__(cls, flag)
 
     def __eq__(self, other):
         s = set(self.split("|"))
@@ -1324,6 +1328,12 @@ kvm_map_flags_to_test = {
             }
 
 
+kvm_map_flags_aliases = {
+            'sse4.1'              :'sse4_1',
+            'sse4.2'              :'sse4_2',
+            }
+
+
 def kvm_flags_to_stresstests(flags):
     """
     Covert [cpu flags] to [tests]
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux