[libvirt] [PATCH 3/3] Fix race in finding available vnc port

Jim Fehlig jfehlig at novell.com
Fri May 21 16:00:42 UTC 2010


Eric Blake wrote:
> On 05/20/2010 02:45 PM, Jim Fehlig wrote:
>   
>>      for (i = QEMU_VNC_PORT_MIN; i < QEMU_VNC_PORT_MAX; i++) {
>>          int fd;
>>          int reuse = 1;
>>          struct sockaddr_in addr;
>> +        bool used = false;
>> +
>> +        virBitmapGetBit(driver->reservedVNCPorts, i - QEMU_VNC_PORT_MIN, &used);
>>     
>
> For now, we're safe not checking for failure here.  But maybe we should
> add an error check and a VIR_DEBUG to be proactive in case the size of
> driver->reservedVNCPorts is ever accidentally changed?

I've added this suggestion and rebased against cleanup label changes in
qemudStartVMDaemon.

Regards,
Jim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Fix-race-in-finding-available-vnc-port.patch
Type: text/x-patch
Size: 4543 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100521/7033f51f/attachment-0001.bin>


More information about the libvir-list mailing list