From: Jiri Denemark Date: Wed, 5 Nov 2025 14:49:22 +0000 (+0100) Subject: sync_qemu_models_i386: Print current model for unknown features X-Git-Tag: CVE-2025-12748~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b74b452f8ab9e76e8378e32a809dcc52455b26b4;p=thirdparty%2Flibvirt.git sync_qemu_models_i386: Print current model for unknown features This way one can just grep for all warnings in the script output and still be able to see for which CPU model is defined using features the script doesn't know about. Signed-off-by: Jiri Denemark Reviewed-by: Michal Privoznik --- diff --git a/src/cpu_map/sync_qemu_models_i386.py b/src/cpu_map/sync_qemu_models_i386.py index a6f1da5eda..37abe6289a 100755 --- a/src/cpu_map/sync_qemu_models_i386.py +++ b/src/cpu_map/sync_qemu_models_i386.py @@ -23,7 +23,7 @@ def translate_vendor(name): return name -def translate_feature(name): +def translate_feature(name, model): T = { "CPUID_6_EAX_ARAT": "arat", "CPUID_7_0_EBX_ADX": "adx", @@ -325,7 +325,7 @@ def translate_feature(name): if name.replace("-", "_") == v.replace("-", "_"): return v - print(f"warning: Unknown feature '{name}'") + print(f"warning: Unknown feature '{name}' in model '{model}'") return name @@ -480,7 +480,7 @@ def expand_model(outdir, model): for k in [k for k in model if k.startswith(".features")]: v = model.pop(k) for feature in v.split(): - translated = translate_feature(feature) + translated = translate_feature(feature, result["name"]) if translated: result["features"].add(translated) @@ -513,7 +513,7 @@ def expand_model(outdir, model): props = version.pop(".props", dict()) for k, v in props: if k not in ("model-id", "stepping", "model"): - k = translate_feature(k) + k = translate_feature(k, result["name"]) if k is None: continue