]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agotests: make sure which PV is used for allocation
Zdenek Kabelac [Tue, 21 Feb 2017 08:38:04 +0000 (09:38 +0100)]
tests: make sure which PV is used for allocation

7 years agotests: paralelize creation and teardown
Zdenek Kabelac [Mon, 20 Feb 2017 23:49:49 +0000 (00:49 +0100)]
tests: paralelize creation and teardown

To speedup initial construction and destruction of test devices
(mainly in case more then 1 is needed)  call dmsetup
in parallel.

7 years agotests: use exclusive activation for mirror
Zdenek Kabelac [Mon, 20 Feb 2017 22:50:27 +0000 (23:50 +0100)]
tests: use exclusive activation for mirror

Test suite does not support clustered mirroring.

7 years agoman: use .HP instead of .TP
David Teigland [Mon, 20 Feb 2017 23:10:11 +0000 (17:10 -0600)]
man: use .HP instead of .TP

7 years agoman/help: print general raid type as "raid"
David Teigland [Mon, 20 Feb 2017 21:41:24 +0000 (15:41 -0600)]
man/help: print general raid type as "raid"

Instead of printing "raid*".  There are already
notes mentioning that "raid" refers to "raid<N>"

7 years agoman vgchange/lvchange: note special option usage
David Teigland [Mon, 20 Feb 2017 21:26:24 +0000 (15:26 -0600)]
man vgchange/lvchange: note special option usage

7 years agoman lvcreate: add special option notes at the start
David Teigland [Mon, 20 Feb 2017 21:17:10 +0000 (15:17 -0600)]
man lvcreate: add special option notes at the start

The --name, --size, --extents options deserve a special
note at the start of the man page, before appearing in
the usage section.

7 years agoman: add variables descriptions
David Teigland [Mon, 20 Feb 2017 21:09:02 +0000 (15:09 -0600)]
man: add variables descriptions

Add a section describing variables.

In the full options list, include common
options in the alphabetical listing instead
of at the end.

7 years agolvresize/lvextend: accept type option
David Teigland [Mon, 20 Feb 2017 17:23:46 +0000 (11:23 -0600)]
lvresize/lvextend: accept type option

The --type option has previously been accepted for
lvresize/lvextend.  Using it did not affect the operation
of the command.  The value was simply verified as matching
the current seg type of the LV.

7 years agotests: update lvresize testing
Zdenek Kabelac [Sun, 19 Feb 2017 21:59:21 +0000 (22:59 +0100)]
tests: update lvresize testing

Add missing tests for some lvresize acceptable options.

7 years agocleanup: simplier code
Zdenek Kabelac [Sat, 18 Feb 2017 18:46:22 +0000 (19:46 +0100)]
cleanup: simplier code

Already know string is 'lvm-' so use name[3].

7 years agocleanup: same sign for compare
Zdenek Kabelac [Sat, 18 Feb 2017 18:45:17 +0000 (19:45 +0100)]
cleanup: same sign for compare

7 years agocleanup: use multiline string
Zdenek Kabelac [Sat, 18 Feb 2017 18:09:24 +0000 (19:09 +0100)]
cleanup: use multiline string

7 years agocleanup: use const
Zdenek Kabelac [Sat, 18 Feb 2017 17:50:22 +0000 (18:50 +0100)]
cleanup: use const

7 years agoman: thin dmeventd plugin update
Zdenek Kabelac [Sun, 19 Feb 2017 14:50:19 +0000 (15:50 +0100)]
man: thin dmeventd plugin update

Document new dmeventd/thin_command lvm.conf configurable.

7 years agoman: dmstats update
Zdenek Kabelac [Sun, 19 Feb 2017 14:51:06 +0000 (15:51 +0100)]
man: dmstats update

Fixing colorization bugs

7 years agoman: dmsetup update
Zdenek Kabelac [Sun, 19 Feb 2017 14:50:49 +0000 (15:50 +0100)]
man: dmsetup update

7 years agocommands: fix memleak
Zdenek Kabelac [Sat, 18 Feb 2017 17:49:19 +0000 (18:49 +0100)]
commands: fix memleak

