diff --git a/src/config_macros.h b/src/config_macros.h deleted file mode 100644 index 3b9eb88c..00000000 --- a/src/config_macros.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * file: config_macros.h - * description: really simple config file / env var parsing - * - * config file keyword = variable name - * environment variable = LSVD_(uppercase keyword) - * handles four types of values: - * - string - * - int - * - human-readable int (e.g. 10m, 20G) - * - table (actually std::map) lookup - * - * to use: - * F_CONFIG_XXX(input, arg, name) - if input==name, set name=arg - * ENV_CONFIG_XXX(name) - if LSVD_ is set, set name= - * - */ - -#include -#include -#include - -static long parseint(const char *_s) -{ - char *s = (char *)_s; - long val = strtol(s, &s, 0); - if (toupper(*s) == 'G') - val *= (1024 * 1024 * 1024); - if (toupper(*s) == 'M') - val *= (1024 * 1024); - if (toupper(*s) == 'K') - val *= 1024; - return val; -} - -static long parseint(std::string &s) { return parseint(s.c_str()); } - -#define CONFIG_HDR(name) \ - const char *val = NULL; \ - std::string env = "LSVD_" #name; \ - std::transform(env.begin(), env.end(), env.begin(), \ - [](unsigned char c) { return std::toupper(c); }); - -#define F_CONFIG_STR(input, arg, name) \ - { \ - if (input == #name) \ - name = arg; \ - } - -#define ENV_CONFIG_STR(name) \ - { \ - CONFIG_HDR(name) \ - if ((val = getenv(env.c_str()))) \ - name = std::string(val); \ - } - -#define F_CONFIG_INT(input, arg, name) \ - { \ - if (input == #name) \ - name = atoi(arg.c_str()); \ - } - -#define ENV_CONFIG_INT(name) \ - { \ - CONFIG_HDR(name) \ - if ((val = getenv(env.c_str()))) \ - name = atoi(val); \ - } - -#define F_CONFIG_H_INT(input, arg, name) \ - { \ - if (input == #name) \ - name = parseint(arg); \ - } - -#define ENV_CONFIG_H_INT(name) \ - { \ - CONFIG_HDR(name) \ - if ((val = getenv(env.c_str()))) \ - name = parseint(val); \ - } - -#define F_CONFIG_TABLE(input, arg, name, table) \ - { \ - if (input == #name) \ - name = table[arg]; \ - } - -#define ENV_CONFIG_TABLE(name, table) \ - { \ - CONFIG_HDR(name) \ - if ((val = getenv(env.c_str()))) \ - name = table[std::string(val)]; \ - } diff --git a/subprojects/packagefiles/spdk/meson.build b/subprojects/packagefiles/spdk/meson.build index c798d74c..8c57dbfe 100644 --- a/subprojects/packagefiles/spdk/meson.build +++ b/subprojects/packagefiles/spdk/meson.build @@ -50,6 +50,7 @@ custom_libnames = [ # 'spdk_bdev_split', # 'spdk_bdev_delay', # 'spdk_bdev_zone_block', + # 'spdk_bdev_rbd', 'spdk_blobfs_bdev', 'spdk_blobfs', 'spdk_blob_bdev',