summaryrefslogtreecommitdiff
path: root/src/platform/tests/test-general.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-04-17 18:40:52 +0200
committerThomas Haller <thaller@redhat.com>2017-04-18 15:53:11 +0200
commitd37b9d79bc1b37443a18dcb39b73f19c4fea8783 (patch)
tree08e2012b672d3d7139252cab84d36113d1f46eba /src/platform/tests/test-general.c
parenta39fac2248bf745dc51a4e6da17ea4bb42224f6c (diff)
core: add NMNetns to bundle platform and route managers
NMPlatform, NMRouteManager and NMDefaultRouteManager are singletons instances. Users of those are for example NMDevice, which registers to GObject signals of both NMPlatform and NMRouteManager. Hence, as NMDevice:dispose() disconnects the signal handlers, it must ensure that those singleton instances live longer then the NMDevice instance. That is usually accomplished by having users of singleton instances own a reference to those instances. For NMDevice that effectively means that it shall own a reference to several singletons. NMPlatform, NMRouteManager, and NMDefaultRouteManager are all per-namespace. In general it doesn't make sense to have more then one instances of these per name space. Nnote that currently we don't support multiple namespaces yet. If we will ever support multiple namespaces, then a NMDevice would have a reference to all of these manager instances. Hence, introduce a new class NMNetns which bundles them together. (cherry picked from commit 0af2f5c28b7646c687b5180a45a9124d62c0dfac)
Diffstat (limited to 'src/platform/tests/test-general.c')
-rw-r--r--src/platform/tests/test-general.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platform/tests/test-general.c b/src/platform/tests/test-general.c
index 658aad264..2ccfac7d2 100644
--- a/src/platform/tests/test-general.c
+++ b/src/platform/tests/test-general.c
@@ -35,7 +35,7 @@ test_init_linux_platform (void)
{
gs_unref_object NMPlatform *platform = NULL;
- platform = nm_linux_platform_new (NM_PLATFORM_NETNS_SUPPORT_DEFAULT);
+ platform = nm_linux_platform_new (TRUE, NM_PLATFORM_NETNS_SUPPORT_DEFAULT);
}
/*****************************************************************************/
@@ -46,7 +46,7 @@ test_link_get_all (void)
gs_unref_object NMPlatform *platform = NULL;
gs_unref_array GArray *links = NULL;
- platform = nm_linux_platform_new (NM_PLATFORM_NETNS_SUPPORT_DEFAULT);
+ platform = nm_linux_platform_new (TRUE, NM_PLATFORM_NETNS_SUPPORT_DEFAULT);
links = nm_platform_link_get_all (platform);
}