]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agolvcreate: regression fix on lv name limits
Zdenek Kabelac [Tue, 7 Oct 2014 13:41:54 +0000 (15:41 +0200)]
lvcreate: regression fix on lv name limits

When we are given an existing LV name - it needs to be allowed
to pass in even restricted name as the LV could have existed
long before we introduced some new restriction on prefix/suffix.i

Fix the regression on name limits and drop restriction to be applied
on any existing LVs - only the new created LV names have to be
complient with current name restrictions.

FIXME: we are currently using restricted names incorrectly in few
other places - device_is_usable() skips restricted names,
and udev flags are also incorrectly set for restricted names
so these LVs are not getting links properly.

9 years agocleanup: rename _name, _lv and _size
Zdenek Kabelac [Tue, 7 Oct 2014 08:43:47 +0000 (10:43 +0200)]
cleanup: rename _name, _lv and _size

Use some standard names for lv char * names, logical_volume * lv
and sizes internally.

9 years agotests: typos
Zdenek Kabelac [Mon, 6 Oct 2014 21:25:49 +0000 (23:25 +0200)]
tests: typos

9 years agotests: put devs into ""
Zdenek Kabelac [Tue, 7 Oct 2014 07:54:47 +0000 (09:54 +0200)]
tests: put devs into ""

9 years agotests: check for cache and raid
Zdenek Kabelac [Tue, 7 Oct 2014 08:12:49 +0000 (10:12 +0200)]
tests: check for cache and raid

Skip some tests on systems without cache or raid.

9 years agotests: move cache raid to separate file
Zdenek Kabelac [Tue, 7 Oct 2014 08:12:39 +0000 (10:12 +0200)]
tests: move cache raid to separate file

9 years agocleanup: dont hide pv_dev declaration from pv
Zdenek Kabelac [Tue, 7 Oct 2014 08:17:34 +0000 (10:17 +0200)]
cleanup: dont hide pv_dev declaration from pv

Just skip using local vars here...

9 years agotest: Creating a cache on top of active RAID works now.
Petr Rockai [Tue, 7 Oct 2014 07:31:21 +0000 (09:31 +0200)]
test: Creating a cache on top of active RAID works now.

9 years agometadata: add internal error if PV has no existing device attached during find_pv_in_vg
Peter Rajnoha [Tue, 7 Oct 2014 06:58:51 +0000 (08:58 +0200)]
metadata: add internal error if PV has no existing device attached during find_pv_in_vg

