1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-07 15:33:21 +03:00

liblvm: allow config settings to be read without full lvm cmd

A program may be using liblvm2app for simply checking a config
setting in lvm.conf.  In this case, a full lvm context is not
needed, only cmd->cft (which are the config settings read from
lvm.conf).

lvm_config_find_bool() can now be passed a NULL lvm context
in which case it will only create cmd->cft, check the config
setting asked for, and destroy the cmd.
This commit is contained in:
David Teigland
2016-05-17 11:54:13 -05:00
parent ba9b7b69d9
commit 7fd4119d24
3 changed files with 71 additions and 3 deletions

View File

@@ -218,6 +218,14 @@ int init_lvmcache_orphans(struct cmd_context *cmd);
int init_filters(struct cmd_context *cmd, unsigned load_persistent_cache);
int init_connections(struct cmd_context *cmd);
/*
* A config context is a very light weight cmd struct that
* is only used for reading config settings from lvm.conf,
* which are at cmd->cft.
*/
struct cmd_context *create_config_context(void);
void destroy_config_context(struct cmd_context *cmd);
struct format_type *get_format_by_name(struct cmd_context *cmd, const char *format);
const char *system_id_from_string(struct cmd_context *cmd, const char *str);