mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Move initialization of cmd->fmt into init_formats().
init_formats() sets up the command formats, and currently sets cmd->fmt_backup but does not set cmd->fmt to a default value. This seems incorrect so we set it to cmd->default_settings.fmt before returning. The call we remove here may set cmd->fmt based on a command line setting. But it is safe to remove this, because the only caller of init_lvm() that cares about the cmdline override is the cmdline tools (clvmd does not care), called from lvm2_main(). After lvm2_main() calls init_lvm(), it later calls lvm_run_command(). In lvm_run_command(), we have a call to _apply_settings(), which has the identical assignment of cmd->fmt that this patch removes.
This commit is contained in:
parent
3368322e0d
commit
9a04baa27c
@ -784,6 +784,7 @@ static int _init_formats(struct cmd_context *cmd)
|
||||
if (!strcasecmp(fmt->name, format) ||
|
||||
(fmt->alias && !strcasecmp(fmt->alias, format))) {
|
||||
cmd->default_settings.fmt = fmt;
|
||||
cmd->fmt = cmd->default_settings.fmt;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -1094,9 +1094,6 @@ struct cmd_context *init_lvm(unsigned is_static)
|
||||
init_full_scan_done(0);
|
||||
init_mirror_in_sync(0);
|
||||
|
||||
cmd->fmt = arg_ptr_value(cmd, metadatatype_ARG,
|
||||
cmd->current_settings.fmt);
|
||||
|
||||
return cmd;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user