We are encountering a problem of race conditions for getting VNC port when VM start up.
In a very powerful hypervisor, if we try to start up more than 1 VM concurrently, then there might be some VMs failed to start up due to VNC port confilict.
We searched libvirt bugs and found that some one report the problem and we have give a fix, but the fix can not resolve the problem.
The bitmap test-and-set operation is not atomic, so that there still is a time-window in which a VNC port could be reserved for two caller.
Your help is highly appreciated!