mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-28 02:50:41 +03:00
Ensure --metadatacopies parameter gets interpreted based on command.
Now that we have both --pvmetadatacopies and --vgmetadatacopies, we need to make sure --metadatacopies gets interpreted correctly. For pv commands, --metadatacopies should imply --pvmetadatacopies, and for vg commands, --vgmetadatacopies. Note: this will change the behavior of vgcreate with --metadatacopies to be a synonym for --vgmetadatacopies. Previously, --metadatacopies would apply to any PVs given with vgcreate that needed an implicit pvcreate. As a result, one small change is needed to one of the nightly tests - t-vgcreate-usage. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
458a107e86
commit
7088fb9260
@ -115,7 +115,7 @@ do
|
||||
vgremove -f $vg
|
||||
pvremove -f $dev1
|
||||
done
|
||||
not vgcreate -c n --metadatacopies 0 $vg $dev1
|
||||
not vgcreate -c n --pvmetadatacopies 0 $vg $dev1
|
||||
pvcreate --metadatacopies 1 $dev2
|
||||
vgcreate -c n --pvmetadatacopies 0 $vg $dev1 $dev2
|
||||
check_pv_field_ $dev1 pv_mda_count 0
|
||||
|
@ -827,8 +827,13 @@ static int _get_settings(struct cmd_context *cmd)
|
||||
if (!_merge_synonym(cmd, resizable_ARG, resizeable_ARG) ||
|
||||
!_merge_synonym(cmd, allocation_ARG, allocatable_ARG) ||
|
||||
!_merge_synonym(cmd, allocation_ARG, resizeable_ARG) ||
|
||||
!_merge_synonym(cmd, virtualoriginsize_ARG, virtualsize_ARG) ||
|
||||
!_merge_synonym(cmd, metadatacopies_ARG, pvmetadatacopies_ARG))
|
||||
!_merge_synonym(cmd, virtualoriginsize_ARG, virtualsize_ARG))
|
||||
return EINVALID_CMD_LINE;
|
||||
|
||||
if ((!strncmp(cmd->command->name, "pv", 2) &&
|
||||
!_merge_synonym(cmd, metadatacopies_ARG, pvmetadatacopies_ARG)) ||
|
||||
(!strncmp(cmd->command->name, "vg", 2) &&
|
||||
!_merge_synonym(cmd, metadatacopies_ARG, vgmetadatacopies_ARG)))
|
||||
return EINVALID_CMD_LINE;
|
||||
|
||||
/* Zero indicates success */
|
||||
|
Loading…
x
Reference in New Issue
Block a user