kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jiří Župka" <jzupka@redhat.com>
To: autotest@test.kernel.org, kvm@vger.kernel.org,
	kvm-autotest@redhat.com, lmr@redhat.com, ldoktor@redhat.com,
	jzupka@redhat.com
Subject: [KVM-Autotest][PATCH 2/5] virt: Add aliases to class Flag.
Date: Tue, 31 Jan 2012 15:40:14 +0100	[thread overview]
Message-ID: <1328020817-8159-3-git-send-email-jzupka@redhat.com> (raw)
In-Reply-To: <1328020817-8159-1-git-send-email-jzupka@redhat.com>

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

Signed-off-by: Jiří Župka <jzupka@redhat.com>
---
 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

_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

  parent reply	other threads:[~2012-01-31 14:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 14:40 [KVM-Autotest] Add multihost migration support to cpuflags Jiří Župka
2012-01-31 14:40 ` [KVM-Autotest][PATCH 1/5] virt: Check illegal instruction code Jiří Župka
2012-01-31 14:40 ` Jiří Župka [this message]
2012-01-31 14:40 ` [KVM-Autotest][PATCH 3/5] kvm test: Introduce multi_host.srv Jiří Župka
2012-01-31 14:40 ` [KVM-Autotest][PATCH 4/5] virt deps: Reduces memory usage of test Jiří Župka
2012-01-31 14:40 ` [KVM-Autotest][PATCH 5/5] kvm test: Add multihost migration support to cpuflag test Jiří Župka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328020817-8159-3-git-send-email-jzupka@redhat.com \
    --to=jzupka@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm-autotest@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=ldoktor@redhat.com \
    --cc=lmr@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).