1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

cputest: Adapt scripts to split cpu_map

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>
This commit is contained in:
Jiri Denemark 2019-02-21 20:10:48 +01:00
parent cb6a46364b
commit 78b148c3c8

View File

@ -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