aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-07-20 19:17:06 +0200
committerDave Wallace <dwallacelf@gmail.com>2017-08-24 19:49:09 +0000
commit57d963f88b2c99e698e2b29f72e190f47f41b1ad (patch)
tree0a26d5fd1e09b4b997db5950fe9bf70835ab9798 /src/plugins/memif
parentd48e9763bfc39106eca954a28223b72261bf1aeb (diff)
Make VPP runtime directory configurable
New startup config command: unix { runtime-dir /run/vpp } Also, adds recursive mkdir funtion for use in deifferent places like cli-config socket path and dpdk hugepage directory path. Change-Id: I1446ceab9c220c25804e73a743a3ebb383450124 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/memif.c14
-rw-r--r--src/plugins/memif/private.h1
2 files changed, 9 insertions, 6 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index ba1231495c8..af81faf2711 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -556,15 +556,19 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args)
if (args->socket_filename == 0 || args->socket_filename[0] != '/')
{
- rv = mkdir (MEMIF_DEFAULT_SOCKET_DIR, 0755);
- if (rv && errno != EEXIST)
- return VNET_API_ERROR_SYSCALL_ERROR_1;
+ clib_error_t *error;
+ error = vlib_unix_recursive_mkdir (vlib_unix_get_runtime_dir ());
+ if (error)
+ {
+ clib_error_free (error);
+ return VNET_API_ERROR_SYSCALL_ERROR_1;
+ }
if (args->socket_filename == 0)
- socket_filename = format (0, "%s/%s%c", MEMIF_DEFAULT_SOCKET_DIR,
+ socket_filename = format (0, "%s/%s%c", vlib_unix_get_runtime_dir (),
MEMIF_DEFAULT_SOCKET_FILENAME, 0);
else
- socket_filename = format (0, "%s/%s%c", MEMIF_DEFAULT_SOCKET_DIR,
+ socket_filename = format (0, "%s/%s%c", vlib_unix_get_runtime_dir (),
args->socket_filename, 0);
}
diff --git a/src/plugins/memif/private.h b/src/plugins/memif/private.h
index 0f82f1e9575..985ac5ec985 100644
--- a/src/plugins/memif/private.h
+++ b/src/plugins/memif/private.h
@@ -17,7 +17,6 @@
#include <vppinfra/lock.h>
-#define MEMIF_DEFAULT_SOCKET_DIR "/run/vpp"
#define MEMIF_DEFAULT_SOCKET_FILENAME "memif.sock"
#define MEMIF_DEFAULT_RING_SIZE 1024
#define MEMIF_DEFAULT_RX_QUEUES 1