mirror of
git://sourceware.org/git/lvm2.git
synced 2025-10-13 11:33:16 +03:00
toolcontext: Move lvmlocal.conf loading.
Load lvmlocal.conf after basic initialisation from lvm.conf.
This commit is contained in:
@@ -374,7 +374,8 @@ static int _check_config(struct cmd_context *cmd)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int process_profilable_config(struct cmd_context *cmd) {
|
int process_profilable_config(struct cmd_context *cmd)
|
||||||
|
{
|
||||||
if (!(cmd->default_settings.unit_factor =
|
if (!(cmd->default_settings.unit_factor =
|
||||||
dm_units_to_factor(find_config_tree_str(cmd, global_units_CFG, NULL),
|
dm_units_to_factor(find_config_tree_str(cmd, global_units_CFG, NULL),
|
||||||
&cmd->default_settings.unit_type, 1, NULL))) {
|
&cmd->default_settings.unit_type, 1, NULL))) {
|
||||||
@@ -699,9 +700,8 @@ static int _load_config_file(struct cmd_context *cmd, const char *tag, int local
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find and read lvm.conf and lvmlocal.conf.
|
* Find and read lvm.conf.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int _init_lvm_conf(struct cmd_context *cmd)
|
static int _init_lvm_conf(struct cmd_context *cmd)
|
||||||
{
|
{
|
||||||
/* No config file if LVM_SYSTEM_DIR is empty */
|
/* No config file if LVM_SYSTEM_DIR is empty */
|
||||||
@@ -716,8 +716,6 @@ static int _init_lvm_conf(struct cmd_context *cmd)
|
|||||||
if (!_load_config_file(cmd, "", 0))
|
if (!_load_config_file(cmd, "", 0))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
_load_config_file(cmd, "", 1);
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1697,6 +1695,10 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
|
|||||||
if (!_init_tags(cmd, cmd->cft))
|
if (!_init_tags(cmd, cmd->cft))
|
||||||
goto_out;
|
goto_out;
|
||||||
|
|
||||||
|
/* Load lvmlocal.conf */
|
||||||
|
if (*cmd->system_dir && !_load_config_file(cmd, "", 1))
|
||||||
|
return_0;
|
||||||
|
|
||||||
if (!_init_tag_configs(cmd))
|
if (!_init_tag_configs(cmd))
|
||||||
goto_out;
|
goto_out;
|
||||||
|
|
||||||
@@ -1904,6 +1906,10 @@ int refresh_toolcontext(struct cmd_context *cmd)
|
|||||||
if (!_init_tags(cmd, cft_tmp))
|
if (!_init_tags(cmd, cft_tmp))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
|
/* Load lvmlocal.conf */
|
||||||
|
if (*cmd->system_dir && !_load_config_file(cmd, "", 1))
|
||||||
|
return_0;
|
||||||
|
|
||||||
/* Doesn't change cmd->cft */
|
/* Doesn't change cmd->cft */
|
||||||
if (!_init_tag_configs(cmd))
|
if (!_init_tag_configs(cmd))
|
||||||
return_0;
|
return_0;
|
||||||
|
Reference in New Issue
Block a user