lvcreate: recognize --wipesignatures arg
PATCH 2/6 lvcreate: recognize --wipesignatures arg
Recognize the new --wipesignatures arg in lvcreate that is supposed to wipe known signatures if found on newly created LV.
--- lib/metadata/metadata-exported.h | 1 + liblvm/lvm_lv.c | 1 + tools/args.h | 1 + tools/commands.h | 4 +++- tools/lvcreate.c | 13 ++++++++----- 5 files changed, 14 insertions(+), 6 deletions(-)
lib/metadata/metadata-exported.h +1 -0
@@ -721,6 +721,7 @@ struct lvcreate_params {int thin;/* thin */ int create_thin_pool;/* thin */ int zero;/* all */ +int wipe_signatures;/* all */ int major;/* all */ int minor;/* all */ int log_count;/* mirror */
liblvm/lvm_lv.c +1 -0
@@ -129,6 +129,7 @@ static void _lv_set_default_params(struct lvcreate_params *lp, uint64_t extents) { lp->zero =1 ; + lp->wipe_signatures =0 ; lp->major =-1 ; lp->minor =-1 ; lp->activate =CHANGE_AY ;
tools/args.h +1 -0
@@ -176,6 +176,7 @@ arg(uuidlist_ARG, 'U', "uuidlist", NULL, 0) arg(verbose_ARG, 'v', "verbose", NULL, ARG_COUNTABLE) arg(volumegroup_ARG, 'V', "volumegroup", NULL, 0) arg(virtualsize_ARG, 'V', "virtualsize", size_mb_arg, 0) +arg(wipesignatures_ARG, 'W', "wipesignatures", yes_no_arg, 0) arg(allocatable_ARG, 'x', "allocatable", yes_no_arg, 0) arg(resizeable_ARG, 'x', "resizeable", yes_no_arg, 0)arg (yes_ARG,'y' ,"yes" ,NULL ,0 )
tools/commands.h +3 -1
@@ -248,6 +248,7 @@ xx(lvcreate,"\t[-t|--test]\n" "\t[--type VolumeType]\n" "\t[-v|--verbose]\n" +"\t[-W|--wipesignatures {y|n}]\n" "\t[-Z|--zero {y|n}]\n" "\t[--version]\n" "\tVolumeGroupName [PhysicalVolumePath...]\n\n"
@@ -294,7 +295,8 @@ xx(lvcreate, raidminrecoveryrate_ARG, raidmaxrecoveryrate_ARG, readahead_ARG, regionsize_ARG, setactivationskip_ARG, size_ARG, snapshot_ARG, stripes_ARG, stripesize_ARG, test_ARG, thin_ARG, thinpool_ARG, - type_ARG, virtualoriginsize_ARG, virtualsize_ARG, zero_ARG) + type_ARG, virtualoriginsize_ARG, virtualsize_ARG, + wipesignatures_ARG, zero_ARG) xx(lvdisplay, "Display information about a logical volume",
tools/lvcreate.c +8 -5
@@ -614,8 +614,8 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contexreturn 0 ; } }else if (lp->activate ==CHANGE_AAY ) { -if (arg_count (cmd, zero_ARG)) { -log_error ("-Z is incompatible with --activate a" ); +if (arg_count (cmd, zero_ARG) ||arg_count (cmd, wipesignatures_ARG)) { +log_error ("-Z and -W is incompatible with --activate a" );return 0 ; } lp->zero =0 ;
@@ -644,9 +644,11 @@ static int _read_activation_params(struct lvcreate_params *lp, struct cmd_contex lp->permission =arg_uint_value (cmd, permission_ARG,LVM_READ |LVM_WRITE ); -/* Must not zero read only volume */ -if (!(lp->permission &LVM_WRITE )) +/* Must not zero/wipe read only volume */ +if (!(lp->permission &LVM_WRITE )) { lp->zero =0 ; + lp->wipe_signatures =0 ; + }if (arg_count (cmd, major_ARG) >1 ) {log_error ("Option -j/--major may not be repeated." );
@@ -867,10 +869,11 @@ static int _lvcreate_params(struct lvcreate_params *lp, }/* -* Should we zero the lv. +* Should we zero/wipe signatures on the lv. */ lp->zero =strcmp (arg_str_value (cmd, zero_ARG, (lp->segtype->flags &SEG_CANNOT_BE_ZEROED ) ?"n" :"y" ),"n" ); + lp->wipe_signatures =strcmp (arg_str_value (cmd, wipesignatures_ARG,"n" ),"n" ); if (!_lvcreate_name_params(lp, cmd, &argc, &argv) || !_read_size_params(lp, lcp, cmd) ||
Signature · 1 line
1.8.4.2