[libvirt PATCH v3 03/10] cpu_map: sync_qemu_cpu_i386: Translate features in model versions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <twiederh@xxxxxxxxxx>
---
 src/cpu_map/sync_qemu_i386.py | 9 +++++++++
 1 file changed, 9 insertions(+)

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"]:
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux