void *oldheap;
vl_shmem_hdr_t *shmem_hdr = 0;
api_main_t *am = &api_main;
- int i;
+ int i, rv;
struct timespec ts, tsrem;
u32 vlib_input_queue_length;
+ char *vpe_api_region_suffix = "-vpe-api";
memset (a, 0, sizeof (*a));
- if (strstr (region_name, "-vpe-api"))
+ if (strstr (region_name, vpe_api_region_suffix))
{
- char root_path[strlen (region_name)];
- strncpy (root_path, region_name, strlen (region_name) - 8);
- a->root_path = root_path;
- am->root_path = root_path;
+ u8 *root_path = format (0, "%s", region_name);
+ _vec_len (root_path) = (vec_len (root_path) -
+ strlen (vpe_api_region_suffix));
+ vec_terminate_c_string (root_path);
+ a->root_path = (const char *) root_path;
+ am->root_path = (const char *) root_path;
}
if (is_vlib == 0)
- svm_region_init_chroot (am->root_path);
+ {
+ rv = svm_region_init_chroot (am->root_path);
+ if (rv)
+ return rv;
+ }
if (a->root_path != NULL)
{