find_pv_in_vg fn iterates over the list of PVs covered by the VG and
each PV's pvl->pv->dev is compared with device acquired from device
cache. However, in case pvl->pv->dev is NULL as well as device cache
returns NULL (e.g. when device is filtered), we'll get incorrect match
and the code calling find_pv_in_vg uses incorrect PV (as it thinks
it's the exact PV with the pv_name). The INTERNAL_ERROR covers this
situation and errors out immediately.

9 years agolvconvert: Allow --repair and --splitmirrors on reserved-name LVs.
Petr Rockai [Tue, 7 Oct 2014 06:55:09 +0000 (08:55 +0200)]
lvconvert: Allow --repair and --splitmirrors on reserved-name LVs.

9 years agotest: Add process-each toollib tests.
David Teigland [Tue, 7 Oct 2014 00:08:03 +0000 (01:08 +0100)]
test: Add process-each toollib tests.

9 years agometadata: Use flags to control warnings.
David Teigland [Tue, 7 Oct 2014 00:04:09 +0000 (01:04 +0100)]
metadata: Use flags to control warnings.

The warnings arg was used to enable logging of warnings
when reading a PV.  This arg is turned into a set of flags
with the WARN_PV_READ flag matching the existing behavior.

A new flag WARN_INCONSISTENT is added that will cause
vg_read_internal() to log the "VG is not consistent"
warning so the various callers do not need to log
this warning themselves.

A new vg_read flag READ_WARN_INCONSISTENT is used from
reporting to enable the WARN_INCONSISTENT flag in
vg_read_internal.

[Committed by agk with cosmetic changes and tweaks.]

9 years agovgreduce: Use process_each_pv.
David Teigland [Mon, 6 Oct 2014 23:53:56 +0000 (00:53 +0100)]
vgreduce: Use process_each_pv.

Adapt process_each_pv for use by vgreduce in the non-repair case.

[Committed by agk with cosmetic changes and tweaks.]

9 years agotoollib: Rewrite process_each_pv.
David Teigland [Mon, 6 Oct 2014 23:34:04 +0000 (00:34 +0100)]
toollib: Rewrite process_each_pv.

Process PVs by iterating through VGs, then iterating through
devices if the command needs to process non-PV devices.
The process_single function can always use the VG and PV args.

[Committed by agk with cosmetic changes and tweaks.]

9 years agolvmcache: Skip VG_GLOBAL cache lock state update.
Alasdair G Kergon [Mon, 6 Oct 2014 23:30:28 +0000 (00:30 +0100)]
lvmcache: Skip VG_GLOBAL cache lock state update.

Avoids message:
  Metadata cache has no info for vgname: "#global"

9 years agoman: lvmcache mention automatic pool conversion
David Teigland [Mon, 6 Oct 2014 21:12:51 +0000 (16:12 -0500)]
man: lvmcache mention automatic pool conversion

When converting an origin to a cache lv, lvm will automatically convert
the specified cache pool into a cache pool if it is not already a cache
pool.

9 years agotoollib: Shuffle PV functions.
Alasdair G Kergon [Mon, 6 Oct 2014 21:02:00 +0000 (22:02 +0100)]
toollib: Shuffle PV functions.

9 years agoman: lvmcache changes related to removal and splitting
David Teigland [Mon, 6 Oct 2014 19:04:09 +0000 (14:04 -0500)]
man: lvmcache changes related to removal and splitting

9 years agoman: lvmthin show the lvcreate -n option for pools
David Teigland [Mon, 6 Oct 2014 18:29:18 +0000 (13:29 -0500)]
man: lvmthin show the lvcreate -n option for pools

lvcreate of thin pools can now use '-n lv vg' like other lv types,
or it can name the new thin pool in the free arg as 'vg/lv', which
is not allowed with other lv types.

9 years agotoollib: Remove unused functions from header file.
Alasdair G Kergon [Mon, 6 Oct 2014 14:22:01 +0000 (15:22 +0100)]
toollib: Remove unused functions from header file.

9 years agotests: lvconvert cache usage of thin pool
Zdenek Kabelac [Mon, 6 Oct 2014 13:30:19 +0000 (15:30 +0200)]
tests: lvconvert cache usage of thin pool

Checked stacking usage of thin pool data volume being cached.

9 years agotests: lvconvert thin pool
Zdenek Kabelac [Mon, 6 Oct 2014 09:56:09 +0000 (11:56 +0200)]
tests: lvconvert thin pool

More tests.

9 years agotests: lvconvert cache
Zdenek Kabelac [Mon, 6 Oct 2014 09:49:49 +0000 (11:49 +0200)]
tests: lvconvert cache

Many new tests

9 years agotests: lvcreate external origin
Zdenek Kabelac [Mon, 6 Oct 2014 09:52:40 +0000 (11:52 +0200)]
tests: lvcreate external origin

Fix unsupportable case.
We cannot create thinpool and snapshot at the same time.
(-L could not have 2 meanings).

9 years agotests: lvcreate thin-pool support --name
Zdenek Kabelac [Sun, 5 Oct 2014 18:00:39 +0000 (20:00 +0200)]
tests: lvcreate thin-pool support --name

9 years agotests: lvcreate cache interface updates
Zdenek Kabelac [Fri, 3 Oct 2014 17:02:37 +0000 (19:02 +0200)]
tests: lvcreate cache interface updates

9 years agocleanup: indent
Zdenek Kabelac [Mon, 6 Oct 2014 10:10:00 +0000 (12:10 +0200)]
cleanup: indent

9 years agocleanup: typo update
Zdenek Kabelac [Tue, 30 Sep 2014 19:01:05 +0000 (21:01 +0200)]
cleanup: typo update

9 years agocleanup: error is already logged
Zdenek Kabelac [Mon, 6 Oct 2014 10:01:21 +0000 (12:01 +0200)]
cleanup: error is already logged

Function get_only_segment_using_this_lv() already prints error,
no need to show more internal logic to user as an error.

9 years agocleanup: lvconvert use standard function exit
Zdenek Kabelac [Sat, 4 Oct 2014 15:17:49 +0000 (17:17 +0200)]
cleanup: lvconvert use standard function exit

Use 1|0 inside _lvconvert_splitsnapshot to match rest of code.

9 years agovalidation: use validate_pool_chunk_size
Zdenek Kabelac [Mon, 6 Oct 2014 09:54:25 +0000 (11:54 +0200)]
validation: use validate_pool_chunk_size

We could validation pool chunk size with a single function.

9 years agovalidation: share more code for pool validation
Zdenek Kabelac [Fri, 3 Oct 2014 16:48:42 +0000 (18:48 +0200)]
validation: share more code for pool validation

Reuse thin validation code for cache pool validation.

9 years agolvcreate: validate sizes
Zdenek Kabelac [Mon, 6 Oct 2014 11:54:34 +0000 (13:54 +0200)]
lvcreate: validate sizes

Earlier validation of --size and --extents.
Reject 0 size on command line instantly.

9 years agotoolib: early validation of chunk size
Zdenek Kabelac [Sat, 4 Oct 2014 20:36:41 +0000 (22:36 +0200)]
toolib: early validation of chunk size

Since we now have validate_pool_chunk_size() we could
validate entered values directly prior openning vg.

9 years agopool: use validation
Zdenek Kabelac [Mon, 6 Oct 2014 10:22:51 +0000 (12:22 +0200)]
pool: use validation

9 years agopool: validate_pool_chunk_size
Zdenek Kabelac [Mon, 6 Oct 2014 10:18:57 +0000 (12:18 +0200)]
pool: validate_pool_chunk_size

Introduce pool function for validation of chunk size.
It's good idea to be able to reject invalid chunk size
when entered on command line before we open VG.

9 years agoman: document -ff for removal
Zdenek Kabelac [Sat, 4 Oct 2014 15:06:51 +0000 (17:06 +0200)]
man: document -ff for removal

Make it visible in man page that -ff could make removal
process proceed in case of damaged pool.

9 years agovg/lvremove: support --yes
Zdenek Kabelac [Sat, 4 Oct 2014 15:05:29 +0000 (17:05 +0200)]
vg/lvremove: support --yes

Make --yes equivalent to DONT_PROMT (--force).

So user could use 'lvremove --yes vg/lvol1' skipping prompt.

9 years agoman: lvconvert new split options
Zdenek Kabelac [Mon, 6 Oct 2014 12:43:25 +0000 (14:43 +0200)]
man: lvconvert new split options

Update man page with info how to split/uncache cached logical
volumes.

lvconvert: splitsnapshot support --yes

Allow to use --yes to skip prompt.

9 years agolvconvert: splitsnapshot supports --yes
Zdenek Kabelac [Mon, 6 Oct 2014 12:42:47 +0000 (14:42 +0200)]
lvconvert: splitsnapshot supports --yes

Handle --yes arg to skip prompt.

9 years agolvconvert more test for thin external origin
Zdenek Kabelac [Mon, 6 Oct 2014 11:15:31 +0000 (13:15 +0200)]
lvconvert more test for thin external origin

Some LV types were not properly disallowed to be used as external origin.

9 years agolvconvert: cache and thin conversion validation
Zdenek Kabelac [Mon, 6 Oct 2014 11:44:59 +0000 (13:44 +0200)]
lvconvert: cache and thin conversion validation

More test for supported conversion.

9 years agolvconvert: validate cache conversion to snapshot
Zdenek Kabelac [Mon, 6 Oct 2014 10:27:35 +0000 (12:27 +0200)]
lvconvert: validate cache conversion to snapshot

Cache cannot be converted into snapshot cow nor origin.

9 years agocache: use same alg for cache size calc
Zdenek Kabelac [Mon, 6 Oct 2014 10:22:03 +0000 (12:22 +0200)]
cache: use same alg for cache size calc

Use the same algorithm for cache metadata size as the cache tool is using.

9 years agocache: improve creation code
Zdenek Kabelac [Fri, 3 Oct 2014 21:51:54 +0000 (23:51 +0200)]
cache: improve creation code

Move code to better locations.
Improve test and remove invalid ones
(i.e. no reason to require cache size to be >= then origin).

Correctly comment where the code is doing actual conversion
of other existing volume - we do already a similar thing with
external origins.

Lots of new command line options and combinations is now supported.
Hopefully older syntax still works as well.

lvcreate --cache --cachepool vg/pool  -l1
lvcreate --type cache --cachepool vg/pool  -l1
lvcreate --type cache-pool vg/pool  -l1
lvcreate --type cache-pool --name pool vg  -l1
... and many many more ...

9 years agolvremove: detect cluster wide active state
Zdenek Kabelac [Fri, 3 Oct 2014 21:49:57 +0000 (23:49 +0200)]
lvremove: detect cluster wide active state

If the LV is active remotely do not skip question for deactivation.

9 years agocache: check activation of volume activated
Zdenek Kabelac [Fri, 3 Oct 2014 21:48:42 +0000 (23:48 +0200)]
cache: check activation of volume activated

volume_list may silently skip activation which is then still reported as
success.

9 years agocache: lvremoved cached LV removes cache pool
Zdenek Kabelac [Fri, 3 Oct 2014 21:36:11 +0000 (23:36 +0200)]
cache: lvremoved cached LV removes cache pool

When we remove cached volume, whole tree must go down.
There is  'lvconvert --splitcache' to preserve cache pool.

9 years agopools: move removal of _pmspare
Zdenek Kabelac [Fri, 3 Oct 2014 21:34:16 +0000 (23:34 +0200)]
pools: move removal of _pmspare

Since _pmspare is internal volume move it to
lv_remove_single -  so it's automatically removed with
last remove thin-pool.

lv_remove_with_dependencies() is not always used for pool removal.

9 years agolvcreate: reuse validation of names
Zdenek Kabelac [Fri, 3 Oct 2014 17:04:45 +0000 (19:04 +0200)]
lvcreate: reuse validation of names

Use validate_lvname_param() for name validation.

9 years agolv_manip: fix out of order backup
Zdenek Kabelac [Fri, 3 Oct 2014 16:39:54 +0000 (18:39 +0200)]
lv_manip: fix out of order backup

We had only 2 remaining places that were leaving unbackuped metadata.

9 years agolvconvert: reuse cache validation
Zdenek Kabelac [Fri, 3 Oct 2014 16:52:08 +0000 (18:52 +0200)]
lvconvert: reuse cache validation

Validation is now already in
validate_lv_cache_create() so reuse it.

Also properly rename var origin -> origin_lv.

9 years agocache: add validate_lv_cache_create
Zdenek Kabelac [Fri, 3 Oct 2014 16:37:11 +0000 (18:37 +0200)]
cache: add validate_lv_cache_create

Move validation tests into separate function.

9 years agolvconvert: options splitcache, split, uncache
Zdenek Kabelac [Sat, 4 Oct 2014 13:32:24 +0000 (15:32 +0200)]
lvconvert: options splitcache, split, uncache

  --splitcache
  Splits only cached LV (also pool could be specified).
  Detaches cachepool from cached LV.

  --split
  Should be univerzal command to split various complex targets.
  At this moment it knows cache.

  --uncache
  Opposite command to --cache. Detaches and DELETES cachepool for
  cached LV.

Note: we support thin pool cached metadata device for uncaching.
Also use may specify wither cached LV or association cachepool device
to request split of cache.

9 years agotoollib: validate also name
Zdenek Kabelac [Tue, 30 Sep 2014 19:45:10 +0000 (21:45 +0200)]
toollib: validate also name

In validate_lvname_param() call also validate_name().

9 years agolvcreate: support --cache and --cachepool
Zdenek Kabelac [Tue, 30 Sep 2014 19:46:02 +0000 (21:46 +0200)]
lvcreate: support --cache and --cachepool

Enable in cmdline options for cache and cachepool.

9 years agocommands: support shortcut -H for cache objects
Zdenek Kabelac [Mon, 29 Sep 2014 18:43:11 +0000 (20:43 +0200)]
commands: support shortcut -H for cache objects

Introduce cache_long_ARG for those instancies
where --cache is not related to caching LV.
(pvchange,vg|lv|pvscan).

cache_ARG is now with -H shortcut.

9 years agothin: better thin snapshot error detection
Zdenek Kabelac [Mon, 6 Oct 2014 11:42:59 +0000 (13:42 +0200)]
thin: better thin snapshot error detection

While creating thin snapshot, we cannot use size argument.

9 years agothin: lvcreate improve check of thin params
Zdenek Kabelac [Mon, 6 Oct 2014 11:13:01 +0000 (13:13 +0200)]
thin: lvcreate improve check of thin params

Use arg_from_list_is_set()
Resolve pool_lv at one single place.
Replace use of find_lv_in_vg() with find_lv().

9 years agolvcreate: refactor code
Zdenek Kabelac [Sun, 28 Sep 2014 20:31:30 +0000 (22:31 +0200)]
lvcreate: refactor code

Over the time lvcreate code has accumulated various hacks.
So try to move that code in right places.

Detect all types early in _lvcreate_params() so functions like
_read_size_params() do not need to change volume types.

Also ultimately respect give volume --type, that its shortcut
(-T, H, -m, -s) and after that options which do type estimation.
(i.e. --cachepool, --thinpool)

Avoid repeative tests - if we know all types are decode at once
place we can 'optimize' number of validations.

9 years agotest: Show an activation bug in lvcreate of a cache over raid.
Petr Rockai [Mon, 6 Oct 2014 06:11:42 +0000 (08:11 +0200)]
test: Show an activation bug in lvcreate of a cache over raid.

9 years agolvconvert: Forward --splitmirror to a cache origin when applicable.
Petr Rockai [Mon, 6 Oct 2014 06:11:06 +0000 (08:11 +0200)]
lvconvert: Forward --splitmirror to a cache origin when applicable.

9 years agotoollib: Rewrite process_each_lv.
David Teigland [Fri, 3 Oct 2014 22:37:49 +0000 (23:37 +0100)]
toollib: Rewrite process_each_lv.

Copy the same form as the new process_each_vg.
Replace unused struct cmd_vg and cmd_vg_read() replicator
code with struct vg and vg_read() directly.
The failed_lvnames arg is no longer used since the
cmd_vg replicator wrapper was removed.

[Committed by agk with cosmetic changes and tweaks.]

9 years agotoollib: Rewrite process_each_vg.
David Teigland [Fri, 3 Oct 2014 19:47:19 +0000 (20:47 +0100)]
toollib: Rewrite process_each_vg.

Split VG argument collection from processing.
This allows the two different loops through VGs to
be replaced by a single loop.
Replace unused struct cmd_vg and cmd_vg_read() replicator
code with struct vg and vg_read() directly.

[Committed by agk with cosmetic changes and tweaks.]

9 years agoman: lvmcache better cache mode info and other command variations
David Teigland [Tue, 26 Aug 2014 21:40:47 +0000 (16:40 -0500)]
man: lvmcache better cache mode info and other command variations

9 years agocache: include cache mode in vg metadata and display
David Teigland [Wed, 1 Oct 2014 21:06:01 +0000 (16:06 -0500)]
cache: include cache mode in vg metadata and display

The cache mode of a new cache pool is always explicitly
included in the vg metadata.  If a cache mode is not
specified on the command line, the cache mode is taken
from lvm.conf allocation/cache_pool_cachemode, which
defaults to "writethrough".

The cache mode can be displayed with lvs -o+cachemode.

9 years agocleanup: remove compiler warning about possible uninitialized variable use
Peter Rajnoha [Thu, 2 Oct 2014 11:21:24 +0000 (13:21 +0200)]
cleanup: remove compiler warning about possible uninitialized variable use

filters/filter-usable.c:22: warning: "ucp.check_..." may be used uninitialized in this function

This can't actually be hit in real, but let's clean this up for the compiler
to be happy again.

9 years agofilters: add cmd->full_filter - composite of cmd->filter and cmd->lvmetad_filter
Peter Rajnoha [Thu, 2 Oct 2014 10:00:57 +0000 (12:00 +0200)]
filters: add cmd->full_filter - composite of cmd->filter and cmd->lvmetad_filter

There are actually three filter chains if lvmetad is used:
  - cmd->lvmetad_filter used when when scanning devices for lvmetad
  - cmd->filter used when processing lvmetad responses
  - cmd->full_fiilter (which is just cmd->lvmetad_filter + cmd->filter chained together) used
    for remaining situations

This patch adds the third one - "cmd->full_filter" - currently this is
used if device processing does not fall into any of the groups before,
for example, devices which does not have the PV label yet and we're just
creating a new one or we're processing the devices where the list of the
devices (PVs) is not returned by lvmetad initially.

Currently, the cmd->full_filter is used exactly in these functions:
  - lvmcache_label_scan
  - _pvcreate_check
  - pvcreate_vol
  - lvmdiskscan
  - pvscan
  - _process_each_label

If lvmetad is used, then simply cmd->full_filter == cmd->filter because
cmd->lvmetad_filter is NULL in this case.

9 years agocleanup: remove symlink to profile in test dir for CLEAN target
Peter Rajnoha [Thu, 2 Oct 2014 07:30:38 +0000 (09:30 +0200)]
cleanup: remove symlink to profile in test dir for CLEAN target

9 years agotools: Add ENABLE_ALL_DEVS flag.
David Teigland [Wed, 1 Oct 2014 21:58:23 +0000 (22:58 +0100)]
tools: Add ENABLE_ALL_DEVS flag.

The ENABLE_ALL_DEVS flag is added to the command structure
for commands that should process all devs (pvs and non-pvs)
when they call process_each_pv and the command includes the
--all arg.  This will be used in a later process_each_pv patch.

9 years agotools: Add ALL_VGS_IS_DEFAULT flag.
David Teigland [Wed, 1 Oct 2014 21:58:00 +0000 (22:58 +0100)]
tools: Add ALL_VGS_IS_DEFAULT flag.

The ALL_VGS_IS_DEFAULT flag is added to the command structure
for commands that should process all vgs when they call
process_each_vg or process_each_lv with no args.
This will be used in later patches to process_each functions.

9 years agoman: lvmthin mention alternate syntax
David Teigland [Wed, 1 Oct 2014 15:29:30 +0000 (10:29 -0500)]
man: lvmthin mention alternate syntax

Users will probably run across the alternate syntax,
so we should explain how it relates to what is used here.

9 years agoRevert "Revert "man: lvmcache should use clearer cache pool options""
David Teigland [Wed, 1 Oct 2014 15:43:53 +0000 (10:43 -0500)]
Revert "Revert "man: lvmcache should use clearer cache pool options""

This reverts commit f120c954fc065d67c1aacd5cfba58843eb552b0f.

9 years agofilters: refresh filters when lvmetad use is toggled
Peter Rajnoha [Tue, 30 Sep 2014 14:08:05 +0000 (16:08 +0200)]
filters: refresh filters when lvmetad use is toggled

We need to use proper filter chain when we disable lvmetad use
explicitly in the code by calling lvmetad_set_active(0) while
overriding existing configuration. We need to reinitialize filters
in this case so proper filter chain is used. The same applies
for the other way round - when we enable lvmetad use explicitly in
the code (though this is not yet used).

9 years agofilters: use usable device filter and separate lvmetad filter chain so it's not reeva...
Peter Rajnoha [Tue, 23 Sep 2014 10:50:09 +0000 (12:50 +0200)]
filters: use usable device filter and separate lvmetad filter chain so it's not reevaluated for any lvmetad response

With this change, the filter chains used look like this now:

  A) When *lvmetad is not used*:
    - persistent filter -> regex filter -> sysfs filter ->
      global regex filter -> type filter ->
      usable device filter(FILTER_MODE_NO_LVMETAD) ->
      mpath component filter -> partitioned filter ->
      md component filter

  B) When *lvmetad is used* (two separate filter chains):
     - the lvmetad filter chain used when scanning devs for lvmetad update:
       sysfs filter -> global regex filter -> type filter ->
       usable device filter(FILTER_MODE_PRE_LVMETAD) ->
       mpath component filter -> partitioned filter ->
       md component filter

     - the filter chain used for lvmetad responses:
       persistent filter -> usable device filter(FILTER_MODE_POST_LVMETAD) ->
       regex filter

9 years agofilters: add "usable device" filter
Peter Rajnoha [Tue, 23 Sep 2014 10:49:01 +0000 (12:49 +0200)]
filters: add "usable device" filter

Usable device filter is responsible for filtering out unusable DM devices.
The filter has 3 modes of operation:

  - FILTER_MODE_NO_LVMETAD:
    When this mode is used, we check DM device usability by looking:
      - whether device is empty
      - whether device is blocked
      - whether device is suspended (only on devices/ignore_suspended_devices=1)
      - whether device uses an error target
      - whether device name/uuid is reserved

  - FILTER_MODE_PRE_LVMETAD:
    When this mode is used, we check DM device usability by looking:
      - whether device is empty
      - whether device is suspended (only on devices/ignore_suspended_devices=1)
      - whether device uses an error target
      - whether device name/uuid is reserved

  - FILTER_MODE_POST_LVMETAD:
    When this mode is used, we check DM device usability by looking:
      - whether device is blocked
      - whether device is suspended (only on devices/ignore_suspended_devices=1)

These modes will be used by subsequent patch to create different
instances of this filter, depending on lvmetad use.

9 years agorefactor: make it possible to select what to check exactly when calling device_is_usa...
Peter Rajnoha [Tue, 23 Sep 2014 10:47:11 +0000 (12:47 +0200)]
refactor: make it possible to select what to check exactly when calling device_is_usable fn

Currently, there are 5 things that device_is_usable function checks
(for DM devices only, of course):
  - is device empty?
  - is device blocked? (mirror)
  - is device suspended?
  - is device composed of an error target?
  - is device name/uuid reserved?

If answer to any of these questions is "yes", then the device is not usable.
This patch just adds possibility to choose what to check for exactly - the
device_is_usable function now accepts struct dev_usable_check_params make
this selection possible. This is going to be used by subsequent patches.

9 years agoconf: Update comments on lvmetad+filters in example.conf.in.
Petr Rockai [Tue, 30 Sep 2014 09:39:07 +0000 (11:39 +0200)]
conf: Update comments on lvmetad+filters in example.conf.in.

9 years agoman: lvmthin remove unnecessary fixme
David Teigland [Mon, 29 Sep 2014 17:28:00 +0000 (12:28 -0500)]
man: lvmthin remove unnecessary fixme

The existing method for single step thin-pool + thin creation
makes sense.

9 years agoRevert "Revert "man: lvmthin should use clearer thin pool options""
David Teigland [Mon, 29 Sep 2014 17:26:16 +0000 (12:26 -0500)]
Revert "Revert "man: lvmthin should use clearer thin pool options""

This reverts commit 17a1869df506a3641d49d52c413b5bc04ec2adc9.

We've agreed on the clearer syntax.

9 years agovalgrind: don't eat mem with valgrind
Zdenek Kabelac [Sat, 27 Sep 2014 14:27:34 +0000 (16:27 +0200)]
valgrind: don't eat mem with valgrind

When compiled with valgrind pool support - don't waste time
with preallocation of memory - it just waste of CPU cycles to
trace access to this memory.

We also may get slightly better estimation about real memory usage
during command processing.

9 years agocleanup: drop unused variable
Zdenek Kabelac [Sat, 27 Sep 2014 18:43:32 +0000 (20:43 +0200)]
cleanup: drop unused variable

9 years agolvconvert: switch to validate_lvname_param
Zdenek Kabelac [Sun, 28 Sep 2014 11:07:18 +0000 (13:07 +0200)]
lvconvert: switch to validate_lvname_param

Use new toollib function for validation.

9 years agotoollib: introduce validate_lvname_param
Zdenek Kabelac [Sun, 28 Sep 2014 10:57:39 +0000 (12:57 +0200)]
toollib: introduce validate_lvname_param

Function for parsing and validating of lvname parameter.

9 years agocleanup: rename func
Zdenek Kabelac [Sat, 27 Sep 2014 16:53:08 +0000 (18:53 +0200)]
cleanup: rename func

Update name of function read_and_validate_major_minor
and put it into the right header file toollib.h.

(In release update for f09f85d027d8833)

9 years agotoollib: refactor extract_vgname
Zdenek Kabelac [Sat, 27 Sep 2014 14:29:43 +0000 (16:29 +0200)]
toollib: refactor extract_vgname

Split internals of extract_vgname into _extract_vgname.
This common code will be used for other similar function.

Reuse skip_dev_dir() instead of less mature coded to skip
device dir.

Instead of duplicating full vg/lv name - allocate string
only vg portion of lv name.

9 years agotoollib: refactor skip_dev_dir
Zdenek Kabelac [Sun, 28 Sep 2014 10:54:20 +0000 (12:54 +0200)]
toollib: refactor skip_dev_dir

Detect dev dir just once.

9 years agoRevert "man: lvmcache should use clearer cache pool options"
Zdenek Kabelac [Sat, 27 Sep 2014 13:10:44 +0000 (15:10 +0200)]
Revert "man: lvmcache should use clearer cache pool options"

Revert: --cachepool  and --thipnpool is the right way

they both take arg

This is a major difference from  --cache   and --thin

9 years agoRevert "man: lvmthin should use clearer thin pool options"
Zdenek Kabelac [Sat, 27 Sep 2014 13:08:31 +0000 (15:08 +0200)]
Revert "man: lvmthin should use clearer thin pool options"

Revert: --cachepool  and --thipnpool is the right way

they both take arg

This is a major difference from  --cache   and --thin

9 years agoman: lvmthin should use clearer thin pool options
David Teigland [Fri, 26 Sep 2014 21:05:30 +0000 (16:05 -0500)]
man: lvmthin should use clearer thin pool options

Previously, this was the recommended form for creating a thin pool:

lvconvert --thinpool VG/ThinDataLV --poolmetadata VG/ThinMetaLV

but this is confusing, because --thinpool does not actually take
an arg, and is more naturally used to specify an existing thin pool.

The new recommended form is:

lvconvert --type thin-pool --poolmetadata VG/ThinMetaLV VG/ThinDataLV

9 years agoman: lvmcache should use clearer cache pool options
David Teigland [Fri, 26 Sep 2014 19:40:40 +0000 (14:40 -0500)]
man: lvmcache should use clearer cache pool options

Previously, this was the recommended form for creating a cache pool:

lvconvert --cachepool VG/CacheDataLV --poolmetadata VG/CacheMetaLV

but this is confusing, because --cachepool does not actually take
an arg, and is more natually used to specify an existing cache pool.

The new recommended form is:

lvconvert --type cache-pool --poolmetadata VG/CacheMetaLV VG/CacheDataLV

9 years agolvchange: missed bits for a8aee7dba2b76
Zdenek Kabelac [Wed, 24 Sep 2014 14:27:35 +0000 (16:27 +0200)]
lvchange: missed bits for a8aee7dba2b76

lv_info is not used here any more.
This code should have been committed with
lv_check_not_in_use API change commit.

9 years agocleanup: Use segtype.h definitions of segment type names wherever possible
Heinz Mauelshagen [Wed, 24 Sep 2014 13:24:41 +0000 (15:24 +0200)]
cleanup: Use segtype.h definitions of segment type names wherever possible

We are not using already defined segement type names where we could.

There is a lot of other places in device-mapper and LVM2 we have those
hardcoded so we should better finally have a common interface in
libdevmapper to avoid this.

9 years agotests: add helper funcionality for using gdb
Zdenek Kabelac [Sat, 20 Sep 2014 23:16:57 +0000 (01:16 +0200)]
tests: add helper funcionality for using gdb

When there is need for using gdb within test suite
just prefix command with LVM_DBG and run test in
standard shell (for stdin).

9 years agotests: drop * from dmsetup
Zdenek Kabelac [Sat, 20 Sep 2014 23:11:42 +0000 (01:11 +0200)]
tests: drop * from dmsetup

We cannot use shell expansion for dmsetup here.

9 years agodebug: add debug message
Zdenek Kabelac [Wed, 24 Sep 2014 08:03:55 +0000 (10:03 +0200)]
debug: add debug message

Since we leave error printing on the called of deactivation,
at least put in debug log for this case.

9 years agodebug: show stacktrace on error path
Zdenek Kabelac [Mon, 22 Sep 2014 13:59:50 +0000 (15:59 +0200)]
debug: show stacktrace on error path

9 years agodebug: drop printing debug trace without labeler
Zdenek Kabelac [Mon, 22 Sep 2014 11:34:12 +0000 (13:34 +0200)]
debug: drop printing debug trace without labeler

Not having labeller on device is not reason eo generate backtrace in log.

9 years agodebug: add missing stack trace
Zdenek Kabelac [Sun, 21 Sep 2014 09:48:09 +0000 (11:48 +0200)]
debug: add missing stack trace

9 years agodebug: monitor_dev_for_events stack trace
Zdenek Kabelac [Wed, 24 Sep 2014 07:58:04 +0000 (09:58 +0200)]
debug: monitor_dev_for_events stack trace

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