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 <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Jiri Denemark 2024-10-21 15:41:33 +02:00
parent 19cfe21d4e
commit 3bb2c2b641

View File

@ -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: