diff options
author | 2016-01-22 16:09:52 -0500 | |
---|---|---|
committer | 2016-01-22 16:10:07 -0500 | |
commit | 309bef25f109ff9ef03e178ac6fe233f4d778d73 (patch) | |
tree | 32f49e4638bf837cb03ec972dbdfbba29e0fc9e8 /vpp | |
parent | 61efa140b1f44e0c568697fbc31cf3f430131ab2 (diff) |
Enable shared-VM namespace support
Required prep work for gracefully supporting
"... dpdk { proc-type secondary }" - multiple processes sharing a physical
host, VM, container, etc.
Change-Id: Ic3eb72f4093e26d7c86dde3b8799264f1d0c218b
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vpp')
-rw-r--r-- | vpp/api/api.c | 20 | ||||
-rw-r--r-- | vpp/api/gmon.c | 5 |
2 files changed, 24 insertions, 1 deletions
diff --git a/vpp/api/api.c b/vpp/api/api.c index 9f3da214..55de9946 100644 --- a/vpp/api/api.c +++ b/vpp/api/api.c @@ -4979,6 +4979,26 @@ vpe_api_init (vlib_main_t *vm) VLIB_INIT_FUNCTION(vpe_api_init); +static clib_error_t * +chroot_config (vlib_main_t * vm, unformat_input_t * input) +{ + u8 * chroot_path; + + while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) + { + if (unformat (input, "prefix %s", &chroot_path)) + { + vec_add1 (chroot_path, 0); + vl_set_memory_root_path ((char *)chroot_path); + } + else + return clib_error_return (0, "unknown input `%U'", + format_unformat_error, input); + } + return 0; +} +VLIB_EARLY_CONFIG_FUNCTION (chroot_config, "chroot"); + void * get_unformat_vnet_sw_interface (void) { return (void *) &unformat_vnet_sw_interface; diff --git a/vpp/api/gmon.c b/vpp/api/gmon.c index 75bf3443..e256e83b 100644 --- a/vpp/api/gmon.c +++ b/vpp/api/gmon.c @@ -35,6 +35,8 @@ #include <vppinfra/heap.h> #include <vppinfra/pool.h> #include <vppinfra/format.h> +#include <vlibapi/api.h> +#include <vlibmemory/api.h> #include <vlib/vlib.h> #include <vlib/unix/unix.h> @@ -104,11 +106,12 @@ static clib_error_t * gmon_init (vlib_main_t *vm) { gmon_main_t *gm = &gmon_main; + api_main_t * am = &api_main; pid_t *swp = 0; f64 *v = 0; gm->vlib_main = vm; - gm->svmdb_client = svmdb_map(); + gm->svmdb_client = svmdb_map_chroot(am->root_path); /* Find or create, set to zero */ vec_add1 (v, 0.0); |