]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: Set auto-allocated graphics ports to used on reconnect
authorJim Fehlig <jfehlig@suse.com>
Wed, 2 Feb 2022 00:03:11 +0000 (17:03 -0700)
committerJim Fehlig <jfehlig@suse.com>
Mon, 7 Feb 2022 20:30:35 +0000 (13:30 -0700)
commite0241f334d4e8da2e36cda48c225d5a6edcc3a50
tree88c721a232460a66e41b1981e9b1f1223a0f7827
parenta7743c60268e706699d4aa53ac0c45683ea84954
libxl: Set auto-allocated graphics ports to used on reconnect

The libxl driver reconnects to all running VMs when libvirtd is restarted,
but it failed to mark auto-allocated graphics ports as set in the port
allocator. If many VMs are running that use port auto-allocation and
libvirtd is restarted, the port allocator is likely to hand out a port
already in use when a new VM is created that uses auto-allocation. VM
creation will fail due to the port clash.

When reconnecting to running VMs after a libvirtd restart, let the port
allocator know about previously allocated ports.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/libxl/libxl_driver.c