From 98cfc1aab07d311b53b0171fad62a4031c96fcfd Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Mon, 18 Jul 2016 14:23:36 -0400 Subject: Add uid/gid config parameters to shared-vm database map operator So vpp_get_metrics and similar will not need to run as root Change-Id: I635e830834c82990ad84ddaae06f2e50e55fd616 Signed-off-by: Dave Barach --- vpp-api-test/vat/restart.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vpp-api-test/vat') diff --git a/vpp-api-test/vat/restart.c b/vpp-api-test/vat/restart.c index d94ddf89..2bbaa516 100644 --- a/vpp-api-test/vat/restart.c +++ b/vpp-api-test/vat/restart.c @@ -40,6 +40,7 @@ int restart_main_fn (unformat_input_t * i) struct stat statb; ino_t old_inode; int sleeps; + svmdb_map_args_t _ma, *ma= &_ma; struct timespec _req, *req = &_req; struct timespec _rem, *rem = &_rem; @@ -63,7 +64,10 @@ int restart_main_fn (unformat_input_t * i) /* * Step 1: look up the current VPP pid in the shared-memory database */ - svmdb_client = svmdb_map_chroot ((char *) chroot_path); + memset (ma, 0, sizeof (*ma)); + ma->root_path = (char *)chroot_path; + + svmdb_client = svmdb_map (ma); pidp = svmdb_local_get_variable_reference (svmdb_client, SVMDB_NAMESPACE_VEC, @@ -173,7 +177,7 @@ int restart_main_fn (unformat_input_t * i) /* * Step 6: remap the SVM database */ - svmdb_client = svmdb_map_chroot ((char *) chroot_path); + svmdb_client = svmdb_map (ma); pidp = svmdb_local_get_variable_reference (svmdb_client, SVMDB_NAMESPACE_VEC, -- cgit 1.2.3-korg