]> sourceware.org Git - lvm2.git/log
lvm2.git
10 years agolvscan: Implement a --cache mode.
Petr Rockai [Mon, 21 Jul 2014 01:55:46 +0000 (03:55 +0200)]
lvscan: Implement a --cache mode.

10 years agotests: new lvconvert features
Zdenek Kabelac [Fri, 11 Jul 2014 10:15:46 +0000 (12:15 +0200)]
tests: new lvconvert features

10 years agotests: use full option name
Zdenek Kabelac [Tue, 22 Jul 2014 20:14:31 +0000 (22:14 +0200)]
tests: use full option name

Don't overuse shortcut support -
since poolmetadatasize was the only allowed option
it's been equivalent to poolmetadata

10 years agoman: lvconvert poolmetadataspare
Zdenek Kabelac [Tue, 22 Jul 2014 15:31:22 +0000 (17:31 +0200)]
man: lvconvert poolmetadataspare

Add missing description for --poolmetadataspare option.

10 years agocleanup: show better messages
Zdenek Kabelac [Tue, 22 Jul 2014 15:29:53 +0000 (17:29 +0200)]
cleanup: show better messages

10 years agothin and cache: unify pool common code
Zdenek Kabelac [Tue, 22 Jul 2014 20:20:18 +0000 (22:20 +0200)]
thin and cache: unify pool common code

Fix get_pool_params to only read params.
Add poolmetadataspare option to get_pool_params.
Move all profile code into update_pool_params.
Move recalculate code into pool_manip.c

10 years agolvconvert: better testing order
Zdenek Kabelac [Fri, 18 Jul 2014 10:19:40 +0000 (12:19 +0200)]
lvconvert: better testing order

Avoid duplicate tests through implicit calls - check directly
result of string assignment.

10 years agotools: switch logic for new arg_ func
Zdenek Kabelac [Fri, 18 Jul 2014 19:56:37 +0000 (21:56 +0200)]
tools: switch logic for new arg_ func

Revert logic and rename new arg_ functions to:

arg_from_list_is_set()
arg_outside_list_is_set()

When err_found is given, log_error message is automaticaly
printed.

10 years agoman: rework lvmcache to match lvmthin
David Teigland [Tue, 22 Jul 2014 20:10:35 +0000 (15:10 -0500)]
man: rework lvmcache to match lvmthin

Reorganize and rewrite parts to match lvmthin(7).

10 years agoreport: Remove lv_target_type field.
Alasdair G Kergon [Tue, 22 Jul 2014 19:57:57 +0000 (20:57 +0100)]
report: Remove lv_target_type field.

This field is too complicated to be useful on its own and either needs
redefining or splitting up into multiple fields.

10 years agoraid: Moved degraded activation code to raid_manip.
Alasdair G Kergon [Tue, 22 Jul 2014 19:50:29 +0000 (20:50 +0100)]
raid: Moved degraded activation code to raid_manip.

Adjust some messages & fn names.

10 years agoman: lvmcache updates
David Teigland [Mon, 21 Jul 2014 20:41:42 +0000 (15:41 -0500)]
man: lvmcache updates

- use the lvconvert --cachepool syntax to match the lvmthin style
- rewrite removal information
- very minor formatting adjustments

10 years agoman: use macros for indenting in lvmthin
David Teigland [Mon, 21 Jul 2014 15:28:20 +0000 (10:28 -0500)]
man: use macros for indenting in lvmthin

10 years agometadata: Reinstate system info in metadata.
Alasdair G Kergon [Mon, 21 Jul 2014 14:54:20 +0000 (15:54 +0100)]
metadata: Reinstate system info in metadata.

Revert part of cac0722cacaac06ac1211194f1d6c21572a32998

This was deliberate and aids the investigation of problems.

10 years agoconfig: Adjust description of activation_mode.
Alasdair G Kergon [Mon, 21 Jul 2014 14:50:47 +0000 (15:50 +0100)]
config: Adjust description of activation_mode.

10 years agoraid: Correct degraded warning message level
Alasdair G Kergon [Mon, 21 Jul 2014 14:40:59 +0000 (15:40 +0100)]
raid: Correct degraded warning message level

10 years agotests: use bigger metadata
Zdenek Kabelac [Thu, 17 Jul 2014 14:27:39 +0000 (16:27 +0200)]
tests: use bigger metadata

Until resolved - use bigger then 4MB cache pool metadata.

10 years agocleanup: drop testing impossible path
Zdenek Kabelac [Thu, 17 Jul 2014 12:47:58 +0000 (14:47 +0200)]
cleanup: drop testing impossible path

We cannot get NULL in this test - since if the arg is set
it will always return non-NULL value here.
(in-release update)

10 years agocleanup: typo in message
Zdenek Kabelac [Thu, 17 Jul 2014 12:46:38 +0000 (14:46 +0200)]
cleanup: typo in message

in-release fix.

10 years agocleanup: check arg_count once
Zdenek Kabelac [Mon, 14 Jul 2014 15:34:49 +0000 (17:34 +0200)]
cleanup: check arg_count once

Do not check quiet_ARG more then necessary.

10 years agoraid: support lvdisplay --maps
Zdenek Kabelac [Wed, 16 Jul 2014 21:55:46 +0000 (23:55 +0200)]
raid: support lvdisplay --maps

Add legs printing for --maps
Somewhat similar to mirror support - maybe there are more things to
show...

10 years agometadata: use outfc for comments
Zdenek Kabelac [Wed, 16 Jul 2014 21:57:43 +0000 (23:57 +0200)]
metadata: use outfc for comments

Few unecessary comments were written to on-disc metadata.
Use outfc() to have comments only in archived files.
(may also save couple bytes in ringbuffer).

TODO: needed validation against newline char...

10 years agocache: use get_cache_mode for validation
Zdenek Kabelac [Thu, 17 Jul 2014 13:12:21 +0000 (15:12 +0200)]
cache: use get_cache_mode for validation

Use a single function to validate cache mode arg
and set DM_ feature flags.

10 years agolvconvert: improve merge validation
Zdenek Kabelac [Thu, 17 Jul 2014 13:38:13 +0000 (15:38 +0200)]
lvconvert: improve merge validation

Easier check for conflicting options with --merge.

10 years agolvconvert: improve splitsnapshot test
Zdenek Kabelac [Thu, 17 Jul 2014 13:36:07 +0000 (15:36 +0200)]
lvconvert: improve splitsnapshot test

Easier check for conflicting options with --splitsnapshot.

10 years agolvconvert: move to single name validation
Zdenek Kabelac [Thu, 17 Jul 2014 10:19:48 +0000 (12:19 +0200)]
lvconvert: move to single name validation

Validate all LV names in _lvconvert_name_params().

10 years agolvconvert: add missing option for repair
Zdenek Kabelac [Thu, 17 Jul 2014 09:28:21 +0000 (11:28 +0200)]
lvconvert: add missing option for repair

Few more option needs to be allowed with --repair.
(in-release fix).

10 years agoman: lvmthin fix line breaks
David Teigland [Fri, 11 Jul 2014 20:15:03 +0000 (15:15 -0500)]
man: lvmthin fix line breaks

The html rendering inserted some unpleasant line breaks,
so insert better breaks explicitly.

10 years agolvconvert: fix missing repair option
Zdenek Kabelac [Fri, 11 Jul 2014 12:40:51 +0000 (14:40 +0200)]
lvconvert: fix missing repair option

Support --repair and --use-policies with mirrors.
(fixes another regression from lvconvert change for thin and cache).
TODO: the code path for mirror needs update.

10 years agocleanup: lets make it really obvious for gcc
Zdenek Kabelac [Fri, 11 Jul 2014 12:19:22 +0000 (14:19 +0200)]
cleanup: lets make it really obvious for gcc

10 years agolvconvert: fix mirror path
Zdenek Kabelac [Fri, 11 Jul 2014 12:09:32 +0000 (14:09 +0200)]
lvconvert: fix mirror path

lvconvert rewrite commit missed proper handling
of mirror path for --corelog and --mirrorlog options.
Document this even in man page.

10 years agoWHATS_NEW: recent commits
Peter Rajnoha [Fri, 11 Jul 2014 12:09:05 +0000 (14:09 +0200)]
WHATS_NEW: recent commits

Commits:
d169ff1e039ecdfb1efac0a6464ca149d71d8767
bccc2bef33af081264bbc356e37efe89ef78b796
f76879ba440aa93f2e237335fe2cca6951a636bf

10 years agocleanup: drop unintend debug error line
Zdenek Kabelac [Fri, 11 Jul 2014 11:54:54 +0000 (13:54 +0200)]
cleanup: drop unintend debug error line

10 years agocleanup: older gcc is not smart enough
Zdenek Kabelac [Fri, 11 Jul 2014 11:47:50 +0000 (13:47 +0200)]
cleanup: older gcc is not smart enough

Avoid gcc warning about uninitialized 'seg' variable.
It's not easy for older gcc compiler to deduce it's been set.

10 years agotests: updates for new lvconvert
Zdenek Kabelac [Fri, 11 Jul 2014 11:13:56 +0000 (13:13 +0200)]
tests: updates for new lvconvert

10 years agocleanup: lvconvert reoder repair check
Zdenek Kabelac [Thu, 10 Jul 2014 18:59:39 +0000 (20:59 +0200)]
cleanup: lvconvert reoder repair check

10 years agoman: lvconvert update
Zdenek Kabelac [Mon, 7 Jul 2014 20:28:43 +0000 (22:28 +0200)]
man: lvconvert update

Update lvconvert doc for conversion of pools
(thin and cache pools and volumes)

Various more cleanups.

10 years agolvconvert: update help
Zdenek Kabelac [Mon, 7 Jul 2014 20:54:33 +0000 (22:54 +0200)]
lvconvert: update help

Extend help for lvconvert.
Use COMMON_OPTS for some common options.

10 years agolvconvert: update for thin a cache
Zdenek Kabelac [Fri, 11 Jul 2014 10:15:23 +0000 (12:15 +0200)]
lvconvert: update for thin a cache

Major update of lvconvert code to handle cache and thin.
related targets.

Code tries to unify handling of cache and thin pools.
Better supports lvm2 syntax:

lvconvert --type cache --cachepool vg/pool vg/cache
lvconvert --type thin --thinpool vg/pool vg/extorg
lvconvert --type cache-pool vg/pool
lvconvert --type thin-pool vg/pool

as well as:

lvconvert --cache --cachepool vg/pool vg/cache
lvconvert --thin --thinpool vg/pool vg/extorg
lvconvert --cachepool vg/pool
lvconvert --thinpool vg/pool

While catching much more command line errors.
(Yet couple paths still needs more tests)

Detects as much cmdline errors prior opening VG.

Uses single lvconvert_name_params to convert LV names.

Detects as much incompatibilies in VG prior prompting.

Uses single prompt to confirm whole conversion.

TODO: still the code needs fixes...

10 years agocleanup: shift detection of chunksize sign
Zdenek Kabelac [Mon, 7 Jul 2014 20:40:36 +0000 (22:40 +0200)]
cleanup: shift detection of chunksize sign

Sign should be checked prior opening of VG.
Since get_pool_params() needs profiles,
we need to move check for sign earlier.

10 years agocleanup: reorder code
Zdenek Kabelac [Mon, 7 Jul 2014 20:24:35 +0000 (22:24 +0200)]
cleanup: reorder code

Simplify code.

10 years agocleanup: move merge option
Zdenek Kabelac [Wed, 9 Jul 2014 15:22:16 +0000 (17:22 +0200)]
cleanup: move merge option

Put long --merge option into section with long options.

10 years agocleanup: indent changes
Zdenek Kabelac [Fri, 11 Jul 2014 10:25:18 +0000 (12:25 +0200)]
cleanup: indent changes

10 years agocache: warn about metadata size limits
Zdenek Kabelac [Fri, 11 Jul 2014 10:12:51 +0000 (12:12 +0200)]
cache: warn about metadata size limits

Cache pools are similar as with thin pools.
Add (needs %s) - since cache has currently
a bit strange need for extra few kb over
our default 4M extent size so make it more obvious.

10 years agolvconvert: relocate mirror tests
Zdenek Kabelac [Thu, 10 Jul 2014 20:02:54 +0000 (22:02 +0200)]
lvconvert: relocate mirror tests

10 years agotools: arg_is_any_set and arg_is_only_set
Zdenek Kabelac [Thu, 10 Jul 2014 20:52:53 +0000 (22:52 +0200)]
tools: arg_is_any_set and arg_is_only_set

Helpful functions to more easily detect conflicting
set of options.

10 years agopool: callback handle cache
Zdenek Kabelac [Wed, 9 Jul 2014 15:24:34 +0000 (17:24 +0200)]
pool: callback handle cache

Extend the callback functionality to handle also cache pools.

cache_check is now executed on cachepool metadata when
it's activated and deactivated.

10 years agopool: move code to pool source file
Zdenek Kabelac [Tue, 8 Jul 2014 13:19:47 +0000 (15:19 +0200)]
pool: move code to pool source file

More code is used commonly for all pool types (cache & thin)

10 years agodisplay: show C only for cache and cachepool
Zdenek Kabelac [Mon, 7 Jul 2014 20:26:56 +0000 (22:26 +0200)]
display: show C only for cache and cachepool

Keep target type (attr6) as the cache data and metadata volume has.
(i.e. when will show 'raid' type if metadata is raid)

10 years agolvchange: just skip on cache pool
Zdenek Kabelac [Wed, 9 Jul 2014 15:55:10 +0000 (17:55 +0200)]
lvchange: just skip on cache pool

10 years agolv_is_pool: add new defines
Zdenek Kabelac [Mon, 7 Jul 2014 20:14:08 +0000 (22:14 +0200)]
lv_is_pool: add new defines

Defines for lv_is_pool() and  lv_is_pool_metadata()
Also update comments for prompts for their current meaning.
(Though maybe they should be renamed)

10 years agolvconvert: snapshot prompts to confirm conversion
Zdenek Kabelac [Mon, 7 Jul 2014 20:33:31 +0000 (22:33 +0200)]
lvconvert: snapshot prompts to confirm conversion

Since the type passed LV is changed and content of data detroyed,
query user with prompt to confirm this operation.
Also add a proper wiping of header.

Using '--yes' will skip this prompt:

lvconvert -s --yes vg/lv vg/lvcow

10 years agolvconvert: fix return codes
Zdenek Kabelac [Fri, 11 Jul 2014 10:24:32 +0000 (12:24 +0200)]
lvconvert: fix return codes

Error codes in some function are directly used
as command result - thus return 0 is not error code,
but success - switch to proper ECMD_FAILED.

10 years agoprompt: display 'n' for EOF
Zdenek Kabelac [Mon, 7 Jul 2014 19:03:15 +0000 (21:03 +0200)]
prompt: display 'n' for EOF

When EOF is detect - it could be either 'Ctrl+C'
or empty stdin.

For Ctrl+C there is visual ^C sign.
For EOF print 'n' so decision is clear in debug print.

10 years agoconfigure
Zdenek Kabelac [Fri, 4 Jul 2014 14:31:05 +0000 (16:31 +0200)]
configure

10 years agocache: add tool support
Zdenek Kabelac [Fri, 4 Jul 2014 14:31:29 +0000 (16:31 +0200)]
cache: add tool support

Introducing cache tool support.

10 years agometadata: fix ALLOCATABLE_PV for lvm1 format
Peter Rajnoha [Fri, 11 Jul 2014 10:24:15 +0000 (12:24 +0200)]
metadata: fix ALLOCATABLE_PV for lvm1 format

This is addendum for commit 6dc7b783c80c6834aa724df49b5d47b9b5601506.

LVM1 format stores the ALLOCATABLE flag directly in PV header, not
in VG metadata. So the code needs to be fixed further to work
properly for lvm1 format so that the correct PV header is written
(the flag is set only if the PV is in some VG, unset otherwise).

10 years agoreport: display 'unknown' value for lv_active_remotely field if the LV is also active...
Peter Rajnoha [Fri, 11 Jul 2014 09:56:50 +0000 (11:56 +0200)]
report: display 'unknown' value for lv_active_remotely field if the LV is also active locally

Currently, we can't determine whether the LV is active remotely
or not in that case.

10 years agoreport: display 'unknown' value for active/active_locally/active_remotely/active_excl...
Peter Rajnoha [Fri, 11 Jul 2014 09:15:06 +0000 (11:15 +0200)]
report: display 'unknown' value for active/active_locally/active_remotely/active_exclusively if info bypassed

Before the patch:

$ lvs -o name,active vg/lvol1 --driverloaded n
  WARNING: Activation disabled. No device-mapper interaction will beattempted.
  LV    Active
  lvol1 active

With this patch applied:
$ lvs -o name,active vg/lvol1 --driverloaded n
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  LV    Active
  lvol1 unknown

The same for active_{locally,remotely,exclusively} fields.
Also, rename headings for these fields (ActLocal/ActRemote/ActExcl).

10 years agoreport: display 'unknown' value for LVSINFO fields if unable to get info
Peter Rajnoha [Fri, 11 Jul 2014 08:18:59 +0000 (10:18 +0200)]
report: display 'unknown' value for LVSINFO fields if unable to get info

If the lv_info call fails for whatever reason/INFO dm ioctl fails or
the dm driver communication is disabled (--driverloaded n), make
sure we always display "unknown" for LVSINFO fields as that's exactly
what happens - we don't know the state.

Before the patch:

$ lvs -o name,device_open --driverloaded n
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  Command failed with status code 5.

With this patch applied:

$ lvs -o name,device_open --driverloaded n
  WARNING: Activation disabled. No device-mapper interaction will be attempted.
  LV        DevOpen
  lvol1        unknown

10 years agotest: Test failing due to too few PVs
Jonathan Brassow [Thu, 10 Jul 2014 23:52:55 +0000 (18:52 -0500)]
test: Test failing due to too few PVs

Commit 33d69162e4b45e7926d4c0e4a425fedb4246088e reduced the number of
PVs to a level where the test could not function.  (It is impossible
to replace 3 PVs of a 4-way RAID1 LV if there are only 5 PVs.)

10 years agoreport: also report linear and striped for lv_target_type
Peter Rajnoha [Thu, 10 Jul 2014 14:41:42 +0000 (16:41 +0200)]
report: also report linear and striped for lv_target_type

10 years agoconf: add report/list_item_separator lvm.conf option
Peter Rajnoha [Thu, 10 Jul 2014 14:18:45 +0000 (16:18 +0200)]
conf: add report/list_item_separator lvm.conf option

For example:

$ lvm dumpconfig report/list_item_separator
list_item_separator=","

$ lvs -o name,tags vg/lvol1
  LV    LV Tags
  lvol1 a,x,y

$ lvm dumpconfig report/list_item_separator
list_item_separator=":"

$ lvs -o name,tags vg/lvol1
  LV    LV Tags
  lvol1 a:x:y

10 years agolibdm: report: fix string list internal representation if delimiter is composed of...
Peter Rajnoha [Thu, 10 Jul 2014 14:09:58 +0000 (16:09 +0200)]
libdm: report: fix string list internal representation if delimiter is composed of more than one char

10 years agotests: LV's zero field now reported as binary field
Peter Rajnoha [Thu, 10 Jul 2014 13:30:28 +0000 (15:30 +0200)]
tests: LV's zero field now reported as binary field

10 years agoreport: report LV's zero field as binary field
Peter Rajnoha [Thu, 10 Jul 2014 13:23:56 +0000 (15:23 +0200)]
report: report LV's zero field as binary field

Like other binary fields we already have:

$ lvs -o name,zero vg/lvx vg/pool vg/pool1
  LV    Zero
  lvx   unknown
  pool
  pool1    zero

$ lvs -o name,zero vg/lvx vg/pool vg/pool1 --binary
  LV    Zero
  lvx     -1
  pool     0
  pool1    1

10 years agoreport: reserved value: description for undefined value
Peter Rajnoha [Thu, 10 Jul 2014 11:42:16 +0000 (13:42 +0200)]
report: reserved value: description for undefined value

10 years agocleanup: also use values.h for final dm_report_reserved_value array composition
Peter Rajnoha [Thu, 10 Jul 2014 11:37:26 +0000 (13:37 +0200)]
cleanup: also use values.h for final dm_report_reserved_value array composition

10 years agocleanup: report reserved value macros
Peter Rajnoha [Thu, 10 Jul 2014 09:54:37 +0000 (11:54 +0200)]
cleanup: report reserved value macros

10 years agoconf: command_profile_template: global/binary_values_as_numeric -> report/binary_valu...
Peter Rajnoha [Thu, 10 Jul 2014 07:48:45 +0000 (09:48 +0200)]
conf: command_profile_template: global/binary_values_as_numeric -> report/binary_values_as_numeric

10 years agoreport: add values.h for per-field reserved value declaration
Peter Rajnoha [Thu, 10 Jul 2014 07:22:45 +0000 (09:22 +0200)]
report: add values.h for per-field reserved value declaration

10 years agoactivation: Add "degraded" activation mode
Jonathan Brassow [Thu, 10 Jul 2014 03:56:11 +0000 (22:56 -0500)]
activation: Add "degraded" activation mode

Currently, we have two modes of activation, an unnamed nominal mode
(which I will refer to as "complete") and "partial" mode.  The
"complete" mode requires that a volume group be 'complete' - that
is, no missing PVs.  If there are any missing PVs, no affected LVs
are allowed to activate - even RAID LVs which might be able to
tolerate a failure.  The "partial" mode allows anything to be
activated (or at least attempted).  If a non-redundant LV is
missing a portion of its addressable space due to a device failure,
it will be replaced with an error target.  RAID LVs will either
activate or fail to activate depending on how badly their
redundancy is compromised.

This patch adds a third option, "degraded" mode.  This mode can
be selected via the '--activationmode {complete|degraded|partial}'
option to lvchange/vgchange.  It can also be set in lvm.conf.
The "degraded" activation mode allows RAID LVs with a sufficient
level of redundancy to activate (e.g. a RAID5 LV with one device
failure, a RAID6 with two device failures, or RAID1 with n-1
failures).  RAID LVs with too many device failures are not allowed
to activate - nor are any non-redundant LVs that may have been
affected.  This patch also makes the "degraded" mode the default
activation mode.

The degraded activation mode does not yet work in a cluster.  A
new cluster lock flag (LCK_DEGRADED_MODE) will need to be created
to make that work.  Currently, there is limited space for this
extra flag and I am looking for possible solutions.  One possible
solution is to usurp LCK_CONVERT, as it is not used.  When the
locking_type is 3, the degraded mode flag simply gets dropped and
the old ("complete") behavior is exhibited.

10 years agoreport: Rename common fields to special fields.
Alasdair G Kergon [Wed, 9 Jul 2014 22:33:09 +0000 (23:33 +0100)]
report: Rename common fields to special fields.

Change the help heading from 'Common Fields' to 'Special Fields' for
the fields: selected, help, ?

Remove the code that does 'all' processing with these special fields as
each of them changes the behaviour of the command in an undesirable way.

'lvs -o all,selected' was of course just printing help.
(via internal expansion to 'lv_all,common_all')

and if we ignored the help fields, then '-o common_all' would still
pull in 'selected' and change the way rows were output.

10 years agoreport: also recognize 'yes'/'no' for selection criteria on binary fields
Peter Rajnoha [Wed, 9 Jul 2014 13:10:43 +0000 (15:10 +0200)]
report: also recognize 'yes'/'no' for selection criteria on binary fields

We have 1/"descriptive word"/"yes" for 1 and 0/"no" for 0.
For example (the new recognized values are "yes" and "no"):

$ lvs -o name,device_open fedora vg/lvol1 vg/lvol2
  LV    DevOpen
  root        open
  swap        open
  lvol1       open
  lvol2

$ lvs -o name,device_open fedora vg/lvol1 vg/lvol2 -S 'device_open=open'
  LV    DevOpen
  root        open
  swap        open
  lvol1       open

$ lvs -o name,device_open fedora vg/lvol1 vg/lvol2 -S 'device_open=1'
  LV    DevOpen
  root        open
  swap        open
  lvol1       open

$ lvs -o name,device_open fedora vg/lvol1 vg/lvol2 -S 'device_open=yes'
  LV    DevOpen
  root        open
  swap        open
  lvol1       open

$ lvs -o name,device_open fedora vg/lvol1 vg/lvol2 -S 'device_open=0'
  LV    DevOpen
  lvol2

$ lvs -o name,device_open fedora vg/lvol1 vg/lvol2 -S 'device_open=no'
  LV    DevOpen
  lvol2

10 years agocleanup: move _lvactive_disp and _thinzero_disp under 'attribute' display functions
Peter Rajnoha [Wed, 9 Jul 2014 12:37:01 +0000 (14:37 +0200)]
cleanup: move _lvactive_disp and _thinzero_disp under 'attribute' display functions

So all attribute reporting functions are all in one section of code
for quick orientation (all these functions are defined in the order
of their attribute character displayed in pv/vg/lv_attr field).

10 years agoreport: add lv_active_{locally,remotely,exclusively} LV reporting fields
Peter Rajnoha [Wed, 9 Jul 2014 12:28:50 +0000 (14:28 +0200)]
report: add lv_active_{locally,remotely,exclusively} LV reporting fields

lv_active_{locally,remotely,exclusively} display the original
"lv_active" field in a more separate way so that we can create
selection criteria in a binary-based form (yes/no).

10 years agoreport: 'whether' -> 'set if' in field description
Peter Rajnoha [Wed, 9 Jul 2014 11:41:25 +0000 (13:41 +0200)]
report: 'whether' -> 'set if' in field description

10 years agocleanup: use macros for definition of reporting/selection reserved values
Peter Rajnoha [Tue, 8 Jul 2014 10:40:45 +0000 (12:40 +0200)]
cleanup: use macros for definition of reporting/selection reserved values

The macros for reserved value definition makes the process a bit easier,
but there's still a place for improvement and make this even more
transparent. We can optimize and provide better automatism here later on.

10 years agoreport: report unknown/-1 for binary fields with unknown value
Peter Rajnoha [Tue, 8 Jul 2014 10:15:14 +0000 (12:15 +0200)]
report: report unknown/-1 for binary fields with unknown value

Also respect --binary arg and/or report/binary_values_as_numeric
when displaying unknown values. If textual form is used, use "unknown",
if numeric value is used, use "-1" (which we already use to denote
unknown numeric values in other reports like lv_kernel_major and
lv_kernel_minor).

10 years agoconf: comment out devices/preferred_names and filter setting
Peter Rajnoha [Tue, 8 Jul 2014 08:22:59 +0000 (10:22 +0200)]
conf: comment out devices/preferred_names and filter setting

This avoids creating void matchers which have no effect anyway and
they just use resources. Also, it makes lvm dumpconfig --type diff
to mark these settings properly as not being different from defaults
(where by default, devices/preferred_names as well as devices/filter
are void).

Also, add a few comments about builtin rules used to select device
alias in case preferred_names is not defined or it doesn't match
any of device aliases.

10 years agolv_manip: pool-metadata-spare is just a spare LV, not tightly bound to thin or cache
Peter Rajnoha [Mon, 7 Jul 2014 15:02:06 +0000 (17:02 +0200)]
lv_manip: pool-metadata-spare is just a spare LV, not tightly bound to thin or cache

10 years agoWHATS_NEW: commits a473435..7021c8f1
Peter Rajnoha [Mon, 7 Jul 2014 14:52:43 +0000 (16:52 +0200)]
WHATS_NEW: commits a473435..7021c8f1

10 years agoreport: addendum for previous commit
Peter Rajnoha [Mon, 7 Jul 2014 14:28:13 +0000 (16:28 +0200)]
report: addendum for previous commit

Really call lv_info only if needed!

10 years agoreport: fix segfault while reporting PV/LV segment fields together with LV fields...
Peter Rajnoha [Mon, 7 Jul 2014 13:54:13 +0000 (15:54 +0200)]
report: fix segfault while reporting PV/LV segment fields together with LV fields needeing device status (LVSINFO)

There was missing lv_info call for situations where there were
mixed PV/LV segment fields together with LVSINFO fields which
require extra lv_info call for LV device status. This ended up
with NULL lvinfo passed to the field reporting functions, hence
the segfault.

10 years agometadata: fix regression causing PVs not in VGs to be marked as allocatable
Peter Rajnoha [Mon, 7 Jul 2014 11:58:42 +0000 (13:58 +0200)]
metadata: fix regression causing PVs not in VGs to be marked as allocatable

If the PV is not yet in a VG, it's not allocatable.
A regression introduced by commit 0283c439ec2dc195184a12f86a060b271476aae0
(_pv_create) and later commit a7ca10151795b4c4ed6fa4bf7d3d6b1a687430b0
(pv_read).

10 years agoreport: define reserved values/synonyms for some attribute fields
Peter Rajnoha [Fri, 4 Jul 2014 10:08:52 +0000 (12:08 +0200)]
report: define reserved values/synonyms for some attribute fields

All binary attr fields have synonyms so selection criteria can use
either 0/1 or words to match against the field value (base type
for these binary fields is numeric one - DM_REPORT_FIELD_TYPE_NUMBER
so words are registered as reserved values):

pv_allocatable          - "allocatable"
pv_exported             - "exported"
pv_missing              - "missing"

vg_extendable           - "extendable"
vg_exported             - "exported"
vg_partial              - "partial"
vg_clustered            - "clustered"

lv_initial_image_sync   - "initial image sync", "sync"
lv_image_synced_names   - "image synced", "synced"
lv_merging_names        - "merging"
lv_converting_names     - "converting"
lv_allocation_locked    - "allocation locked", "locked"
lv_fixed_minor          - "fixed minor", "fixed"
lv_merge_failed         - "merge failed", "failed"

For example, these three are all equivalent:

$ lvs -o name,fixed_minor -S 'fixed_minor=fixed'
  LV    FixMin
  lvol8 fixed minor

$ lvs -o name,fixed_minor -S 'fixed_minor="fixed minor"'
  LV    FixMin
  lvol8 fixed minor

$ lvs -o name,fixed_minor -S 'fixed_minor=1'
  LV    FixMin
  lvol8 fixed minor

The same with binary output - it has no effect on this functionality:

$ lvs -o name,fixed_minor --binary -S 'fixed_minor=fixed'
  LV    FixMin
  lvol8          1

$ lvs -o name,fixed_minor --binary -S 'fixed_minor="fixed
minor"'
  LV    FixMin
  lvol8          1

[1] f20/~ # lvs -o name,fixed_minor --binary -S 'fixed_minor=1'
  LV    FixMin
  lvol8          1

10 years agoreport: adapt selection code to recognize per-field reserved values
Peter Rajnoha [Fri, 4 Jul 2014 09:21:38 +0000 (11:21 +0200)]
report: adapt selection code to recognize per-field reserved values

In contrast to per-type reserved values that are applied for all fields
of that type, per-field reserved values are only applied for concrete
field only.

Also add 'struct dm_report_field_reserved_value' to libdm for per-field
reserved value definition. This is defined by field number (an index
in the 'fields' array which is given for the dm_report_init_with_selection
function during report initialization) and the value to use for any
of the specified reserved names.

10 years agotools: add --binary arg to pvs,vgs,lvs and {pv,vg,lv}display -C and report/binary_val...
Peter Rajnoha [Wed, 2 Jul 2014 11:16:32 +0000 (13:16 +0200)]
tools: add --binary arg to pvs,vgs,lvs and {pv,vg,lv}display -C and report/binary_values_as_numeric lvm.conf option

The --binary option, if used, causes all the binary values reported
in reporting commands to be displayed as "0" or "1" instead of descriptive
literal values (value "unknown" is still used for values that could not be
determined).

Also, add report/binary_values_as_numeric lvm.conf option with the same
functionality as the --binary option (the --binary option prevails
if both --binary cmd option and report/binary_values_as_numeric lvm.conf
option is used at the same time). The report/binary_values_as_numeric is
also profilable.

This makes it easier to use and check lvm reporting command output in scripts.

10 years agoreport: add separate fields for PV/VG/LV attributes
Peter Rajnoha [Wed, 2 Jul 2014 09:09:14 +0000 (11:09 +0200)]
report: add separate fields for PV/VG/LV attributes

Physical Volume Fields:
  pv_allocatable         - Whether this device can be used for allocation.
  pv_exported            - Whether this device is exported.
  pv_missing             - Whether this device is missing in system.

Volume Group Fields:
  vg_permissions         - VG permissions.
  vg_extendable          - Whether VG is extendable.
  vg_exported            - Whether VG is exported.
  vg_partial             - Whether VG is partial.
  vg_allocation_policy   - VG allocation policy.
  vg_clustered           - Whether VG is clustered.

Logical Volume Fields:
  lv_volume_type         - LV volume type.
  lv_initial_image_sync  - Whether mirror/RAID images underwent initial resynchronization.
  lv_image_synced        - Whether mirror/RAID image is synchronized.
  lv_merging             - Whether snapshot LV is being merged to origin.
  lv_converting          - Whether LV is being converted.
  lv_allocation_policy   - LV allocation policy.
  lv_allocation_locked   - Whether LV is locked against allocation changes.
  lv_fixed_minor         - Whether LV has fixed minor number assigned.
  lv_merge_failed        - Whether snapshot merge failed.
  lv_snapshot_invalid    - Whether snapshot LV is invalid.
  lv_target_type         - Kernel target type the LV is related to.
  lv_health_status       - LV health status.
  lv_skip_activation     - Whether LV is skipped on activation.

Logical Volume Info Fields
  lv_permissions         - LV permissions.
  lv_suspended           - Whether LV is suspended.
  lv_live_table          - Whether LV has live table present.
  lv_inactive_table      - Whether LV has inactive table present.
  lv_device_open         - Whether LV device is open.

10 years agorefactor: use new LVSINFO report type for lv_kernel_{major,minor,read_ahead} field
Peter Rajnoha [Wed, 2 Jul 2014 12:31:39 +0000 (14:31 +0200)]
refactor: use new LVSINFO report type for lv_kernel_{major,minor,read_ahead} field

10 years agoreporter: add separate LVSINFO report type
Peter Rajnoha [Wed, 2 Jul 2014 07:45:53 +0000 (09:45 +0200)]
reporter: add separate LVSINFO report type

LVSINFO is exactly the same as existing LVS report type,
but it has the "struct lvinfo" populated in addition for
use - this is useful for fields that display the status
of the LV device itself (e.g. suspended state, tables
present/missing...).

Currently, such properties are reported within the "lv_attr"
field so separation is unnecessary - the "lvinfo" call
to populate the "struct lvinfo" is directly a part of the
field reporting function - _lvstatus_disp/lv_attr_dup.

With upcoming patches, we'd like the lv_attr field bits
to be separated into their own fields. To avoid calling
"lvinfo" fn as many times as there are fields requiring
the "lv_info" structure to be populated while reporting
one row related to one LV, we're separating former LVS
into LVS and LVSINFO report type. With this, there's
just one "lvinfo" call for one report row and LV reporting
fields will take the info needed from this struct then,
hence reusing it and not calling "lvinfo" fn on their own.

10 years agolv_manip: add get_lv_type_name/lv_is_linear and lv_is_striped helper fns
Peter Rajnoha [Tue, 1 Jul 2014 08:37:01 +0000 (10:37 +0200)]
lv_manip: add get_lv_type_name/lv_is_linear and lv_is_striped helper fns

The get_lv_type_name helps with translating volume type
to human readable form (can be used in reports or
various messages if needed).

The lv_is_linear and lv_is_striped complete the set of
lv_is_* functions that identify exact volume types.

10 years agorefactor: remove static modifier for lv_raid_image_in_sync and lv_raid_healthy fn
Peter Rajnoha [Tue, 1 Jul 2014 07:56:03 +0000 (09:56 +0200)]
refactor: remove static modifier for lv_raid_image_in_sync and lv_raid_healthy fn

...to make use of it in other parts of the code.

10 years agocleanup: just safely copy string
Zdenek Kabelac [Thu, 3 Jul 2014 19:31:15 +0000 (21:31 +0200)]
cleanup: just safely copy string

Keep analyzers happier and use constrained strcpy.

10 years agocleanup: drop unneeded initialization
Zdenek Kabelac [Thu, 3 Jul 2014 19:30:27 +0000 (21:30 +0200)]
cleanup: drop unneeded initialization

Code assigns this variable right after clearing.

10 years agodev-type: print aborting log_error
Zdenek Kabelac [Thu, 3 Jul 2014 10:15:19 +0000 (12:15 +0200)]
dev-type: print aborting log_error

When wiping is aborted print immediate log_error message
(log_error comes 1st.)

10 years agodev-type: print log_sys_debug
Zdenek Kabelac [Thu, 3 Jul 2014 10:03:16 +0000 (12:03 +0200)]
dev-type: print log_sys_debug

For non-fatal error use log_sys_debug as the tool
is not stopping on these errors.

10 years agovgsplit: Improve message when LV still active.
Alasdair G Kergon [Fri, 4 Jul 2014 00:13:51 +0000 (01:13 +0100)]
vgsplit: Improve message when LV still active.

Mention parent LV as well as the LV triggering the warning.

Still leaves some confusing cases but its not worth fixing them
at the moment.
(Thin pool inactive but a thin volume active => deactivate thin vol.
Inactive mirror/raid with pvmove in progress => complete pvmove and
active&deactivate mirror/raid.
If new VG already exists it requires some LVs to be inactive
unnecessarily.)

10 years agoreport: Add lv_parent field.
Alasdair G Kergon [Thu, 3 Jul 2014 22:49:34 +0000 (23:49 +0100)]
report: Add lv_parent field.

Only defined for thin/cache/raid/mirror at this stage as it
relies on get_only_segment_using_this_lv().

10 years agovgsplit: Fix VG component of lvid.
Alasdair G Kergon [Thu, 3 Jul 2014 18:06:04 +0000 (19:06 +0100)]
vgsplit: Fix VG component of lvid.

Fix VG component of lvid in vgsplit and vgmerge
Update vg_validate() to detect the error.
Call lv_is_active() before moving LV into new VG, not after.

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