]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Add helper for running code in separate namespaces
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 30 Jan 2014 13:11:23 +0000 (13:11 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 18 Feb 2014 12:45:41 +0000 (12:45 +0000)
commit7c72ef6f555f1f9844d51be2f38f078bc908652c
treef5e52c40c9a67b2cac1541319e33bcc30f9ffc62
parentc321bfc5c37c603af349dacf531bb03c91b0755e
Add helper for running code in separate namespaces

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@gmail.com> at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732394

Signed-off-by: Daniel Berrange <berrange@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
src/libvirt_private.syms
src/util/virprocess.c
src/util/virprocess.h