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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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? (Hmm, maybe an
addendum to my comments on 1/3, that the bitmap.h file should mark
functions as ATTRIBUTE_RETURN_CHECK?)  I could go either way, so for
now, I'll wait for other comments (and for the fixes to bitmap.h) before
giving an ack.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]