diff --git a/CHANGELOG.md b/CHANGELOG.md index c65d2e4ec1..2fe1568400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,10 @@ SoC may be running SPDK on the SoC. That SoC has its own local memory, but SPDK devices that can also access the host system memory. This library provides infrastructure to enumerate the memory domains and request hardware perform DMA transfers between them. +### event + +Added the `disable_signal_handlers` flag to the `spdk_app_opts` struct. + ### log Added API `spdk_log_to_syslog_level` to return syslog level based on SPDK's diff --git a/include/spdk/event.h b/include/spdk/event.h index 74c9467280..50978a587c 100644 --- a/include/spdk/event.h +++ b/include/spdk/event.h @@ -137,6 +137,16 @@ struct spdk_app_opts { * After that, new added fields should be put after opts_size. */ size_t opts_size; + + /** + * Disable default signal handlers. + * If set to `true`, the shutdown process is not started implicitly by + * process signals, hence the application is responsible for calling + * spdk_app_start_shutdown(). + * + * Default is `false`. + */ + bool disable_signal_handlers; }; /** diff --git a/lib/event/Makefile b/lib/event/Makefile index 02b9664bce..6cbdab07b4 100644 --- a/lib/event/Makefile +++ b/lib/event/Makefile @@ -34,8 +34,8 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -SO_VER := 9 -SO_MINOR := 1 +SO_VER := 10 +SO_MINOR := 0 CFLAGS += $(ENV_CFLAGS) diff --git a/lib/event/app.c b/lib/event/app.c index cfdefd7811..2a6d6b0e02 100644 --- a/lib/event/app.c +++ b/lib/event/app.c @@ -224,6 +224,7 @@ spdk_app_opts_init(struct spdk_app_opts *opts, size_t opts_size) SET_FIELD(rpc_addr, SPDK_DEFAULT_RPC_ADDR); SET_FIELD(num_entries, SPDK_APP_DEFAULT_NUM_TRACE_ENTRIES); SET_FIELD(delay_subsystem_init, false); + SET_FIELD(disable_signal_handlers, false); #undef SET_FIELD } @@ -460,10 +461,11 @@ app_copy_opts(struct spdk_app_opts *opts, struct spdk_app_opts *opts_user, size_ SET_FIELD(env_context); SET_FIELD(log); SET_FIELD(base_virtaddr); + SET_FIELD(disable_signal_handlers); /* You should not remove this statement, but need to update the assert statement * if you add a new field, and also add a corresponding SET_FIELD statement */ - SPDK_STATIC_ASSERT(sizeof(struct spdk_app_opts) == 184, "Incorrect size"); + SPDK_STATIC_ASSERT(sizeof(struct spdk_app_opts) == 192, "Incorrect size"); #undef SET_FIELD } @@ -569,7 +571,7 @@ spdk_app_start(struct spdk_app_opts *opts_user, spdk_msg_fn start_fn, return 1; } - if (app_setup_signal_handlers(opts) != 0) { + if (!opts->disable_signal_handlers && app_setup_signal_handlers(opts) != 0) { return 1; }