]> git.feebdaed.xyz Git - 0xmirror/libvirt.git/commit
domain_addr.c: Fix virtio console port autoassign on virtio-serial bus
authorAaron M. Brown <aaronmbr@linux.ibm.com>
Fri, 19 Sep 2025 19:26:19 +0000 (15:26 -0400)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 24 Nov 2025 14:40:57 +0000 (15:40 +0100)
commit2083efe0302348e98292a11798cbca8841eea35f
tree0c193b92b877f25914ba974ea0758d0d3c2da874
parent22059030f947fb8af578091f489472cdd55a30e2
domain_addr.c: Fix virtio console port autoassign on virtio-serial bus

This change fixes an issue with virtio console port assignment on virtio-serial buses.
Currently, when trying to autoassign a virtio console device, the device cannot be
assigned to a port greater than 0 on virtio-serial buses.
You will receive the following error:

`virtio-serial-bus: A port already exists at id 0`

Therefore, the data needs to be passed back into info when allowZero is true.
We should also preserve the controller data when allowZero is true, and
propagate allowZero into virDomainVirtioSerialAddrNextFromController
to get an appropriate startPort.

Fixes: 16db8d2e ("Add functions to track virtio-serial addresses")
Signed-off-by: Aaron M. Brown <aaronmbr@linux.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_addr.c
tests/qemuxmlconfdata/console-virtio-serial-autoassign-address.x86_64-latest.args
tests/qemuxmlconfdata/console-virtio-serial-autoassign-address.x86_64-latest.xml