]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virDomainDefAddConsoleCompat: Fix numbering of console targets after modification
authorPeter Krempa <pkrempa@redhat.com>
Mon, 18 Dec 2023 15:41:01 +0000 (16:41 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 17 Jan 2024 16:31:12 +0000 (17:31 +0100)
commit55839c154d28ff1b158e5383835e81946fca4064
treeea976c6edaaea99894b25722605b458d41a57865
parentf51c6b5b02db069a8c48ea23f35d966e2df5842d
virDomainDefAddConsoleCompat: Fix numbering of console targets after modification

The XML parser for consoles sets the 'port=' attribute of '<target' to
be always the index of the console.

Thus when the "really crazy backcompat stuff for consoles" function
modifies the order of consoles by inserting the default one for a serial
port it must re-number the ports to ensure that the value will not
change on subsequent parse.

This luckily didn't cause any visible changes to the VM as the port
number isn't used for anything.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c
tests/qemuxml2xmloutdata/console-compat2.x86_64-latest.xml