Keep all allocations 'mempool' allocated for simple cleanup.

7 years agolvresize: fix regressiong on accepting args
Zdenek Kabelac [Sun, 19 Feb 2017 18:08:48 +0000 (19:08 +0100)]
lvresize: fix regressiong on accepting args

Commit f45b68940667563e1a8d3bbd5d30864c04381bdf caused regression
of lvresize -m and --type  parameter

After fix this sequence may work when we also fix syntax description:

lvcreate -l1 -m1 -n lv1 vg
lvextend --type mirror -m1 -l+1 vg/lv1

7 years agoman/help: fix description of r|R unit
David Teigland [Fri, 17 Feb 2017 21:44:26 +0000 (15:44 -0600)]
man/help: fix description of r|R unit

7 years agoman: print space before built-in name
David Teigland [Fri, 17 Feb 2017 21:33:04 +0000 (15:33 -0600)]
man: print space before built-in name

print 'lvm config' not 'lvm-config'

7 years agoman pvmove: move details to notes
David Teigland [Fri, 17 Feb 2017 21:28:00 +0000 (15:28 -0600)]
man pvmove: move details to notes

7 years agoman: mention force behavior in various places
David Teigland [Fri, 17 Feb 2017 21:11:19 +0000 (15:11 -0600)]
man: mention force behavior in various places

7 years agoman lvmconfig: refer to typeconfig option name
David Teigland [Fri, 17 Feb 2017 20:46:10 +0000 (14:46 -0600)]
man lvmconfig: refer to typeconfig option name

7 years agoman/help: show recently added r|R unit
David Teigland [Fri, 17 Feb 2017 20:02:13 +0000 (14:02 -0600)]
man/help: show recently added r|R unit

7 years agoargs: in yes option mention qq for auto-no
David Teigland [Fri, 17 Feb 2017 20:42:13 +0000 (14:42 -0600)]
args: in yes option mention qq for auto-no

7 years agolvconvert: include swap behavior in generic pool syntax
David Teigland [Fri, 17 Feb 2017 17:45:13 +0000 (11:45 -0600)]
lvconvert: include swap behavior in generic pool syntax

For this syntax:
lvconvert --thinpool LV1 --poolmetadata LV2
lvconvert --cachepool LV1 --poolmetadata LV2

Restore the metadata swapping behavior in addition to
the pool creation behavior.  When LV1 is already a pool,
the metadata LV will be swapped with LV2.
When LV1 is not a pool, it will be converted to a
pool using the specified LV for metadata.

This syntax is no longer advertised because of the
ambiguous behavior.  The primary syntaxes for pool
creation and metadata swapping will be the advertised
methods.

7 years agocommands: compensate --uuid
Zdenek Kabelac [Fri, 17 Feb 2017 12:57:59 +0000 (13:57 +0100)]
commands: compensate --uuid

As we now user binary search - it's nondeterministict
which of the same 'args' will be give - so duplicates
need 'extra' care.

So provide same hack for output for --uuidstr_ARG as
for input.

Solves 'pvscan -u'.

7 years agocommands: some more dm wrappers
Zdenek Kabelac [Fri, 17 Feb 2017 12:36:57 +0000 (13:36 +0100)]
commands: some more dm wrappers

As man-generator is not liked with libdm as of now - some more wrappers.

7 years agocleanup: unused uninit vars
Zdenek Kabelac [Fri, 17 Feb 2017 12:16:27 +0000 (13:16 +0100)]
cleanup: unused uninit vars

7 years agocleanup: use strchr for 1-byte lookup
Zdenek Kabelac [Fri, 17 Feb 2017 12:09:06 +0000 (13:09 +0100)]
cleanup: use strchr for 1-byte lookup

7 years agocleanup: add comment for longer macro
Zdenek Kabelac [Fri, 17 Feb 2017 10:51:24 +0000 (11:51 +0100)]
cleanup: add comment for longer macro

7 years agocommands: optimize binary search
Zdenek Kabelac [Fri, 17 Feb 2017 09:00:43 +0000 (10:00 +0100)]
commands: optimize binary search

Since there is a lot of options and lot of searches,
use binary search to keep strcmp at minimum.

The interesting part is - alphabetically sorted array contains
duplicates and some of them are not the 'right anwer', so
after we find matching string but not matching long_ARG,
we may need to check if the surrouding strings are the right matching
one.

The single loops is used also for strictly define --foo_long
(i.e. --stripes)  and just differs at final part.

TODO1: replace strstr call with some flag (just like short_opt).
TODO2: drop '--' from being stored and tests by strcmp.

7 years agocommands: use dm_strncpy
Zdenek Kabelac [Fri, 17 Feb 2017 08:59:29 +0000 (09:59 +0100)]
commands: use dm_strncpy

Easier code using dm_strncpy() an dm_snprintf().

7 years agocommands: cheap optimisation for parser
Zdenek Kabelac [Fri, 17 Feb 2017 10:52:37 +0000 (11:52 +0100)]
commands: cheap optimisation for parser

Some low-hanging fruits to cut of signification number of strcmp calls.

7 years agocommands: track errors in command def parsing
David Teigland [Thu, 16 Feb 2017 21:26:42 +0000 (15:26 -0600)]
commands: track errors in command def parsing

When parsing command defs, track and report all
errors that are found.  Add an error return case
from define_commands so the standard error exit
path is used.

7 years agocommands: initialize commands[] once
David Teigland [Thu, 16 Feb 2017 19:59:52 +0000 (13:59 -0600)]
commands: initialize commands[] once

When using liblvm2cmd, a process can do multiple
init/exit calls, i.e.

lvm2_init(); lvm2_run(); lvm2_exit();
lvm2_init(); lvm2_run(); lvm2_exit();
...

define_commands() needs to set up the global commands[]
definitions only the first time.

7 years agocommands: avoid factoring options until needed
David Teigland [Thu, 16 Feb 2017 15:36:55 +0000 (09:36 -0600)]
commands: avoid factoring options until needed

7 years agohelp/man: remove commas from list of options
David Teigland [Wed, 15 Feb 2017 20:00:09 +0000 (14:00 -0600)]
help/man: remove commas from list of options

Using commas between options does not seem to
be done anywhere else, so remove them.

7 years agocommands: use dm wrappers for malloc/free
David Teigland [Wed, 15 Feb 2017 21:49:18 +0000 (15:49 -0600)]
commands: use dm wrappers for malloc/free

7 years agocommands: use existing vg/lv name parsing functions
David Teigland [Wed, 15 Feb 2017 21:06:52 +0000 (15:06 -0600)]
commands: use existing vg/lv name parsing functions

inside the new lv arg parsing function.

This includes getting the VG name from the env var,
and some added checks on the format of the vg/lv string.

7 years agolvcreate: fix LVM_VG_NAME detection
David Teigland [Wed, 15 Feb 2017 20:09:45 +0000 (14:09 -0600)]
lvcreate: fix LVM_VG_NAME detection

Commit d3af0e7528dbba30824379fc98cb4db437559ad5 was
not quite right in testing if the env var was set.

7 years agotoollib: skip dev prefix from lv names
David Teigland [Wed, 15 Feb 2017 19:42:35 +0000 (13:42 -0600)]
toollib: skip dev prefix from lv names

_get_arg_lvnames_using_options() was missing skip_dev_dir()

7 years agolvconvert: handle old arg quirk when combining snapshot
David Teigland [Wed, 15 Feb 2017 18:40:35 +0000 (12:40 -0600)]
lvconvert: handle old arg quirk when combining snapshot

The old ad hoc arg parsing when combining a split snapshot
allowed the first lv to have a vgname, but not the second.
Since lvconvert now uses the standard arg parsing in
process_each_lv(), the old one-off behavior requires a
work around.

7 years agolvcreate: LVM_VG_NAME applies even without name arg
David Teigland [Wed, 15 Feb 2017 18:07:51 +0000 (12:07 -0600)]
lvcreate: LVM_VG_NAME applies even without name arg

There was a small flaw in the logic regarding when LVM_VG_NAME
can replace a VG position arg.

7 years agoRevert "lvconvert: enable previous syntax to swap metadata"
David Teigland [Tue, 14 Feb 2017 22:02:54 +0000 (16:02 -0600)]
Revert "lvconvert: enable previous syntax to swap metadata"

This reverts commit 717363bb9427c02addeb22ef77396132cb30c782.

These alternate forms for swapping metadata cannot be
distinguished from the command for creating a pool.
If we were to add these alternate forms for swapping
metadata, we would need to overload the pool creation
command defs, making those definitions ambiguous.

7 years agocoverity cleanups
David Teigland [Tue, 14 Feb 2017 21:53:29 +0000 (15:53 -0600)]
coverity cleanups

7 years agoman-generator: fix compiler warnings
David Teigland [Tue, 14 Feb 2017 16:28:52 +0000 (10:28 -0600)]
man-generator: fix compiler warnings

7 years agoman/help: use separator in units list
David Teigland [Tue, 14 Feb 2017 16:20:38 +0000 (10:20 -0600)]
man/help: use separator in units list

h|H|b|B|... instead of hHbB...

7 years agocommands: skip parsing command defs for other command names
David Teigland [Tue, 14 Feb 2017 16:16:13 +0000 (10:16 -0600)]
commands: skip parsing command defs for other command names

The base command name can be used to skip parsing
command defs that will not be needed.

7 years agocommands: improve help/usage output
David Teigland [Tue, 14 Feb 2017 15:49:26 +0000 (09:49 -0600)]
commands: improve help/usage output

Replace --help --help with --long-help.
Some blank lines were needed.
Add 'lvm help all' to print help for all commands.

7 years agoMakefile: all_man also requires man-generator now
Alasdair G Kergon [Tue, 14 Feb 2017 13:24:31 +0000 (13:24 +0000)]
Makefile: all_man also requires man-generator now

7 years agomakefiles: missing deps
Zdenek Kabelac [Tue, 14 Feb 2017 09:24:25 +0000 (10:24 +0100)]
makefiles: missing deps

7 years agomakefiles: use configure vars
Zdenek Kabelac [Tue, 14 Feb 2017 08:48:24 +0000 (09:48 +0100)]
makefiles: use configure vars

Use binaries found in configure.

7 years agolibdm: move code for _stats_resize_group
Zdenek Kabelac [Tue, 14 Feb 2017 08:53:13 +0000 (09:53 +0100)]
libdm: move code for _stats_resize_group

Code is only needed when "fiemap.h" so keep it under single #ifdef.

7 years agoconfigure: update
Zdenek Kabelac [Mon, 13 Feb 2017 21:55:30 +0000 (22:55 +0100)]
configure: update

7 years agoactivation: trust 'pending' status reported by dmeventd
Zdenek Kabelac [Mon, 13 Feb 2017 21:50:19 +0000 (22:50 +0100)]
activation: trust 'pending' status reported by dmeventd

Only usleep when dmeventd reports 'pending' otherwise trust reported
state.

7 years agodmeventd: unify error handling
Zdenek Kabelac [Mon, 13 Feb 2017 18:00:59 +0000 (19:00 +0100)]
dmeventd: unify error handling

Always make sure the 'status' is release on 'error' path (thin pluging missed)
Make code looking same across all plugins.

7 years agocoverity cleanups for recent command defs commits
David Teigland [Mon, 13 Feb 2017 22:11:04 +0000 (16:11 -0600)]
coverity cleanups for recent command defs commits

7 years agoWHATS_NEW: changes for recent command defs
David Teigland [Mon, 13 Feb 2017 21:36:17 +0000 (15:36 -0600)]
WHATS_NEW: changes for recent command defs

7 years agoWHATS_NEW: items from command definitions patch set
David Teigland [Mon, 13 Feb 2017 21:22:26 +0000 (15:22 -0600)]
WHATS_NEW: items from command definitions patch set

7 years agolvconvert: enable previous syntax to swap metadata
David Teigland [Mon, 13 Feb 2017 20:40:53 +0000 (14:40 -0600)]
lvconvert: enable previous syntax to swap metadata

7 years agocommands: suggest --help if command doesn't match
David Teigland [Mon, 13 Feb 2017 19:46:17 +0000 (13:46 -0600)]
commands: suggest --help if command doesn't match

7 years agogenerate man pages
David Teigland [Fri, 10 Feb 2017 22:20:19 +0000 (16:20 -0600)]
generate man pages

7 years agoargs: use arg parsing function for region size
David Teigland [Tue, 7 Feb 2017 21:12:24 +0000 (15:12 -0600)]
args: use arg parsing function for region size

Consolidate the validation of the region size arg
in a new arg parsing function.

7 years agolvconvert: remove code for changing region size
David Teigland [Tue, 7 Feb 2017 21:01:30 +0000 (15:01 -0600)]
lvconvert: remove code for changing region size

from the generic raid type conversion code.

7 years agolvconvert: add command to change region size of a raid LV
David Teigland [Tue, 7 Feb 2017 17:52:13 +0000 (11:52 -0600)]
lvconvert: add command to change region size of a raid LV

7 years agovgchange: fix uint32 parsing of logicalvolume arg
David Teigland [Mon, 6 Feb 2017 22:10:09 +0000 (16:10 -0600)]
vgchange: fix uint32 parsing of logicalvolume arg

7 years agocommands: recognize raid variations
David Teigland [Mon, 6 Feb 2017 17:51:06 +0000 (11:51 -0600)]
commands: recognize raid variations

7 years agocommands: move command def parsing into lvm binary
David Teigland [Fri, 10 Feb 2017 17:36:11 +0000 (11:36 -0600)]
commands: move command def parsing into lvm binary

It was previously done at build time by the ccmd binary.

7 years agolvconvert: remove unused code
David Teigland [Fri, 10 Feb 2017 17:34:12 +0000 (11:34 -0600)]
lvconvert: remove unused code

For "split" which is not an alias for splitmirrors.

7 years agoargs: split is a synonym for splitcache
David Teigland [Thu, 19 Jan 2017 19:47:24 +0000 (13:47 -0600)]
args: split is a synonym for splitcache

also tidy the other synonyms

7 years agoman: lvmthin updates
David Teigland [Mon, 16 Jan 2017 22:26:14 +0000 (16:26 -0600)]
man: lvmthin updates

Some minor changes to some of the command syntaxes
to use more standard forms.

7 years agoccmd: split into multiple files
David Teigland [Thu, 12 Jan 2017 20:44:58 +0000 (14:44 -0600)]
ccmd: split into multiple files

7 years agocommand struct: remove command name refs
David Teigland [Fri, 13 Jan 2017 21:08:51 +0000 (15:08 -0600)]
command struct: remove command name refs

Change run time access to the command_name struct
cmd->cname instead of indirectly through
cmd->command->cname. This removes the two run time
fields from struct command.

7 years agocommand.h comment tidying
David Teigland [Fri, 13 Jan 2017 20:51:50 +0000 (14:51 -0600)]
command.h comment tidying

7 years agolvm shell: clear argv for each command
David Teigland [Fri, 13 Jan 2017 18:02:06 +0000 (12:02 -0600)]
lvm shell: clear argv for each command

7 years agohelp: accept positional args
David Teigland [Fri, 13 Jan 2017 17:31:49 +0000 (11:31 -0600)]
help: accept positional args

lvm help <commandname> ...

7 years agofix lvmcmdline warning
David Teigland [Thu, 12 Jan 2017 20:36:31 +0000 (14:36 -0600)]
fix lvmcmdline warning

declaration of ‘usage’ shadows a globa

7 years agoman lvm: remove options
David Teigland [Thu, 12 Jan 2017 22:08:53 +0000 (16:08 -0600)]
man lvm: remove options

all options are now included in commands

7 years agoargs: add man page descriptions
David Teigland [Fri, 6 Jan 2017 22:56:59 +0000 (16:56 -0600)]
args: add man page descriptions

7 years agoargs: use uint32 arg for maxphysicalvolumes
David Teigland [Tue, 3 Jan 2017 21:52:27 +0000 (15:52 -0600)]
args: use uint32 arg for maxphysicalvolumes

7 years agolvconvert: remove unused code
David Teigland [Tue, 20 Dec 2016 21:17:48 +0000 (15:17 -0600)]
lvconvert: remove unused code

7 years agolvconvert: use command defs for raid/mirror types
David Teigland [Mon, 19 Dec 2016 21:53:21 +0000 (15:53 -0600)]
lvconvert: use command defs for raid/mirror types

All lvconvert functionality has been moved out of the
previous monolithic lvconvert code, except conversions
related to raid/mirror/striped/linear.  This switches
that remaining code to be based on command defs, and
standard process_each_lv arg processing.  This final
switch results in quite a bit of dead code that is
also removed.

7 years agotests: use swapmetadata
David Teigland [Fri, 9 Dec 2016 21:54:59 +0000 (15:54 -0600)]
tests: use swapmetadata

and some other pool/cache/thin related changes

7 years agolvconvert: use command defs for mergemirrors
David Teigland [Fri, 9 Dec 2016 20:39:57 +0000 (14:39 -0600)]
lvconvert: use command defs for mergemirrors

and route the generic --merge to one of the
specific merge functions

7 years agotoollib: find VG name in option values when needed
David Teigland [Fri, 9 Dec 2016 19:30:42 +0000 (13:30 -0600)]
toollib: find VG name in option values when needed

7 years agolvconvert: use command defs for thin/cache/pool creation
David Teigland [Wed, 7 Dec 2016 20:30:57 +0000 (14:30 -0600)]
lvconvert: use command defs for thin/cache/pool creation

Everything related to thin and cache.

7 years agolvconvert: add startpoll command using command def
David Teigland [Mon, 19 Dec 2016 21:38:03 +0000 (15:38 -0600)]
lvconvert: add startpoll command using command def

This is a new explicit version of 'lvconvert LV'
which has been an obscure way of triggering polling
to be restarted on an LV that was previously converted.

7 years agolvconvert: snapshot: use command definitions
David Teigland [Fri, 18 Nov 2016 19:16:04 +0000 (13:16 -0600)]
lvconvert: snapshot: use command definitions

Lift all the snapshot utilities (merge, split, combine)
out of the monolithic lvconvert implementation, using
the command definitions.  The old code associated with
these commands is now unused and will be removed separately.

7 years agolvconvert: remove unused calls for repair and replace
David Teigland [Thu, 17 Nov 2016 22:04:59 +0000 (16:04 -0600)]
lvconvert: remove unused calls for repair and replace

repair and replace are no longer called from the
monolithic lvconvert code, so remove the unused code.

7 years agolvconvert: repair and replace: use command definitions
David Teigland [Thu, 17 Nov 2016 21:38:52 +0000 (15:38 -0600)]
lvconvert: repair and replace: use command definitions

This lifts the lvconvert --repair and --replace commands
out of the monolithic lvconvert implementation.  The
previous calls into repair/replace can no longer be
reached and will be removed in a separate commit.

7 years agolvchange: make use of command definitions
David Teigland [Wed, 16 Nov 2016 22:05:47 +0000 (16:05 -0600)]
lvchange: make use of command definitions

Reorganize the lvchange code to take advantage of
the command definition, and remove the validation
that is done by the command definintion rules.

7 years agoprocess_each_lv: add check_single_lv function
David Teigland [Tue, 29 Nov 2016 18:00:15 +0000 (12:00 -0600)]
process_each_lv: add check_single_lv function

The new check_single_lv() function is called prior to the
existing process_single_lv().  If the check function returns 0,
the LV will not be processed.

The check_single_lv function is meant to be a standard method
to validate the combination of specific command + specific LV,
and decide if the combination is allowed.  The check_single
function can be used by anything that calls process_each_lv.

As commands are migrated to take advantage of command
definitions, each command definition gets its own entry
point which calls process_each for itself, passing a
pair of check_single/process_single functions which can
be specific to the narrowly defined command def.

7 years agocommands: new method for defining commands
David Teigland [Fri, 12 Aug 2016 20:52:18 +0000 (15:52 -0500)]
commands: new method for defining commands

. Define a prototype for every lvm command.
. Match every user command with one definition.
. Generate help text and man pages from them.

