There is a problem with current port allocations in libvirt.
1. With default qemu driver conf values remote_display_port_min = 5900 and
remote_websocket_port_min = 5700 one can not start more than 200 domains
each of one have vnc graphics with auto allocated socket and websocket. For
the 200th domain driver allocate 6100 port for both socket and websocket
and qemu fail to start.
2. Different hypervisor drivers use port pools with same borders (libxl
and qemu migration ports, hardcoded libxl vnc sockets and default conf
qemu vnc sockets for example. However I'm not sure it is possible/practical
to use these drivers simultaneously on same host). As a result there
can be failures due to races when first driver check for bind successfully then
second driver check for bind successfully and then both pass same port value
to hypervisors.
Suggestion is to make port bitmap driver/daemon global and leave only borders
in port pool object. This was we can solve the first and the both issues
correspondingly.
Nikolay