This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/25531 ) Change subject: bts_shutdown_fsm: Allow configuring FSM to shutdown without exiting process ...................................................................... bts_shutdown_fsm: Allow configuring FSM to shutdown without exiting process This feature is not yet used by any bts_shutdown_fsm caller, but will be used in the future when Abis link goes down. Change-Id: I5dc282fdbcf862067be326e72b6183dd544222ae --- M include/osmo-bts/bts.h M src/common/bts_shutdown_fsm.c 2 files changed, 20 insertions(+), 5 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index d3cb6bf..a601423 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -368,6 +368,7 @@ } gsmtap; struct osmo_fsm_inst *shutdown_fi; /* FSM instance to manage shutdown procedure during process exit */ + bool shutdown_fi_exit_proc; /* exit process when shutdown_fsm is finished? */ struct osmo_fsm_inst *abis_link_fi; /* FSM instance to manage abis connection during process startup and link failure */ struct osmo_tdef *T_defs; /* Timer defines */ @@ -390,6 +391,7 @@ int bts_init(struct gsm_bts *bts); void bts_shutdown(struct gsm_bts *bts, const char *reason); +void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc); int bts_link_estab(struct gsm_bts *bts); diff --git a/src/common/bts_shutdown_fsm.c b/src/common/bts_shutdown_fsm.c index c16b76a..85d2d83 100644 --- a/src/common/bts_shutdown_fsm.c +++ b/src/common/bts_shutdown_fsm.c @@ -156,8 +156,11 @@ osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_SHUTDOWN_FINISH, NULL); - LOGPFSML(fi, LOGL_NOTICE, "Shutdown process completed successfuly, exiting process\n"); - exit(0); + if (bts->shutdown_fi_exit_proc) { + LOGPFSML(fi, LOGL_NOTICE, "Shutdown process completed successfully, exiting process\n"); + exit(0); + } + bts_shutdown_fsm_state_chg(fi, BTS_SHUTDOWN_ST_NONE); } static struct osmo_fsm_state bts_shutdown_fsm_states[] = { @@ -190,6 +193,8 @@ }, [BTS_SHUTDOWN_ST_EXIT] = { .name = "EXIT", + .out_state_mask = + X(BTS_SHUTDOWN_ST_NONE), .onenter = st_exit_on_enter, } }; @@ -232,18 +237,26 @@ OSMO_ASSERT(osmo_fsm_register(&bts_shutdown_fsm) == 0); } -void bts_shutdown(struct gsm_bts *bts, const char *reason) +void bts_shutdown_ext(struct gsm_bts *bts, const char *reason, bool exit_proc) { struct osmo_fsm_inst *fi = bts->shutdown_fi; if (fi->state != BTS_SHUTDOWN_ST_NONE) { LOGPFSML(fi, LOGL_NOTICE, "BTS is already being shutdown.\n"); + if (exit_proc) + bts->shutdown_fi_exit_proc = true; return; } - - LOGPFSML(fi, LOGL_NOTICE, "Shutting down BTS, reason: %s\n", reason); + bts->shutdown_fi_exit_proc = exit_proc; + LOGPFSML(fi, LOGL_NOTICE, "Shutting down BTS, exit %u, reason: %s\n", + exit_proc, reason); osmo_fsm_inst_dispatch(fi, BTS_SHUTDOWN_EV_START, NULL); } +void bts_shutdown(struct gsm_bts *bts, const char *reason) +{ + bts_shutdown_ext(bts, reason, true); +} + void bts_model_trx_close_cb(struct gsm_bts_trx *trx, int rc) { struct osmo_fsm_inst *fi = trx->bts->shutdown_fi; -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25531 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I5dc282fdbcf862067be326e72b6183dd544222ae Gerrit-Change-Number: 25531 Gerrit-PatchSet: 6 Gerrit-Owner: pespin <pespin at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de> Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210923/552fe664/attachment.htm>