platform: support switching partial namespaces
authorThomas Haller <thaller@redhat.com>
Mon, 14 Mar 2016 13:20:33 +0000 (14:20 +0100)
committerThomas Haller <thaller@redhat.com>
Tue, 15 Mar 2016 11:56:58 +0000 (12:56 +0100)
commit3428d8607d8462223e09ff703ac9c86fd7a102cc
tree1eb78bf7c0306c482bcdfe6cd20cb16f98b6fbfa
parenta0cce2b1956ae6292bffb102c0c9a4c33cdfbdbc
platform: support switching partial namespaces

Previously, the push/pop API to switch between namespaces would always
switch both the net and mount namespace together.

There are situations, where we want to only switch one namespace.
For example, the function nmp_netns_bind_to_path() introduced next
only wants to switch the net namespace to get /proc/self/ns/net,
but must not switch the mount namespace as it bind-mounds in the
namespace of the caller.
src/platform/nmp-netns.c
src/platform/nmp-netns.h
src/platform/tests/test-link.c