From: Tim Wiederhake Date: Mon, 23 Nov 2020 14:14:26 +0000 (+0100) Subject: cpu_map: sync_qemu_cpu_i386: Translate features in model versions X-Git-Tag: v7.0.0-rc1~284 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4644a17d76b5e5d81f2504df3e5416203efc839d;p=thirdparty%2Flibvirt.git cpu_map: sync_qemu_cpu_i386: Translate features in model versions If a feature is added (or removed) in a QEMU CPU model version, we get to see the QEMU pretty name for the feature, not the name of the macro. Signed-off-by: Tim Wiederhake Reviewed-by: Jiri Denemark --- diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py index 53b27773e4..93630f1a55 100755 --- a/src/cpu_map/sync_qemu_i386.py +++ b/src/cpu_map/sync_qemu_i386.py @@ -164,6 +164,10 @@ def translate_feature(name): if name in T: return T[name] + for v in T.values(): + if name.replace("-", "_") == v.replace("-", "_"): + return v + print("warning: Unknown feature '{}'".format(name)) return name @@ -308,6 +312,11 @@ def expand_model(model): props = version.pop(".props", dict()) for k, v in props: + if k not in ("model-id", "stepping", "model"): + k = translate_feature(k) + if k is None: + continue + if v == "on": result["features"].add(k) elif v == "off" and k in result["features"]: