Python API: Add support for shared memory prefix
Recheck.
This is to support multiple VPP instances on same host.
Change-Id: Ibe511b1f790fc8771900085577423f7e71dc45df
Signed-off-by: Ole Troan <ot@cisco.com>
diff --git a/vpp-api/python/pneum/pneum.c b/vpp-api/python/pneum/pneum.c
index 7250cf6..ebe47b2 100644
--- a/vpp-api/python/pneum/pneum.c
+++ b/vpp-api/python/pneum/pneum.c
@@ -116,11 +116,14 @@
}
int
-pneum_connect (char *name)
+pneum_connect (char * name, char * chroot_prefix)
{
int rv = 0;
pneum_main_t *pm = &pneum_main;
+ if (chroot_prefix != NULL)
+ vl_set_memory_root_path (chroot_prefix);
+
if ((rv = vl_client_api_map("/vpe-api"))) {
clib_warning ("vl_client_api map rv %d", rv);
return rv;
diff --git a/vpp-api/python/pneum/pneum.h b/vpp-api/python/pneum/pneum.h
index 75fccf8..75b10f8 100644
--- a/vpp-api/python/pneum/pneum.h
+++ b/vpp-api/python/pneum/pneum.h
@@ -15,7 +15,7 @@
#ifndef included_pneum_h
#define included_pneum_h
-int pneum_connect(char *name);
+int pneum_connect(char * name, char * chroot_prefix);
int pneum_disconnect(void);
int pneum_read(char **data, int *l);
int pneum_write(char *data, int len);
diff --git a/vpp-api/python/pneum/test_pneum.c b/vpp-api/python/pneum/test_pneum.c
index b313195..20c29a7 100644
--- a/vpp-api/python/pneum/test_pneum.c
+++ b/vpp-api/python/pneum/test_pneum.c
@@ -76,7 +76,7 @@
vl_api_show_version_t message;
vl_api_show_version_t *mp;
int async = 1;
- int rv = pneum_connect("pneum_client");
+ int rv = pneum_connect("pneum_client", NULL);
if (rv != 0) {
printf("Connect failed: %d\n", rv);