1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

3292 Commits

Author SHA1 Message Date
Zdenek Kabelac
4d0793f0ec pool: rework handling of passed args
As now we can properly recognize all paramerters for pool creation,
we may drop PASS_ARG_  defines and rely on '_UNSELECTED' or 0 entries
as being those without user given args.

When setting are not given on command line - 'update' function
fill them from profiles or configuration. For this  'profile' arg
was needed to be passed around and since  'VG' itself is not needed,
it's been all replaced with 'cmd, profile, extents_size' args.
2017-03-10 19:33:01 +01:00
Zdenek Kabelac
1cfc1be85d parser: enable --metadataprofile for pool lvconvert
Lvconvert can use values from profile when caching.
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
07c24736e0 parser: allow --zero for pool conversion 2017-03-10 19:33:00 +01:00
Zdenek Kabelac
46820bfff3 lvconvert: share function for cache params
Reuse same code for getting/setting cache parameters with lvcreate.

So there is single one place how to get vars from profiles and configs.

Variables declarations are moved to start of function and
there is no need to initialize them as they are always
defined by functions get_cache_params() and get_pool_params().
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
f24a1f06b2 lvcreate: respecting profile settings 2017-03-10 19:33:00 +01:00
Zdenek Kabelac
36003df7e3 cache: extend usability of cache_set_params
Fix missing reset of '*settings' pointer when no args were given.

Handle cache_chunk settings like all other settings, so it is properly
updated only with non-zero settings and the existing cache-pool
chunk_size is not being reconfigured.
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
c598e65de9 cache: get and set cache params 2017-03-10 19:33:00 +01:00
Zdenek Kabelac
861992d874 lvconvert: replacing with goto
Split-off patch that just replaces returns with 'goto bad'
so there is single place to release  policy_settings.

In the next patch we will start to use some shared
function call between lvconvert and lvcreate
(effectively restoring previous logic which has got lost).
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
4184331965 cache: use UNSELECTED enum
Switch from _UNDEFINED to _UNSELECTED which is more describing
its value 0, while value -1 is better match for UNDEFINED.
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
b8cd0f4808 thin: add new ZERO/DISCARDS_UNSELECTED
To more easily recognize unselected state from select '0' state
add new 'THIN_ZERO_UNSELECTED' enum.
Same applies to THIN_DISCARDS_UNSELECTED.

For those we no longer need to use PASS_ARG_ZERO or PASS_ARG_DISCARDS.
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
8c72878cf2 pool: drop duplicated sign test
Avoid duplicate testing of '-' sign.
Already checked with arg_from_list_is_negative().
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
f221ba97c9 lvcreate: avoid rejecting --metadataprofile
Likely user normaly have used 'shortcut' --profile option which
is (for lvcreate) decoded as metadataprofile.

However full option was rejected.
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
fb38426d28 lvconvert: validate name before prompt
Before prompting make sure name fits.
2017-03-10 19:33:00 +01:00
Zdenek Kabelac
7ad57d55af lvconvert: indent and code simplification
Simple modifications to existing  _lvconvert_to_pool().
2017-03-10 19:33:00 +01:00
Heinz Mauelshagen
2fcbe34fe8 lvcreate: fix "striped" limit
Fix regression limiting number of stripes to 8.
Raise back to 128 as before.

Resolves: rhbz1389546
2017-03-10 18:57:06 +01:00
David Teigland
43388f1220 commands: fix missing skip condition in coverity fixes
Fix for commit 5e6ea4b7
2017-03-10 11:50:00 -06:00
David Teigland
5e6ea4b784 commands: coverity fixes 2017-03-10 10:54:42 -06:00
Bryn M. Reeves
c713745314 dmsetup: always initialise 'dms' in _stats_update_file() 2017-03-10 16:44:08 +00:00
Bryn M. Reeves
1f7ac54bc4 tools: add generated headers to .gitignore 2017-03-10 13:13:41 +00:00
Bryn M. Reeves
6a0f597727 dmsetup: always initialise 'mode' in filemap create functions
Older compilers cannot tell that the 'mode' variable is only
used in branches in which it is assigned:

dmsetup.c:5651: warning: "mode" may be used uninitialized in this function
dmsetup.c:5023: warning: "mode" may be used uninitialized in this function

Avoid this by always assigning the variable a value.
2017-03-10 12:17:25 +00:00
Bryn M. Reeves
baa8a9be4a dmstats: start dmfilemapd when creating or updating file maps
Launch an instance of the filemap monitoring daemon when creating,
or updating, a file mapped group, unless the --nomonitor switch is
given.

Unless --foreground is given the daemon will detach from the
terminal and run in the background until it is signaled or the
daemon termination conditions are met.

The --follow={inode|path} switch is added to control the daemon
behaviour when files are moved, unlinked, or renamed while they
are being monitored.

The daemon runs with the same verbosity as the dmstats command
that starts it.
2017-03-09 18:50:15 +00:00
David Teigland
aa31272223 lvresize: poolmetadatasize cannot use minus 2017-03-09 09:51:24 -06:00
Heinz Mauelshagen
6dfe1ce251 lvconvert: prompt when splitting off LV of a 2-legged raid1 LV
Splitting off an image LV of a 2-legged
raid1 LV causes loss of resilience.

Ask user to avoid uninformed loss of all resilience.

Don't ask for N > 2 legged raid1 LVs.

Adjust tests.
2017-03-09 13:59:47 +01:00
Heinz Mauelshagen
413164765f lvconvert: remove superfluous compile time conditonal code 2017-03-09 12:16:11 +01:00
Heinz Mauelshagen
d250aa7208 lvconvert: prompt when splitting off a tracked LV of a 2-legged raid1 LV
Splitting off an image LV of a 2-legged raid1 LV tracking changes
causes loosing partial resilience for any newly written data set.
Full resilience will be provided again after the split off image LV
got merged back in and the new data set got fully synchronized.
Reason being that the data is only stored on the remaining single
writable image during the split.

Ask user to avoid uninformed loss of such partial resilience.

Don't ask for N > 2 legged raid1 LVs.
2017-03-09 03:22:55 +01:00
Heinz Mauelshagen
7fbe6ef16b lvconvert: prompt when converting raid1 to linear
Ask user when converting raid1 to linear to avoid
uninformed loss of all resilience.
2017-03-09 02:39:49 +01:00
David Teigland
b4e78b26f5 help: fix missing required option
Fix for previous commit 4d0172ff15.
2017-03-08 15:00:27 -06:00
David Teigland
4d0172ff15 man/help: use order of required options from cmd def
Follow the same as written in command-lines.in
2017-03-08 14:51:08 -06:00
David Teigland
3d5182c819 man: add more references to topical man pages 2017-03-08 14:43:30 -06:00
David Teigland
a6a2788e7c commands: clean up and unify signed option value handling
Add new values for different sign variations, resulting in:

size_VAL      no sign accepted
ssize_VAL     accepts + or -
psize_VAL     accepts +
nsize_VAL     accpets -

extents_VAL   no sign accepted
sextents_VAL  accepts + or -
pextents_VAL  accepts +
nextents_VAL  accepts -

Depending on the command being run, change the option
values for --size, --extents, --poolmetadatasize to
use the appropriate value from above.

lvcreate uses no sign (but accepts + and ignores it).
lvresize accepts +|- for a relative change.
lvextend accepts + for a relative change.
lvreduce accepts - for a relative change.
2017-03-08 12:54:43 -06:00
David Teigland
11f1556d5d commands: combine duplicate arrays for lv types and props
Like opt and val arrays in previous commit, combine duplicate
arrays for lv types and props in command.c and lvmcmdline.c.
Also move the command_names array to be defined in command.c
so it's consistent with the others.
2017-03-08 11:03:02 -06:00
David Teigland
690f604733 commands: combine duplicate arrays for opt and val
command.c and lvmcmdline.c each had a full array defining
all options and values.  This duplication was not removed
when the command.c code was merged into the run time.
2017-03-08 11:03:02 -06:00
David Teigland
f48e6b2690 help: avoid end notes repetition in lvm help all 2017-03-08 11:03:02 -06:00
David Teigland
0b019c5406 man/help: improve stripes option wording 2017-03-06 12:20:33 -06:00
David Teigland
11589891d7 man: move the full UNIT description
Part of the UNIT description was still living in the
--size description.  Move it to the Size[UNIT] description
since it is used by other options, not just --size.
2017-03-03 16:12:02 -06:00
David Teigland
b6c4b7cfb0 man/help: poolmetadatasize option can take relative value
In lvcreate/lvconvert, --poolmetdatasize can only be an
absolute value, but in lvresize/lvextend, --poolmetadatasize
can be given a + relative value.

The val types only currently support relative values that
go in both directions +|-.  Further work is needed to add
val types that can be relative in only one direction, and
switching various option values to one those depending on
the command name.  Then poolmetdatasize will not appear
with a +|- option in lvcreate/lvconvert, and will
appear with only the + option in lvresize/lvextend.
2017-03-03 16:12:02 -06:00
David Teigland
e4ef3d04ad help: show short opt with long opt
e.g. show -n|--name instead of just --name
2017-03-03 15:14:18 -06:00
David Teigland
9a50df291a man/help: rework extents and size output
Clean up and correct the details around --extents and --size.

lvcreate/lvresize/lvreduce/lvextend all now display the
extents option in usages.

The Size and Number value variables for --size and --extents
are now displayed without the [+|-] prefix for lvcreate.
2017-03-03 14:23:50 -06:00
David Teigland
e7ee89d80b man/help: improve the PV range description 2017-03-03 11:15:27 -06:00
David Teigland
2a5e24580a args: in cachemode option fix passthrough value 2017-03-03 10:53:18 -06:00
David Teigland
191a2517be args: update select description
mention --select help and --options help.
2017-03-03 09:53:11 -06:00
David Teigland
1a0d57f895 man lvcreate: show extents option
Display --extents as an option in each cmd def,
in addition to the special notes about how
--size and --extents are alternatives.
2017-03-02 16:58:19 -06:00
David Teigland
9a62767f2d man lvcreate: remove the extents prefix
This applies the same hack to --extents (dropping
the [+|-] prefix), as commit b7831fc14a did for --size.
2017-03-02 16:58:19 -06:00
David Teigland
5d39927f22 help: show extents option for lvcreate
A special case is needed to display
--extents for lvcreate since the cmd defs
treat --extents as an automatic alternative
to --size (to avoid duplicating every cmd def).
2017-03-02 16:58:19 -06:00
David Teigland
9b23d9bfe4 help: print info about special options and variables
when --longhelp is used
2017-03-02 16:58:19 -06:00
David Teigland
f350283398 lvcreate: munge size value in help output
Add hack to omit the [+|-] from the --size
value.  Same hack exists in man generator.
2017-03-02 16:58:19 -06:00
David Teigland
d3bcec5993 man: change the synopsis option style
Remove the required/optional words because it
should already be evident from the use of [ ].
2017-03-02 14:08:59 -06:00
David Teigland
910918d1c2 lvcreate: allow chunksize option when creating cache 2017-03-02 13:58:27 -06:00
David Teigland
6360ba3d2d commands: handle including an optional opt multiple times
When a cmd def includes multiple sets of options (OO_FOO),
allow multiple OO_FOO sets to contain the same option and
avoid repeating it in the cmd def.
2017-03-02 13:52:06 -06:00
David Teigland
b7831fc14a lvcreate/lvresize: the --size option accepts signed values
There was confusion in the code about whether or not the
--size option accepted a sign.  Make it consistent and clear
that it does.

This exposes a new problem in that an option can only
accept one value type, e.g. --size can only accept a
signed number, it cannot accept a positive or negative
number for some commands and reject negative numbers for
others.

In practice, lvcreate accepts only positive --size
values and lvresize accepts positive or negative --size
values.  There is currently no way to encode this
difference.  Until that is fixed, the man page output
is hacked to avoid printing the [+|-] prefix for sizes
in lvcreate.
2017-03-02 12:53:01 -06:00