The new file command-lines.in defines a prototype for every
unique lvm command.  A unique lvm command is a unique
combination of: command name + required option args +
required positional args.  Each of these prototypes also
includes the optional option args and optional positional
args that the command will accept, a description, and a
unique string ID for the definition.  Any valid command
will match one of the prototypes.

Here's an example of the lvresize command definitions from
command-lines.in, there are three unique lvresize commands:

lvresize --size SizeMB LV
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync, --reportformat String, --resizefs,
--stripes Number, --stripesize SizeKB, --poolmetadatasize SizeMB
OP: PV ...
ID: lvresize_by_size
DESC: Resize an LV by a specified size.

lvresize LV PV ...
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
--reportformat String, --resizefs, --stripes Number, --stripesize SizeKB
ID: lvresize_by_pv
DESC: Resize an LV by specified PV extents.
FLAGS: SECONDARY_SYNTAX

lvresize --poolmetadatasize SizeMB LV_thinpool
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
--reportformat String, --stripes Number, --stripesize SizeKB
OP: PV ...
ID: lvresize_pool_metadata_by_size
DESC: Resize a pool metadata SubLV by a specified size.

The three commands have separate definitions because they have
different required parameters.  Required parameters are specified
on the first line of the definition.  Optional options are
listed after OO, and optional positional args are listed after OP.

This data is used to generate corresponding command definition
structures for lvm in command-lines.h.  usage/help output is also
auto generated, so it is always in sync with the definitions.

Every user-entered command is compared against the set of
command structures, and matched with one.  An error is
reported if an entered command does not have the required
parameters for any definition.  The closest match is printed
as a suggestion, and running lvresize --help will display
the usage for each possible lvresize command.

The prototype syntax used for help/man output includes
required --option and positional args on the first line,
and optional --option and positional args enclosed in [ ]
on subsequent lines.

  command_name <required_opt_args> <required_pos_args>
          [ <optional_opt_args> ]
          [ <optional_pos_args> ]

Command definitions that are not to be advertised/suggested
have the flag SECONDARY_SYNTAX.  These commands will not be
printed in the normal help output.

Man page prototypes are also generated from the same original
command definitions, and are always in sync with the code
and help text.

Very early in command execution, a matching command definition
is found.  lvm then knows the operation being done, and that
the provided args conform to the definition.  This will allow
lots of ad hoc checking/validation to be removed throughout
the code.

Each command definition can also be routed to a specific
function to implement it.  The function is associated with
an enum value for the command definition (generated from
the ID string.)  These per-command-definition implementation
functions have not yet been created, so all commands
currently fall back to the existing per-command-name
implementation functions.

Using per-command-definition functions will allow lots of
code to be removed which tries to figure out what the
command is meant to do.  This is currently based on ad hoc
and complicated option analysis.  When using the new
functions, what the command is doing is already known
from the associated command definition.

7 years agolvmlockd: test mode doesn't work
David Teigland [Thu, 15 Dec 2016 17:49:19 +0000 (11:49 -0600)]
lvmlockd: test mode doesn't work

The --test option is not yet compatible with shared VGs
because changes are made in lvmlockd that cannot be
reversed or faked.

7 years agotests: update
Zdenek Kabelac [Mon, 13 Feb 2017 08:32:28 +0000 (09:32 +0100)]
tests: update

7 years agotests: fix dev path
Zdenek Kabelac [Sun, 12 Feb 2017 21:28:40 +0000 (22:28 +0100)]
tests: fix dev path

Use proper device path for test devices.
Use mkfs.ext4 and drop  'echo y|' to it.
Use smaller device size to consume less memory and CPU time.

7 years agocleanup: use matching signed number comparation
Zdenek Kabelac [Sun, 12 Feb 2017 17:18:54 +0000 (18:18 +0100)]
cleanup: use matching signed number comparation

7 years agocleanup: use matching const type
Zdenek Kabelac [Sun, 12 Feb 2017 17:18:32 +0000 (18:18 +0100)]
cleanup: use matching const type

This page took 0.066067 seconds and 5 git commands to generate.