[libvirt PATCH v3 06/10] cpu_map: sync_qemu_cpu_i386: Detect features missing in libvirt

Tim Wiederhake posted 10 patches 5 years, 2 months ago
[libvirt PATCH v3 06/10] cpu_map: sync_qemu_cpu_i386: Detect features missing in libvirt
Posted by Tim Wiederhake 5 years, 2 months ago
Signed-off-by: Tim Wiederhake <twiederh@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 83b21a93e5..d2a05db77c 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

Re: [libvirt PATCH v3 06/10] cpu_map: sync_qemu_cpu_i386: Detect features missing in libvirt
Posted by Jiri Denemark 5 years, 2 months ago
On Mon, Nov 23, 2020 at 15:14:29 +0100, Tim Wiederhake wrote:
> Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
> ---
>  src/cpu_map/sync_qemu_i386.py | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

I pushed the first 6 patches of this series.