aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlibmemory
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2017-03-14 09:10:56 -0400
committerDave Barach <dave@barachs.net>2017-03-14 09:36:17 -0400
commitb64e4e2af314e1b2bc074b12ede50ad6d96c37c0 (patch)
tree0a4f94b40f41ebb5e7bae871d66da024d56b08d8 /src/vlibmemory
parentc563e0e11e0725b6cb85b4f1c405084385612b2f (diff)
Clean up dead API client reaper callack scheme
Change-Id: Iec3df234ca9f717d87787cefc76b73ed9ad42332 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibmemory')
-rw-r--r--src/vlibmemory/memory_vlib.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/vlibmemory/memory_vlib.c b/src/vlibmemory/memory_vlib.c
index d2e0596824d..7a536ee808c 100644
--- a/src/vlibmemory/memory_vlib.c
+++ b/src/vlibmemory/memory_vlib.c
@@ -221,12 +221,20 @@ vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
vl_msg_api_send_shmem (q, (u8 *) & rp);
}
-/* Application callback to clean up leftover registrations from this client */
-int vl_api_memclnt_delete_callback (u32 client_index) __attribute__ ((weak));
-
-int
-vl_api_memclnt_delete_callback (u32 client_index)
+static int
+call_reaper_functions (u32 client_index)
{
+ clib_error_t *error = 0;
+ _vl_msg_api_function_list_elt_t *i;
+
+ i = api_main.reaper_function_registrations;
+ while (i)
+ {
+ error = i->f (client_index);
+ if (error)
+ clib_error_report (error);
+ i = i->next_init_function;
+ }
return 0;
}
@@ -246,7 +254,7 @@ vl_api_memclnt_delete_t_handler (vl_api_memclnt_delete_t * mp)
handle = mp->index;
- if (vl_api_memclnt_delete_callback (handle))
+ if (call_reaper_functions (handle))
return;
epoch = vl_msg_api_handle_get_epoch (handle);
@@ -621,7 +629,7 @@ memclnt_process (vlib_main_t * vm,
handle = vl_msg_api_handle_from_index_and_epoch
(dead_indices[i], shm->application_restarts);
- (void) vl_api_memclnt_delete_callback (handle);
+ (void) call_reaper_functions (handle);
}
}