This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [libvirt] [PATCH] LXC: make sure fuse thread start to run before we do clone
- From: "Daniel P. Berrange" <berrange at redhat dot com>
- To: Eric Blake <eblake at redhat dot com>
- Cc: Rich Felker <dalias at aerifal dot cx>, libvir-list at redhat dot com, libc-alpha at sourceware dot org
- Date: Thu, 14 Nov 2013 09:22:06 +0000
- Subject: Re: [libvirt] [PATCH] LXC: make sure fuse thread start to run before we do clone
- Authentication-results: sourceware.org; auth=none
- References: <1383830143-26049-1-git-send-email-gaofeng at cn dot fujitsu dot com> <20131108053008 dot GF16846 at redhat dot com> <20131108194226 dot GC24286 at brightrain dot aerifal dot cx> <20131113145305 dot GY32643 at redhat dot com> <20131113181642 dot GU24286 at brightrain dot aerifal dot cx> <5283C60A dot 6060609 at redhat dot com>
- Reply-to: "Daniel P. Berrange" <berrange at redhat dot com>
On Wed, Nov 13, 2013 at 11:33:46AM -0700, Eric Blake wrote:
> 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.
Yeah, I also wish we could use unshare() instead of clone(), but the
CLONE_NEWPID design limitation is a blocker for that.
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|