[libvirt] [PATCH] LXC: make sure fuse thread start to run before we do clone

Eric Blake eblake at redhat.com
Wed Nov 13 18:33:46 UTC 2013


On 11/13/2013 11:16 AM, Rich Felker wrote:

>> We are not using clone() in a manner that is strictly equivalent
>> to fork(). Libvirt is using clone() to create Linux containers
>> with new namespaces. eg we do 
>>
>>   clone(CLONE_NEWPID|CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWNET|SIGCHLD)
> 
> Understood. I still call this a fork-like manner since it's not
> sharing VM or using CLONE_THREAD and using the default signal of
> SIGCHLD. BTW is there a reason to prefer this usage over regular fork
> followed by unshare()?

Yes.  Per 'man 2 unshare', CLONE_NEWPID is not supported with unshare(),
yet we require our child to have pid 1 in its new pid namespace.

-- 
Eric Blake   eblake 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: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131113/ba478c5f/attachment-0001.sig>


More information about the libvir-list mailing list