]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu-data.py: Properly handle aliases
authorJiri Denemark <jdenemar@redhat.com>
Tue, 8 Oct 2024 10:26:42 +0000 (12:26 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 9 Oct 2024 12:46:51 +0000 (14:46 +0200)
The script is used to create data files for cputest from QEMU replies.
By ignoring aliases we might end up thinking a feature is not enabled by
QEMU just because its name differs from the primary one in the CPU map.

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

index 37fb2e3791cb97763d5d89480e26942fbbc3815e..b280eed43607d1d2a62de0a20759d80c2d63cf28 100755 (executable)
@@ -457,6 +457,11 @@ def parseMap():
         for reg in _KEYS[data.tag] + _REGS[data.tag]:
             feature[reg] = int(data.attrib.get(reg, "0"), 0)
         cpuMap[f.attrib["name"]] = feature
+
+        for alias in f.iterfind("alias"):
+            if alias.attrib["source"] == "qemu":
+                cpuMap[alias.attrib["name"]] = feature
+
     return cpuMap