summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.h
diff options
context:
space:
mode:
authorPierre Pfister <ppfister@cisco.com>2021-09-10 16:38:03 +0200
committerDamjan Marion <dmarion@me.com>2021-09-14 14:42:07 +0000
commitc26cc72edf195a3f57c734b5161bd37995002107 (patch)
tree04286baf62d4b505635aa63cde1809f22cc6f1ed /src/vlib/main.h
parent46e020183e3e333c67a8099c4c43c9361d7ae4af (diff)
vlib: add graceful termination with status
This commit allows a non-VPP thread to request VPP to gracefully shutdown and return a specific process status value. Type: improvement Change-Id: I9bf52b789e7ee28eb272630eaea495fd94349f79 Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'src/vlib/main.h')
-rw-r--r--src/vlib/main.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vlib/main.h b/src/vlib/main.h
index c655560d08c..a16f603f467 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -143,6 +143,8 @@ typedef struct vlib_main_t
u32 main_loop_exit_set;
/* Set e.g. in the SIGTERM signal handler, checked in a safe place... */
volatile u32 main_loop_exit_now;
+ /* Exit status that will be returned by the process upon exit. */
+ volatile int main_loop_exit_status;
clib_longjmp_t main_loop_exit;
#define VLIB_MAIN_LOOP_EXIT_NONE 0
#define VLIB_MAIN_LOOP_EXIT_PANIC 1
@@ -389,6 +391,8 @@ vlib_panic (vlib_main_t * vm)
vlib_panic_with_error (vm, 0);
}
+/* Asynchronously requests exit with the given status. */
+void vlib_exit_with_status (vlib_main_t *vm, int status);
always_inline f64
vlib_internal_node_vector_rate (vlib_main_t * vm)