mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
sync_qemu_models_i386: Support adding models to an empty group
When adding a new CPU vendor, we create a new empty group in src/cpu_map/index.xml and want to use the sync_qemu_models_i386.py script to add models there. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
d3888c470a
commit
21c61bee36
1 file changed
+10
-4
@@ -592,10 +592,16 @@ def update_index(outdir, models):
|
||||
continue
|
||||
|
||||
group = groups[-1]
|
||||
last = group.getchildren()[-1]
|
||||
group_indent = last.tail
|
||||
indent = f"{group_indent} "
|
||||
last.tail = indent
|
||||
children = group.getchildren()
|
||||
if children:
|
||||
last = children()[-1]
|
||||
group_indent = last.tail
|
||||
indent = f"{group_indent} "
|
||||
last.tail = indent
|
||||
else:
|
||||
group_indent = f"{group.tail} "
|
||||
indent = f"{group_indent} "
|
||||
group.text = f"{group_indent} "
|
||||
|
||||
for file in files:
|
||||
include = lxml.etree.SubElement(group, "include", filename=file)
|
||||
|
||||
Reference in new issue
Block a user