summaryrefslogtreecommitdiff
path: root/src/cpu_map
diff options
context:
space:
mode:
authorTim Wiederhake <twiederh@redhat.com>2020-11-23 15:14:29 +0100
committerJiri Denemark <jdenemar@redhat.com>2020-12-07 15:09:57 +0100
commitf6c11a23c8b83525722fd122b9767f10c7de4aac (patch)
treea16c186eac3bb802565970cc8e339f95e0dbcf04 /src/cpu_map
parentd032c73f78c1f7044bb5d702f07a43cbaebcaad4 (diff)
downloadlibvirt-f6c11a23c8b83525722fd122b9767f10c7de4aac.tar.gz
cpu_map: sync_qemu_cpu_i386: Detect features missing in libvirt
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Diffstat (limited to 'src/cpu_map')
-rwxr-xr-xsrc/cpu_map/sync_qemu_i386.py17
1 files changed, 17 insertions, 0 deletions
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()