[libvirt] [PATCH 08/14] Add helper for running code in separate namespaces
Daniel P. Berrange
berrange at redhat.com
Fri Feb 7 17:34:26 UTC 2014
On Fri, Feb 07, 2014 at 10:31:03AM -0700, Eric Blake wrote:
> On 02/07/2014 08:33 AM, Daniel P. Berrange wrote:
> > Implement virProcessRunInMountNamespace, which runs callback of type
> > virProcessNamespaceCallback in a container namespace. This uses a
> > child process to run the callback, since you can't change the mount
> > namespace of a thread. This implies that callbacks have to be careful
> > about what code they run due to async safety rules.
> >
> > Idea by Dan Berrange, based on an initial report by Reco
> > <recoverym4n at gmail.com> at
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732394
> >
> > Signed-off-by: Daniel Berrange <berrange at redhat.com>
>
> Looks like you improved from my version, so it would be nice to add:
>
> Signed-off-by: Eric Blake <eblake at redhat.com>
Sure. What happened is that I started with your code, then I
rewrote the method from scratch to use threads, then I found
threads + mount namespace didn't work, so I rewrote it again
to use fork again. Fun times :-)
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 :|
More information about the libvir-list
mailing list