summaryrefslogtreecommitdiffstats
path: root/vpp
diff options
context:
space:
mode:
Diffstat (limited to 'vpp')
-rw-r--r--vpp/api/api.c20
-rw-r--r--vpp/api/gmon.c5
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);