diff --git a/0014-set-default-config.patch b/0014-set-default-config.patch new file mode 100644 index 0000000000000000000000000000000000000000..7f925d5aaa609532773a292475bfdc6a1822f930 --- /dev/null +++ b/0014-set-default-config.patch @@ -0,0 +1,64 @@ +From 467e1242c49b940b77c79b89eec13d190472e9c6 Mon Sep 17 00:00:00 2001 +From: foolstrong +Date: Thu, 10 Jul 2025 08:39:57 +0000 +Subject: [PATCH] set default config + +--- + lib/conf/conf.c | 39 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 39 insertions(+) + +diff --git a/lib/conf/conf.c b/lib/conf/conf.c +index 8588cdc..5df1dd7 100644 +--- a/lib/conf/conf.c ++++ b/lib/conf/conf.c +@@ -188,8 +188,47 @@ allocate_cf_value(void) + return calloc(1, sizeof(struct spdk_conf_value)); + } + ++#ifdef SPDK_CONFIG_APP_RW ++#define DEFAULT_CONFIG_PATH "/etc/spdk/nvme.conf.in" + ++static struct spdk_conf *check_cp_or_use_default(struct spdk_conf *cp) ++{ ++ struct spdk_conf *config = NULL; ++ ++ if (cp) { ++ return cp; ++ } ++ ++ if (default_config) { ++ return default_config; ++ } ++ ++ config = spdk_conf_allocate(); ++ if (config == NULL) { ++ SPDK_ERRLOG("allocate config failed\n"); ++ return NULL; ++ } ++ ++ if (spdk_conf_read(config, DEFAULT_CONFIG_PATH)) { ++ SPDK_ERRLOG("can not read config file "DEFAULT_CONFIG_PATH"\n"); ++ spdk_conf_free(config); ++ return NULL; ++ } ++ ++ if (spdk_conf_first_section(config) == NULL) { ++ SPDK_ERRLOG("invalid config file "DEFAULT_CONFIG_PATH"\n"); ++ spdk_conf_free(config); ++ return NULL; ++ } ++ ++ spdk_conf_set_as_default(config); ++ return config; ++} ++ ++#define CHECK_CP_OR_USE_DEFAULT(cp) check_cp_or_use_default(cp) ++#else + #define CHECK_CP_OR_USE_DEFAULT(cp) (((cp) == NULL) && (default_config != NULL)) ? default_config : (cp) ++#endif + + struct spdk_conf_section * + spdk_conf_find_section(struct spdk_conf *cp, const char *name) +-- +2.33.0 + diff --git a/spdk.spec b/spdk.spec index d69b0e77fd5c79043a5d2803da0dee3a60e9c5a1..61dd76eb3d0e8d83eceba246753a9663d98358ef 100644 --- a/spdk.spec +++ b/spdk.spec @@ -4,7 +4,7 @@ Name: spdk Version: 24.01 -Release: 10 +Release: 11 Summary: Set of libraries and utilities for high performance user-mode storage License: BSD and MIT URL: http://spdk.io @@ -22,6 +22,7 @@ Patch10: 0010-Add-CUSE-switch-for-nvme-ctrlr.patch Patch11: 0011-Adapt-for-ES3000-serial-vendor-special-opcode-in-CUS.patch Patch12: 0012-adapt-for-spdk-24.01.patch Patch13: 0013-vhost-add-vhost-interrupt-coalescing.patch +Patch14: 0014-set-default-config.patch %define package_version %{version}-%{release} @@ -203,6 +204,9 @@ mv doc/output/html/ %{install_docdir} %changelog +* Thu Jul 10 2025 wangzhiqiang - 24.01-11 +- set default config + * Thu Jul 3 2025 wangzhiqiang - 24.01-10 - enable app