From: Jiri Denemark Date: Mon, 21 Oct 2024 13:41:33 +0000 (+0200) Subject: sync_qemu_models_i386: Switch to lxml X-Git-Tag: v10.10.0-rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bb2c2b641b34e621e32b906d1b8827df2469dc9;p=thirdparty%2Flibvirt.git sync_qemu_models_i386: Switch to lxml XMLs parse/format round trip using lxml results in an XML document that almost exactly matches the original (including comments). Signed-off-by: Jiri Denemark Reviewed-by: Daniel P. Berrangé --- diff --git a/src/cpu_map/sync_qemu_models_i386.py b/src/cpu_map/sync_qemu_models_i386.py index 58600bffe5..ce3c39de96 100755 --- a/src/cpu_map/sync_qemu_models_i386.py +++ b/src/cpu_map/sync_qemu_models_i386.py @@ -4,7 +4,7 @@ import argparse import copy import os import re -import xml.etree.ElementTree +import lxml.etree import lark @@ -592,7 +592,7 @@ def main(): try: filename = os.path.join(args.outdir, "x86_features.xml") - dom = xml.etree.ElementTree.parse(filename) + dom = lxml.etree.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: