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

13704 Commits

Author SHA1 Message Date
Zdenek Kabelac
1c1ce2739e tests: some debug code
Checking if --deferred would make it any faster - but it's as slow
as without this new optional flag anyway (4.10).
2017-02-21 09:40:21 +01:00
Zdenek Kabelac
2a65e2d49e tests: ensure first call is version test
Check 'dmsetup version'  is called before starting any more
advanced logic in $DM_DEV_DIR.

Call also replaces mkdir as it creates needed path with control node.
2017-02-21 09:38:49 +01:00
Zdenek Kabelac
7c14004f69 tests: make sure which PV is used for allocation 2017-02-21 09:38:04 +01:00
Zdenek Kabelac
d409fec079 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.
2017-02-21 00:52:05 +01:00
Zdenek Kabelac
921d5972e8 tests: use exclusive activation for mirror
Test suite does not support clustered mirroring.
2017-02-21 00:52:05 +01:00
David Teigland
86a660be7b man: use .HP instead of .TP 2017-02-20 17:10:11 -06:00
David Teigland
e13639053b man/help: print general raid type as "raid"
Instead of printing "raid*".  There are already
notes mentioning that "raid" refers to "raid<N>"
2017-02-20 15:41:24 -06:00
David Teigland
d22cccdf63 man vgchange/lvchange: note special option usage 2017-02-20 15:36:30 -06:00
David Teigland
a2d2cd8777 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.
2017-02-20 15:36:30 -06:00
David Teigland
2396c50689 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.
2017-02-20 15:36:10 -06:00
David Teigland
4d29d9afb2 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.
2017-02-20 11:23:46 -06:00
Zdenek Kabelac
5f2639d01d tests: update lvresize testing
Add missing tests for some lvresize acceptable options.
2017-02-20 00:44:12 +01:00
Zdenek Kabelac
13dd1ca757 cleanup: simplier code
Already know string is 'lvm-' so use name[3].
2017-02-20 00:43:40 +01:00
Zdenek Kabelac
2260c6d1e6 cleanup: same sign for compare 2017-02-20 00:43:40 +01:00
Zdenek Kabelac
d8514b24e1 cleanup: use multiline string 2017-02-20 00:43:40 +01:00
Zdenek Kabelac
aff62c74b7 cleanup: use const 2017-02-20 00:43:40 +01:00
Zdenek Kabelac
f16ad760cb man: thin dmeventd plugin update
Document new dmeventd/thin_command lvm.conf configurable.
2017-02-20 00:43:12 +01:00
Zdenek Kabelac
cd24e6de89 man: dmstats update
Fixing colorization bugs
2017-02-19 22:59:43 +01:00
Zdenek Kabelac
665479b818 man: dmsetup update 2017-02-19 22:59:43 +01:00
Zdenek Kabelac
2a21a19d90 commands: fix memleak
Keep all allocations 'mempool' allocated for simple cleanup.
2017-02-19 22:59:43 +01:00
Zdenek Kabelac
87c89ac279 lvresize: fix regressiong on accepting args
Commit f45b689406 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
2017-02-19 22:59:43 +01:00
David Teigland
13944738d4 man/help: fix description of r|R unit 2017-02-17 15:44:26 -06:00
David Teigland
fab0d63121 man: print space before built-in name
print 'lvm config' not 'lvm-config'
2017-02-17 15:33:35 -06:00
David Teigland
87fe9328d3 man pvmove: move details to notes 2017-02-17 15:28:00 -06:00
David Teigland
6064b0359a man: mention force behavior in various places 2017-02-17 15:11:19 -06:00
David Teigland
50e0345f9d man lvmconfig: refer to typeconfig option name 2017-02-17 14:46:10 -06:00
David Teigland
10cb8e0ec0 man/help: show recently added r|R unit 2017-02-17 14:44:11 -06:00
David Teigland
3cf3943898 args: in yes option mention qq for auto-no 2017-02-17 14:44:11 -06:00
David Teigland
f88ce5fb99 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.
2017-02-17 13:20:15 -06:00
Zdenek Kabelac
56deed9d54 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'.
2017-02-17 13:57:59 +01:00
Zdenek Kabelac
00f299b932 commands: some more dm wrappers
As man-generator is not liked with libdm as of now - some more wrappers.
2017-02-17 13:36:57 +01:00
Zdenek Kabelac
238a79aac4 cleanup: unused uninit vars 2017-02-17 13:20:55 +01:00
Zdenek Kabelac
995f7aa92f cleanup: use strchr for 1-byte lookup 2017-02-17 13:20:55 +01:00
Zdenek Kabelac
46d6c7d3ad cleanup: add comment for longer macro 2017-02-17 13:20:55 +01:00
Zdenek Kabelac
772834e40a 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.
2017-02-17 13:20:55 +01:00
Zdenek Kabelac
582a272b3f commands: use dm_strncpy
Easier code using dm_strncpy() an dm_snprintf().
2017-02-17 13:11:33 +01:00
Zdenek Kabelac
80b717af0c commands: cheap optimisation for parser
Some low-hanging fruits to cut of signification number of strcmp calls.
2017-02-17 13:00:05 +01:00
David Teigland
298b11aed1 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.
2017-02-16 15:26:42 -06:00
David Teigland
1cb95fa5a0 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.
2017-02-16 13:59:52 -06:00
David Teigland
15f51bc421 commands: avoid factoring options until needed 2017-02-16 09:37:28 -06:00
David Teigland
22bee4fbdb help/man: remove commas from list of options
Using commas between options does not seem to
be done anywhere else, so remove them.
2017-02-15 15:51:46 -06:00
David Teigland
81c0ed9fc6 commands: use dm wrappers for malloc/free 2017-02-15 15:49:18 -06:00
David Teigland
6a5c9ba349 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.
2017-02-15 15:28:54 -06:00
David Teigland
2556498ee1 lvcreate: fix LVM_VG_NAME detection
Commit d3af0e7528 was
not quite right in testing if the env var was set.
2017-02-15 14:10:46 -06:00
David Teigland
4a30f5f9b0 toollib: skip dev prefix from lv names
_get_arg_lvnames_using_options() was missing skip_dev_dir()
2017-02-15 13:42:35 -06:00
David Teigland
286d39ee3c 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.
2017-02-15 12:40:35 -06:00
David Teigland
d3af0e7528 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.
2017-02-15 12:07:51 -06:00
David Teigland
7417c8acfa Revert "lvconvert: enable previous syntax to swap metadata"
This reverts commit 717363bb94.

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.
2017-02-14 16:02:54 -06:00
David Teigland
d2c5bb5c70 coverity cleanups 2017-02-14 15:53:29 -06:00
David Teigland
1236e0ed29 man-generator: fix compiler warnings 2017-02-14 10:28:52 -06:00