]> xenbits.xensource.com Git - libvirt.git/commitdiff
cputest: Adapt scripts to split cpu_map
authorJiri Denemark <jdenemar@redhat.com>
Thu, 21 Feb 2019 19:10:48 +0000 (20:10 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 22 Feb 2019 17:41:19 +0000 (18:41 +0100)
The tests/cputestdata/cpu-parse.sh script has been broken since the
cpu_map.xml file was split into several XMLs.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
tests/cputestdata/cpu-cpuid.py

index c45118512d0b85e8a1ec27e1f4a62a0d1a98f676..9ee83e0cd2e4fe94f4f6f325cbae51d0dc295a11 100755 (executable)
@@ -301,15 +301,13 @@ def parseFeature(data):
 
 def parseMap():
     path = os.path.dirname(sys.argv[0])
-    path = os.path.join(path, "..", "..", "src", "cpu", "cpu_map.xml")
+    path = os.path.join(path, "..", "..", "src", "cpu_map", "x86_features.xml")
     with open(path, "r") as f:
         data = xmltodict.parse(f)
 
     cpuMap = {}
-    for arch in data["cpus"]["arch"]:
-        if arch["@name"] == "x86":
-            for feature in arch["feature"]:
-                cpuMap[feature["@name"]] = parseFeature(feature["cpuid"])
+    for feature in data["cpus"]["feature"]:
+        cpuMap[feature["@name"]] = parseFeature(feature["cpuid"])
 
     return cpuMap