[libvirt-users] Libvirt migration issues (0.9.4 and 0.9.9)

Eric Blake eblake at redhat.com
Tue Jan 31 21:19:35 UTC 2012


[please don't top-post on technical lists]

On 01/31/2012 02:47 AM, Daniel Espling wrote:
> Sorry for the spamming, but changing the below code:
> 
>  if (cloexec) 
>         fd = fcntl(sock->fd, F_DUPFD_CLOEXEC);
>     else
>         fd = dup(sock->fd);
> 
> to:
> 
> fd = dup(sock->fd);
> if (cloexec && fd >= 0)
>         cntl(fd, F_SETFD, FD_CLOEXEC);
> 
> made it work for me.

Thanks for the report.  However, you shouldn't need to make this change.
 Gnulib should be replacing fcntl() on kernels that are too old to
support F_DUPFD_CLOEXEC, and doing that work on your behalf so that the
rest of the code can be written as though it were targetting newer
kernels (with the only drawback being that it is not atomic like it is
with newer kernels).

I'll need to see if I can reproduce this situation, and figure out why
gnulib isn't doing the right thing.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120131/d2f1ae37/attachment.sig>


More information about the libvirt-users mailing list