diff options
author | Damjan Marion <damarion@cisco.com> | 2017-07-20 19:17:06 +0200 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2017-08-24 19:49:09 +0000 |
commit | 57d963f88b2c99e698e2b29f72e190f47f41b1ad (patch) | |
tree | 0a26d5fd1e09b4b997db5950fe9bf70835ab9798 /src/plugins/memif/memif.c | |
parent | d48e9763bfc39106eca954a28223b72261bf1aeb (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/memif.c')
-rw-r--r-- | src/plugins/memif/memif.c | 14 |
1 files changed, 9 insertions, 5 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); } |