1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
Commit Graph

9974 Commits

Author SHA1 Message Date
Zdenek Kabelac
dc11dcf11d filters: change return code
No data for writing should be seen as 'dump' success.
(reduces one <bactrace> in the log) - it has no other
effect.
2014-11-03 14:19:32 +01:00
Zdenek Kabelac
c1ee6d4ffc lvcreate: tollerate defaults
lvcreate -m0 and -Mn goes with anything.
Read ahead works either with pools or thin/cache, but not with both.
2014-11-03 14:19:32 +01:00
Zdenek Kabelac
ed2a0560ad libdm: init char array
When non-root uses dm_check_version() it's been printing some unit
values from stack. So always init those vars.
2014-11-03 14:19:31 +01:00
Zdenek Kabelac
e09ee21fd4 tests: update raid sync 2014-10-31 00:37:35 +01:00
Zdenek Kabelac
47d50a8f27 tests: wait for raid sync 2014-10-31 00:31:54 +01:00
Zdenek Kabelac
e7c130430a tests: explicitely use old snapshots 2014-10-31 00:28:25 +01:00
Zdenek Kabelac
8926230f6e tests: lvcreate snapshot usage update 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
b58a0f5cd3 tests: use aux func to disable device 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
da61e6355e tests: raid syncaction test
Add sync wait for syncaction of raid1 test.
--syncaction requires raid to be in sync first.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
fe245d78ff cleanup: shorter code 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
888b21e9bd cleanup: extents_from_size is 32bit value
Current lvm2 does support only 32bit extents count.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
9a6cf3d9f4 cleanup: prints and stacks 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
0da749c9a4 cleanup: remove unneeded assign 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
8bf4cd464f metadata: add extents_from_percent_size
Add API call to calculate extents from percentage value.
Size is based in DM_PERCENT_1 units.
(Supporting decimal point number).
This commit is preparing functionality for more global
usage of % with i.e. --size option.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
375d7f1c2d pv_manip: check for pe_ranges 2014-10-30 23:58:49 +01:00
Zdenek Kabelac
464f3b8abd lvmcmdline: support size_mb_arg_with_percent
New size_mb_arg_with_percent is able to read  size_mb_arg
but also it's able to read % values.

Percent parsing is share with int_arg_with_sign_and_percent.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
519fbe71e4 lvmcmdline: extra support for decimal point
If root has locales with different decimal point then '.'
(i.e. Czech with ',') lets be tolerant and retry with
"C" locales in the case '.' is found during parse of number.

Locales are then restored back.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
97cccfbf1c segtype: drop cmdcontex pointer
Users of context provide their cmd pointer,
so don't keep it inside segtype.
2014-10-30 23:58:49 +01:00
Zdenek Kabelac
87fc3b710c lvcreate: improving recent lvcreate updates
We need to be able to parse:

lvcreate --type snapshot -s
lvcreate --type thin -s
lvcreate --type cache-pool -H
2014-10-30 23:58:48 +01:00
Zdenek Kabelac
651613e9a4 man: update lvcreate with sparse
Document sparse device creation and its default segtype selection.
2014-10-30 23:58:48 +01:00
Zdenek Kabelac
e6e647489d configure: autoreconf
Just rebuild after configure.in update.
2014-10-30 23:58:48 +01:00
Zdenek Kabelac
e0164f2188 sparse: configurable type for sparse volumes
Support compile type configurable defaults for creation
of sparse volumes.

By default now create 'thin-pools' for sparse volumes.
Use the global/sparse_segtype_default to switch back to old
snapshots if needed.

Apply the same compile logic for newly introduces mirror/raid1 options.
2014-10-30 23:58:48 +01:00
Zdenek Kabelac
87f59af15c configure: option cleanup
Drop double [[ ]] around default args.
(AC_HELP_STRING is already quoted so double [[]] are not needed).
2014-10-30 23:51:39 +01:00
Peter Rajnoha
7049eeeb83 test: for issue fixed in previous commit 2f7f6932dc 2014-10-27 11:53:01 +01:00
Peter Rajnoha
2f7f6932dc report: selection: fix selection criteria to not match reserved values when using >, <, >=, <
Some values are reserved for special purpose like 'undefined', 'unmanaged' etc.
When using >, <, >= and < comparison operators where the range is considered,
do not include reserved values as proper values in this range which
would otherwise result in not so obvious criteria match (as the reserved value is
actually transparent for the user). It's incorrect.

Example scenario:
$ vgs -o vg_name,vg_mda_copies vg1 vg2
  VG   #VMdaCps
  vg1          1
  vg2  unmanaged

The "unmanaged" is actually mapped onto reserved value
18446744073709551615 (2^64 - 1) internally.

Such reseved value is already caught on selection criteria input
properly:

$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=18446744073709551615'
  Numeric value 18446744073709551615 found in selection is reserved.

However, we still need to fix situaton where the reserved value may be
included in resulting range:

Before this patch:
$ vgs -o vg_name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies >= 1'
  VG   #VMdaCps
  vg1          1
  vg2  unmanaged

With this patch applied:
$ vgs -o vg_name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies >= 1'
  VG   #VMdaCps
  vg1         1

From the examples above, we can see that without this patch applied,
the vg_mda_copies >= 1 also matched the reserved value 18446744073709551615
(which is represented by the "unamanged" string on report). When
applying the operators, such values must be skipped! They're meant to
be matched only against their string representation only, e.g.:

$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=unmanaged'
  VG   #VMdaCps
  vg2  unmanaged

...or any synonyms:

$ vgs -o name,vg_mda_copies vg1 vg2 -S 'vg_mda_copies=undefined'
  VG   #VMdaCps
  vg2  unmanaged
2014-10-27 11:25:08 +01:00
Zdenek Kabelac
e223c801fc pools: workaround hints
Missing code for stacked hint estimation
2014-10-26 19:45:17 +01:00
Zdenek Kabelac
c28a7706ed tests: update cache creation tests 2014-10-26 18:37:13 +01:00
Zdenek Kabelac
7bbf3cf306 tests: lvcreate-update
Test with old mirror type.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
70616187b3 tests: pytest update 2014-10-26 18:37:13 +01:00
Zdenek Kabelac
205e3ff888 lvcreate: delay check for free extents
As the rounding for cache creation may change the value of extents
postpone check for free extents.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
c9fbbf48ba cache: support more args
Unlike with thin-pool - with cache we support all args also
directly when create cache volume.

So the result of 'separate' cache-pool creation and setting its
options should give same result as specifying those args
during cache creation.

Cache-pool values are used as defaults if the params are
not specified with cache creation.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
ff2e8b0de6 thin: simplify thin volume creation
Move code for creation of thin volume into a single place
out of lv_extend().  This allows to drop extra pool arg
for alloc_lv_segment() && lv_extend() and makes code
more easier to read and follow.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
52dfa6dd44 cache: apply chunk rounding also for cache creation.
When we create volumes with chunk size bigger then extent size
we try to round up to some nearest chunk boundary.
Until now we did this for thins - use same logic for
cache volumes.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
25307e4add pools: prefetch pool_lv and origin_lv
Load pool_lv and origin_lv at a single place and
use it for more types as they need them.
2014-10-26 18:37:13 +01:00
Zdenek Kabelac
618d818c0d lvm2app: update to new lv_create_single API
lv_create_single is more type based.
2014-10-26 18:37:13 +01:00
David Teigland
7916cae697 vg_read: Remove unused READ_WITHOUT_LOCK.
Unused since 67a7b7a87d:
  report: Iterate over labels instead of PVs for label-only reports.
(included in 2.02.105).
2014-10-24 21:54:04 +01:00
Zdenek Kabelac
c3bb9629a8 tests: syncaction needs kernel fix
Add 'should' as we currently cannot pass this test.

FIXME:
Add properly wrapper to not use 'should' with fixed kernel.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
e1dede6f6b tests: new lvcreate functionality
Fixed syntax parsing means that some commands that used to work are now
failing. Particullary this case:

$ invalid lvcreate -l1 --type thin vg/pool
> Needs to fail becase thin type LV needs  --virtualsize

$ invalid lvcreate --type snapshot vg/lv1
> Needs to fail because old-snapshot segment type needs --size

Some reported error messages have been also updated.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
9642f013a1 tests: lvcreate usage 2014-10-24 16:39:32 +02:00
Zdenek Kabelac
11ea72cfd8 mirror: extra parsing for mirrorlog arg
Put validation of mirrorlog arg into a separate function.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
29c14a1194 man: lvconvert/create updates
More description for cache support.
Introduce --pooldatasize option.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
fd00d2c6ec cache: separate func for pool/origin validation
Split validate_lv_cache_create() into 2 function
once is called for pool validation other for origin.

It's less misleading the accepting NULLs.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
298de1f5c3 segments: mark more of them unzeroable
Use segment flags to avoid zeroing of cache, cache pool
snapshot and thin pool segments.

We never want to zero these segment types.

Note:
Snapshot COW and Cache origin are created as stripes
thus are then properly zeroed.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
784c216d2b lvcreate: check for conflicting -Zy -Wy
Let the finaly state of zero & wipe_signature to be
resolved later together with all the types.

Don't play with zero assigment and segtype flag
(i.e. thin-pool -Z  has different meaning).

Check if the passed options do allow requested zeroing/wiping.

lvcreate without -Z or -W will fallback to warning if the device
cannot be zeroed, however if user requested them explicitely
it will give user error.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
c7484a139a toollib: persistent major minor
Deduce -M from presence of --minor, --major option if
not specified on command line.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
d13239b054 lvcreate: new validation code
Refactor lvcreate code.

Prefer to use arg_outside_list_is_set() so we get automatic 'white-list'
validation of supported options with different segment types.

Drop used lp->cache, lp->cache and use seg_is_cache(), seg_is_thin()

Draw clear border where is the last moment we could change create
segment type.

When segment type is given with --type - do not allow it to be changed
later.

Put together tests related to individual segment types.

Finish cache conversion at proper part of lv_manip code after
the vg_metadata are written - so we could correcly clean-up created
stripe LV for cache volume.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
51a29e6056 pools: error path removes metadata
When pool volume is create - it has already managed to update metadata
once within lv_extend - so revert new created LV here.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
dfcf03a9ce lvcreate: handle linear segment
Put in code to accept 'linear' segment type
(when specified stripes cannot be used)

Also report 'error' when unknown type is specified.
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
7359a9df88 pool: better error path handling
Move test for size of new LV names in front before
any creation of LV.

Properly check striped  segtype kernel presence,
since passed 'segtype' is already tested.

Keep deactivation error path local to wiping part of the function.

Create metadata with temporary flag (it's activated, zeroed
and deactivated).
2014-10-24 16:39:32 +02:00
Zdenek Kabelac
1632064281 cleanup: code move
Update comment and move code to new place.
Gets updated with next commit.
2014-10-24 16:39:32 +02:00