From: Jiri Denemark Date: Tue, 8 Oct 2024 10:26:42 +0000 (+0200) Subject: cpu-data.py: Properly handle aliases X-Git-Tag: v10.9.0-rc1~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=662e511d1e69ab2fdffa9724e881d2c8a3a1cb95;p=thirdparty%2Flibvirt.git cpu-data.py: Properly handle aliases 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 Reviewed-by: Ján Tomko --- diff --git a/tests/cputestdata/cpu-data.py b/tests/cputestdata/cpu-data.py index 37fb2e3791..b280eed436 100755 --- a/tests/cputestdata/cpu-data.py +++ b/tests/cputestdata/cpu-data.py @@ -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