[libvirt PATCH v2 8/9] cpu_map: sync_qemu_cpu_i386: Detect features missing in libvirt

Tim Wiederhake twiederh at redhat.com
Wed Nov 18 15:24:17 UTC 2020


Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 src/cpu_map/sync_qemu_i386.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py
index 69114c5bb6..4743161b0c 100755
--- a/src/cpu_map/sync_qemu_i386.py
+++ b/src/cpu_map/sync_qemu_i386.py
@@ -5,6 +5,7 @@ import copy
 import lark
 import os
 import re
+import xml.etree.ElementTree
 
 
 def translate_vendor(name):
@@ -393,6 +394,22 @@ def main():
         with open(name, "wt") as f:
             output_model(f, model)
 
+    features = set()
+    for model in models:
+        features.update(model["features"])
+
+    try:
+        filename = os.path.join(args.outdir, "x86_features.xml")
+        dom = xml.etree.ElementTree.parse(filename)
+        known = [x.attrib["name"] for x in dom.getroot().iter("feature")]
+        unknown = [x for x in features if x not in known and x is not None]
+    except Exception as e:
+        unknown = []
+        print("warning: Unable to read libvirt x86_features.xml: {}".format(e))
+
+    for x in unknown:
+        print("warning: Feature unknown to libvirt: {}".format(x))
+
 
 if __name__ == "__main__":
     main()
-- 
2.26.2




More information about the libvir-list mailing list