]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agopolldaemon: get get_copy_vg ready for refactoring
Ondrej Kozina [Tue, 5 May 2015 14:06:24 +0000 (16:06 +0200)]
polldaemon: get get_copy_vg ready for refactoring

with refactored code we take some VG locks as read-only.
Make the poll_get_copy_vg ready for the change.

9 years agolvconvert: code cleanup and preps for refactoring
Ondrej Kozina [Tue, 5 May 2015 13:11:50 +0000 (15:11 +0200)]
lvconvert: code cleanup and preps for refactoring

just a code cleanup and preparations for adding
new code required for polldaemon refactoring.
This commit should not have any functional impact.

9 years agopolldaemon: respect lv_attr parm in poll_get_copy_lv
Ondrej Kozina [Mon, 4 May 2015 13:41:27 +0000 (15:41 +0200)]
polldaemon: respect lv_attr parm in poll_get_copy_lv

as a part of bigger effort to unify polling intefaces
poll_get_copy_lv should be able to look up LVs based
on theirs lv->status field.

Effective after pvmove starts using poll_get_copy_lv
fn as well.

9 years agopolldaemon: move lvconvert_get_copy_lv code
Ondrej Kozina [Fri, 10 Apr 2015 11:57:13 +0000 (13:57 +0200)]
polldaemon: move lvconvert_get_copy_lv code

Moving lvconvert_get_copy_lv to polldaemon (poll_get_copy_lv).
Clear move and rename.

9 years agopolldaemon: move lvconvert_get_copy_vg code
Ondrej Kozina [Mon, 4 May 2015 12:32:32 +0000 (14:32 +0200)]
polldaemon: move lvconvert_get_copy_vg code

Moving lvconvert_get_copy_vg to polldaemon (poll_get_copy_vg).
Clear move and rename.

9 years agotests: play better with mdadm
Zdenek Kabelac [Mon, 4 May 2015 11:07:33 +0000 (13:07 +0200)]
tests: play better with mdadm

Manage mdadm devices on older distros is a challange.

9 years agoraid: reread status when 0 is reported
Zdenek Kabelac [Mon, 4 May 2015 09:25:00 +0000 (11:25 +0200)]
raid: reread status when 0 is reported

When kernel target reports sync status as 0%  it might as well mean
it's 100% in sync, just the target is in some race inconsistent
state - so reread once again and take a more optimistic value ;)

Patch tries to work around:
https://bugzilla.redhat.com/show_bug.cgi?id=1210637

9 years agotests: check for open_count
Zdenek Kabelac [Mon, 4 May 2015 08:18:44 +0000 (10:18 +0200)]
tests: check for open_count

Instead of checking /proc/mounts check for open_count of snap device.
Parallel umount has race, so check for open_count.

9 years agotests: drop extra scsi init
Zdenek Kabelac [Mon, 4 May 2015 08:17:48 +0000 (10:17 +0200)]
tests: drop extra scsi init

Use first test also for checking the support is there -
avoid one extra unnecessary scsi_debug reload.

9 years agotests: check for clvmd process entry
Zdenek Kabelac [Mon, 4 May 2015 08:16:33 +0000 (10:16 +0200)]
tests: check for clvmd process entry

Instead of checking just for pid file - rather check
for process  - since there could be slight race, the
pid file is gone, but process still exists.

9 years agotests: validate passed LVM_TEST_DEVDIR
Zdenek Kabelac [Mon, 4 May 2015 08:15:56 +0000 (10:15 +0200)]
tests: validate passed LVM_TEST_DEVDIR

Quit test early if passed LVM_TEST_DEVDIR dir does not exists.

9 years agotests: wait for scsi device to appear
Zdenek Kabelac [Mon, 4 May 2015 08:14:52 +0000 (10:14 +0200)]
tests: wait for scsi device to appear

Continue with test as soon as device appear (avoid 2s delay)

9 years agotests: dd needs to fail in this case
Zdenek Kabelac [Sat, 2 May 2015 23:06:20 +0000 (01:06 +0200)]
tests: dd needs to fail in this case

9 years agotests: more waits on restart
Zdenek Kabelac [Sat, 2 May 2015 22:29:06 +0000 (00:29 +0200)]
tests: more waits on restart

Check for socket presence (hardcoded for now)

9 years agotests: use 800ms write delay
Zdenek Kabelac [Sat, 2 May 2015 20:03:19 +0000 (22:03 +0200)]
tests: use 800ms write delay

Since this value magically worked for  pvmove-abort*
use it here as well.

Also prepate_lvmetad has better kill&reload mechanism.

9 years agotests: use odirect
Zdenek Kabelac [Sat, 2 May 2015 19:14:45 +0000 (21:14 +0200)]
tests: use odirect

Fill snaphot with odirect so we know data hits disk
before we test how full the snapshot is.

9 years agolvm2app: call fin_locking in lvm_quit
Zdenek Kabelac [Sat, 2 May 2015 19:13:15 +0000 (21:13 +0200)]
lvm2app: call fin_locking in lvm_quit

lvm_quit() function should also close locking.
Fixes unclosed socket connecting clvmd.

9 years agoconfigure: detect /run dir
Zdenek Kabelac [Sat, 2 May 2015 21:57:52 +0000 (23:57 +0200)]
configure: detect /run dir

Access /run directly when system supports it.

9 years agoclvmd: missed newline in help text
Zdenek Kabelac [Sat, 2 May 2015 22:30:14 +0000 (00:30 +0200)]
clvmd: missed newline in help text

Print \n after listing included lock managers.

9 years agopost-release
Alasdair G Kergon [Sat, 2 May 2015 00:52:05 +0000 (01:52 +0100)]
post-release

9 years agopre-release v2_02_119
Alasdair G Kergon [Sat, 2 May 2015 00:41:17 +0000 (01:41 +0100)]
pre-release

9 years agoconfig: Remove newly-exposed default settings.
Alasdair G Kergon [Fri, 1 May 2015 23:07:12 +0000 (00:07 +0100)]
config: Remove newly-exposed default settings.

Reinstate config settings matching the last release until every
case where the generator produces different output has been reviewed
and fresh decisions made about which defaults to expose as protection
against changes in newer releases. We should be trying to reduce, not
increase, this number.

9 years agotests: more advance cleanup of running pvmove
Zdenek Kabelac [Fri, 1 May 2015 20:42:10 +0000 (22:42 +0200)]
tests: more advance cleanup of running pvmove

More take down more targets and use time-limited code.

9 years agotests: configure use_lvmetad when needed
Zdenek Kabelac [Fri, 1 May 2015 20:40:58 +0000 (22:40 +0200)]
tests: configure use_lvmetad when needed

9 years agoman: expanded explanation of lvmetad
David Teigland [Fri, 1 May 2015 19:45:50 +0000 (14:45 -0500)]
man: expanded explanation of lvmetad

9 years agoman: expanded explanation of pvscan
David Teigland [Fri, 1 May 2015 18:44:31 +0000 (13:44 -0500)]
man: expanded explanation of pvscan

Related to it's role with lvmetad and auto-activation.

9 years agotests: free -h is quite new option
Zdenek Kabelac [Fri, 1 May 2015 13:37:50 +0000 (15:37 +0200)]
tests: free -h is quite new option

Stay with -g and and ignore failure.

9 years agotests: minor simplifications
Zdenek Kabelac [Thu, 30 Apr 2015 19:51:43 +0000 (21:51 +0200)]
tests: minor simplifications

minor updates

9 years agotests: disable usage of fuser
Zdenek Kabelac [Fri, 1 May 2015 11:26:07 +0000 (13:26 +0200)]
tests: disable usage of fuser

Seems we captured problems with debug.log overwrite,
so avoid quite expensive usage of fuser tool with each lvm command.

9 years agotests: run api tests from startup dir
Zdenek Kabelac [Fri, 1 May 2015 13:01:33 +0000 (15:01 +0200)]
tests: run api tests from startup dir

9 years agotests: no lvmetad reload for debugless output
Zdenek Kabelac [Fri, 1 May 2015 12:45:47 +0000 (14:45 +0200)]
tests: no lvmetad reload for debugless output

Introduce LVM_TEST_LVMETAD_DEBUG_OPTS to allow to override
default debug opts for lvmetad.

However could be still overloaded on command line:

make check_lvmetad LVM_TEST_LVMETAD_DEBUG_OPTS="-l all"...

9 years agotests: lower version of dm-delay
Zdenek Kabelac [Thu, 30 Apr 2015 20:21:18 +0000 (22:21 +0200)]
tests: lower version of dm-delay

Let's see what will break with lower version 1.1.

Also avoid repeated check of target version.

9 years agotests: rename kill_tagged_processes
Zdenek Kabelac [Thu, 30 Apr 2015 16:42:31 +0000 (18:42 +0200)]
tests: rename kill_tagged_processes

Better name for aux function.
First use normal -TERM, and only after a while use -KILL
(leaving some time to correctly finish)
Print INFO about killed processes.

9 years agotests: move conf preparing
Zdenek Kabelac [Thu, 30 Apr 2015 11:57:54 +0000 (13:57 +0200)]
tests: move conf preparing

If the test in the middle is restarting lvmetad
avoid conf regenerating.

9 years agotests: hide error message
Zdenek Kabelac [Thu, 30 Apr 2015 11:57:08 +0000 (13:57 +0200)]
tests: hide error message

Hide error about missing declare -A  support.

9 years agotests: wait between remount
Zdenek Kabelac [Thu, 30 Apr 2015 11:43:31 +0000 (13:43 +0200)]
tests: wait between remount

Let's see if this help with some races...

9 years agotests: move kernel_at_least to aux
Zdenek Kabelac [Thu, 30 Apr 2015 11:23:56 +0000 (13:23 +0200)]
tests: move kernel_at_least to aux

Hide func processing and reuse existing
version_at_least().

9 years agotests: watch out for RAM size
Zdenek Kabelac [Thu, 30 Apr 2015 09:55:38 +0000 (11:55 +0200)]
tests: watch out for RAM size

Reduce mem-requirements on low memory boxes,
activate less volumes if machine is below 0.5G.

Also print mem size at test header.

9 years agoconfig: add CFG_DEFAULT_COMMENTED to comment out default value on output
Peter Rajnoha [Thu, 30 Apr 2015 16:26:56 +0000 (18:26 +0200)]
config: add CFG_DEFAULT_COMMENTED to comment out default value on output

9 years agoman: lvmconfig: also mention '--type list' in synopsis
Peter Rajnoha [Thu, 30 Apr 2015 16:00:39 +0000 (18:00 +0200)]
man: lvmconfig: also mention '--type list' in synopsis

9 years agolvmconfig: add supporting code for handling deprecated settings
Peter Rajnoha [Thu, 30 Apr 2015 15:40:24 +0000 (17:40 +0200)]
lvmconfig: add supporting code for handling deprecated settings

This patch adds supporting code for handling deprecated settings.

Deprecated settings are not displayed by default in lvmconfig output
(except for --type current and --type diff). There's a new
"--showdeprecated" lvmconfig option to display them if needed.

Also, when using lvmconfig --withcomments, the comments with info
about deprecation are displayed for deprecated settings and with
lvmconfig --withversions, the version in which the setting was
deprecated is displayed in addition to the version of introduction.

If using --atversion with a version that is lower than the one
in which the setting was deprecated, the setting is then considered
as not deprecated (simply because at that version it was not
deprecated).

For example:

$ lvmconfig --type default activation
activation {
        ...
raid_region_size=512
        ...
}

$ lvmconfig --type default activation --showdeprecated
activation {
        ...
mirror_region_size=512
raid_region_size=512
        ...
}

$ lvmconfig --type default activation --showdeprecated --withversions
activation {
        ...
# Available since version 1.0.0.
# Deprecated since version 2.2.99.
mirror_region_size=512
# Available since version 2.2.99.
raid_region_size=512
        ...
}

$ lvmconfig --type default activation --showdeprecated --withcomments
activation {
        ...
# Configuration option activation/mirror_region_size.
# This has been replaced by the activation/raid_region_size
# setting.
# Size (in KB) of each copy operation when mirroring.
# This configuration option is deprecated.
mirror_region_size=512

# Configuration option activation/raid_region_size.
# Size in KiB of each raid or mirror synchronization region.
# For raid or mirror segment types, this is the amount of
# data that is copied at once when initializing, or moved
# at once by pvmove.
raid_region_size=512
        ...
}

$ lvmconfig --type default activation --withcomments --atversion 2.2.98
activation {
       ...
       # Configuration option activation/mirror_region_size.
       # Size (in KB) of each copy operation when mirroring.
       mirror_region_size=512
       ...
}

9 years agoconfig_settings: devices/cache, activation/mirror_region_size and activation/mirror_d...
Peter Rajnoha [Thu, 30 Apr 2015 15:39:59 +0000 (17:39 +0200)]
config_settings: devices/cache, activation/mirror_region_size and activation/mirror_device_fault_policy are deprecated

9 years agoconfig: preparation for marking configuration nodes as deprecated
Peter Rajnoha [Thu, 30 Apr 2015 13:34:07 +0000 (15:34 +0200)]
config: preparation for marking configuration nodes as deprecated

A preparatory code for marking configuration nodes as deprecated:
  - struct cfg_def_item gains 2 new fields ("deprecated_since_version" and "deprecation_comment"
  - cfg* macros to handle new fields
  - related config_settings.h edits to add new fields for each item (null for all at the moment)

Patch with implementation will follow...

9 years agocleanup: config_settings.h: comments
Peter Rajnoha [Thu, 30 Apr 2015 12:43:08 +0000 (14:43 +0200)]
cleanup: config_settings.h: comments

9 years agocleanup: config_settings.h: add some comments
Peter Rajnoha [Thu, 30 Apr 2015 12:28:26 +0000 (14:28 +0200)]
cleanup: config_settings.h: add some comments

9 years agolvmconfig: allow --withversions alone with --type list
Peter Rajnoha [Thu, 30 Apr 2015 12:18:14 +0000 (14:18 +0200)]
lvmconfig: allow --withversions alone with --type list

Before this patch:

$ lvmconfig --type list --withversions --withsummary global/use_lvmetad
global/use_lvmetad - Use lvmetad to cache metadata and reduce disk scanning. [2.2.93]

$ lvmconfig --type list --withversions global/use_lvmetad
global/use_lvmetad

With this patch applied:

$ lvmconfig --type list --withversions --withsummary global/use_lvmetad
global/use_lvmetad - Use lvmetad to cache metadata and reduce disk scanning. [2.2.93]

$ lvmconfig --type list --withversions global/use_lvmetad
global/use_lvmetad - [2.2.93]

9 years agolvmconfig: comment out settings with proper space/tab prefix
Peter Rajnoha [Thu, 30 Apr 2015 11:59:00 +0000 (13:59 +0200)]
lvmconfig: comment out settings with proper space/tab prefix

We're commenting out settings with undefined default values.
The comment character '#' was printed at the very beginning of
the line, it should be placed just at the beginning of the setting,
after the space/tab prefix is printed.

Before this patch:

  $ lvmconfig --type default activation
  activation {
           ...
  #        volume_list=[]
           ...
  }

With this patch applied:

  $ lvmconfig --type default activation
  activation {
           ...
           # volume_list=[]
           ...
  }

9 years agotests: lvmconf update
Zdenek Kabelac [Thu, 30 Apr 2015 09:12:19 +0000 (11:12 +0200)]
tests: lvmconf update

New lvmconf function is using bash associative arrays - however
older systems like RHEL5 doesn't provide this feature. In this case
stay with older variant.

Restore support for use case like this:
aux lvmconf 'tags/@foo {}'

9 years agospec: Pull in lvmconfig and associated manpages.
Petr Rockai [Wed, 29 Apr 2015 15:58:19 +0000 (17:58 +0200)]
spec: Pull in lvmconfig and associated manpages.

9 years agoman: Fix references to lvmcache(7) that mentioned section 8 by mistake.
Petr Rockai [Wed, 22 Apr 2015 17:38:40 +0000 (19:38 +0200)]
man: Fix references to lvmcache(7) that mentioned section 8 by mistake.

9 years agoman: lvmthin section about use-policies
David Teigland [Wed, 29 Apr 2015 15:00:38 +0000 (10:00 -0500)]
man: lvmthin section about use-policies

9 years agoman: 'lvmconfig' is preferred over 'lvm config'
David Teigland [Wed, 29 Apr 2015 15:13:13 +0000 (10:13 -0500)]
man: 'lvmconfig' is preferred over 'lvm config'

9 years agoWHATS_NEW: commit e0a62b8fdc8d041c14ca523643e319
Ondrej Kozina [Wed, 29 Apr 2015 15:04:39 +0000 (17:04 +0200)]
WHATS_NEW: commit  e0a62b8fdc8d041c14ca523643e319

9 years agolibdaemon: introduce support for exit on idle
Ondrej Kozina [Wed, 29 Apr 2015 14:59:30 +0000 (16:59 +0200)]
libdaemon: introduce support for exit on idle

works with systemd activated daemons only as of now

each daemon implementation may decide to signalize its
internal idle state (i.e. all background tasks unrelated to
client threads are finished)

9 years agotoollib: code cleanup in lv_spawn_background_polling
Ondrej Kozina [Wed, 29 Apr 2015 14:25:50 +0000 (16:25 +0200)]
toollib: code cleanup in lv_spawn_background_polling

we're going to extract parameters from lv_mirr later
with code refactoring of polldaemon

9 years agoman: 'lvm config' is preferred over 'lvm lvmconfig'
David Teigland [Wed, 29 Apr 2015 15:04:28 +0000 (10:04 -0500)]
man: 'lvm config' is preferred over 'lvm lvmconfig'

9 years agocleanup: lvmconfig man page typo
Peter Rajnoha [Wed, 29 Apr 2015 14:35:49 +0000 (16:35 +0200)]
cleanup: lvmconfig man page typo

9 years agoconfig: consolidate CFG_UNSUPPORTED and CFG_ADVANCED settings
Peter Rajnoha [Wed, 29 Apr 2015 14:07:52 +0000 (16:07 +0200)]
config: consolidate CFG_UNSUPPORTED and CFG_ADVANCED settings

These settings are in the "unsupported" group:

devices/loopfiles
log/activate_file
metadata/disk_areas (section)
metadata/disk_areas/<disk_area> (section)
metadata/disk_areas/<disk_area>/size
metadata/disk_areas/<disk_area>/id

These settings are in the "advanced" group:

devices/dir
devices/scan
devices/types
global/proc
activation/missing_stripe_filler
activation/mlock_filter
metadata/pvmetadatacopies
metadata/pvmetadataignore
metadata/stripesize
metadata/dirs

Also, this patch causes the --ignoreunsupported and --ignoreadvanced
switches to be honoured for all config types (lvmconfig --type).

By default, the --type current and --type diff display unsupported
settings, the other types ignore them - this patch also introduces
--showunsupported switch for all these other types to display even
unsupported settings in their output if needed.

9 years agotests: minimize teardown when uneeded
Zdenek Kabelac [Wed, 29 Apr 2015 11:37:13 +0000 (13:37 +0200)]
tests: minimize teardown when uneeded

If test has not yet initilized any device,
make teardown a bit faster.

9 years agotests: bash-fu for lvmconf
Zdenek Kabelac [Wed, 29 Apr 2015 10:26:12 +0000 (12:26 +0200)]
tests: bash-fu for lvmconf

Sqeeze about 0.1s out of every created conf and use internal
bash associative arrays instead of lot of command forking

9 years agolvmetad: drop unused vars
Zdenek Kabelac [Wed, 29 Apr 2015 13:00:33 +0000 (15:00 +0200)]
lvmetad: drop unused vars

Squash some unused vars introduced in some previous commit.s

9 years agopython: python 3 compat patch for lvm2
bkabrda@redhat.com [Tue, 2 Sep 2014 13:42:01 +0000 (15:42 +0200)]
python: python 3 compat patch for lvm2

As provided by rhbz: 1136366

9 years agolvmetad: Avoid duplicate entries in the list of alternate devices.
Petr Rockai [Wed, 22 Apr 2015 23:39:39 +0000 (01:39 +0200)]
lvmetad: Avoid duplicate entries in the list of alternate devices.

9 years agolvmconfig: add --type list and -l|--list
Peter Rajnoha [Wed, 29 Apr 2015 09:11:58 +0000 (11:11 +0200)]
lvmconfig: add --type list and -l|--list

lvmconfig --type list displays plain list of configuration settings.
Some of the existing decorations can be used (--withsummary and
--withversions) as well as existing options/switches (--ignoreadvanced,
--ignoreunsupported, --ignorelocal, --atversion).

For example (displaying only "config" section so the list is not long):

$lvmconfig --type list config
config/checks
config/abort_on_errors
config/profile_dir

$ lvmconfig --type list --withsummary config
config/checks - If enabled, any LVM configuration mismatch is reported.
config/abort_on_errors - Abort the LVM process if a configuration mismatch is found.
config/profile_dir - Directory where LVM looks for configuration profiles.

$ lvmconfig -l config
config/checks - If enabled, any LVM configuration mismatch is reported.
config/abort_on_errors - Abort the LVM process if a configuration mismatch is found.
config/profile_dir - Directory where LVM looks for configuration profiles.

$ lvmconfig --type list --withsummary --withversions config
config/checks - If enabled, any LVM configuration mismatch is reported. [2.2.99]
config/abort_on_errors - Abort the LVM process if a configuration mismatch is found. [2.2.99]
config/profile_dir - Directory where LVM looks for configuration profiles. [2.2.99]

Example with --atversion (displaying global section):

$ lvmconfig --type list global
global/umask
global/test
global/units
global/si_unit_consistency
global/suffix
global/activation
global/fallback_to_lvm1
global/format
global/format_libraries
global/segment_libraries
global/proc
global/etc
global/locking_type
global/wait_for_locks
global/fallback_to_clustered_locking
global/fallback_to_local_locking
global/locking_dir
global/prioritise_write_locks
global/library_dir
global/locking_library
global/abort_on_internal_errors
global/detect_internal_vg_cache_corruption
global/metadata_read_only
global/mirror_segtype_default
global/raid10_segtype_default
global/sparse_segtype_default
global/lvdisplay_shows_full_device_path
global/use_lvmetad
global/thin_check_executable
global/thin_dump_executable
global/thin_repair_executable
global/thin_check_options
global/thin_repair_options
global/thin_disabled_features
global/cache_check_executable
global/cache_dump_executable
global/cache_repair_executable
global/cache_check_options
global/cache_repair_options
global/system_id_source
global/system_id_file

$ lvmconfig --type list global --atversion 2.2.50
global/umask
global/test
global/units
global/suffix
global/activation
global/fallback_to_lvm1
global/format
global/format_libraries
global/segment_libraries
global/proc
global/locking_type
global/wait_for_locks
global/fallback_to_clustered_locking
global/fallback_to_local_locking
global/locking_dir
global/library_dir
global/locking_library

9 years agorefactor: dumpconfig: keep --withcomments to display full comment and use --withsumma...
Peter Rajnoha [Wed, 29 Apr 2015 08:53:25 +0000 (10:53 +0200)]
refactor: dumpconfig: keep --withcomments to display full comment and use --withsummary for one line summary

9 years agopolldaemon: remove redundant log messages
Ondrej Kozina [Tue, 14 Apr 2015 12:43:16 +0000 (14:43 +0200)]
polldaemon: remove redundant log messages

also alter comments describing the change in _poll_vg
wrt correct handling of multiple LVs

9 years agopvmove: make log messages more comprehensible
Ondrej Kozina [Thu, 16 Apr 2015 15:40:53 +0000 (17:40 +0200)]
pvmove: make log messages more comprehensible

clarify messages printed during pvmove set up (in
_update_metadata fn) and subsequent metadata updates
during a segment progression

9 years agoupdate copyright info in various files
Ondrej Kozina [Thu, 16 Apr 2015 15:31:07 +0000 (17:31 +0200)]
update copyright info in various files

basically transfer former date ranges from files where
the code originated from (pvmove.c and lvconvert.c)

9 years agotests: try harder to kill all dangling procs
Ondrej Kozina [Tue, 28 Apr 2015 13:31:47 +0000 (15:31 +0200)]
tests: try harder to kill all dangling procs

also simplify and make less prone to an error checks
for running bg processes inside a pvmove-resume tests

9 years agotests: simplify removal of dangling bg procs
Ondrej Kozina [Mon, 27 Apr 2015 08:33:45 +0000 (10:33 +0200)]
tests: simplify removal of dangling bg procs

some tests left dangling bg processes originating in
lvm2 commands being able to spawn any bg polling process
(lvchange, vgchange, pvmove, lvconvert...)

Initial fn 'add_to_kill_list' should collect processes with
specific parameters (proc's command line and parent processes ID).
After testing finishes the fn kill_listed_processes should remove these
listed by 'add_to_kill_list'.

Unfortunately it proved to be prone to an error especially in scenarios
where cmd line of initiating command contained characters required to
be espaced before passing to shell script to make it work correctly.
(Or if cmd spawned more than one bg process with same cmd line. i.e.:
vgchange or lvchange).

The new implementation is much simpler. It uses env. variable (LVM_TEST_TAG)
for marking a process desired to be killed later or during test env. teardown.
(i.e.: LVM_TEST_TAG=kill_me_$PREFIX to kill only processes related to
current test environment)

9 years agoconfig: Introduce lvmconfig.
Alasdair G Kergon [Tue, 28 Apr 2015 16:00:37 +0000 (17:00 +0100)]
config: Introduce lvmconfig.

'lvm dumpconfig' now does a lot more than just dumping configuration
information and is no longer only a support tool.  Users now need
to run it to find out about configuration information that has been
removed from the lvm.conf man page so we need to promote this to full
command line status as 'lvmconfig'.  Also accept 'lvm config' and mention
it in the usage information of lvmconf (which should also get merged in
eventually).

9 years agodevices: improve handling of duplicate PVs
David Teigland [Fri, 24 Apr 2015 19:58:58 +0000 (14:58 -0500)]
devices: improve handling of duplicate PVs

Example:

/dev/loop0 and /dev/loop1 are duplicates,
created by copying one backing file to the
other.

'identity /dev/loopX' creates an identity
mapping for loopX named idmloopX, which
adds a duplicate for the named device.

The duplicate selection code for lvmetad is
incomplete, and lvmetad is disabled for this
example.

[~]# losetup -f loopfile0
[~]# pvs
  PV         VG           Fmt  Attr PSize   PFree
  /dev/loop0 foo          lvm2 a--  308.00m 296.00m

[~]# losetup -f loopfile1
[~]# pvs
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/loop1 not /dev/loop0
  Using duplicate PV /dev/loop1 which is more recent, replacing /dev/loop0
  PV         VG           Fmt  Attr PSize   PFree
  /dev/loop1 foo          lvm2 a--  308.00m 308.00m

[~]# ./identity /dev/loop0
[~]# pvs
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/loop1 not /dev/loop0
  Using duplicate PV /dev/loop1 without holders, replacing /dev/loop0
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/mapper/idmloop0 not /dev/loop1
  Using duplicate PV /dev/mapper/idmloop0 from subsystem DM, replacing /dev/loop1
  PV                   VG           Fmt  Attr PSize   PFree
  /dev/mapper/idmloop0 foo          lvm2 a--  308.00m 296.00m

[~]# ./identity /dev/loop1
[~]# pvs
  WARNING: duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV is being used from both devices /dev/loop0 and /dev/loop1
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/loop1 not /dev/loop0
  Using duplicate PV /dev/loop1 which is more recent, replacing /dev/loop0
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/mapper/idmloop0 not /dev/loop1
  Using duplicate PV /dev/mapper/idmloop0 from subsystem DM, replacing /dev/loop1
  Found duplicate PV LnSOEqzEYED3RvIOa5PZP2s7uyuBLmAV: using /dev/mapper/idmloop1 not /dev/mapper/idmloop0
  Using duplicate PV /dev/mapper/idmloop1 which is more recent, replacing /dev/mapper/idmloop0
  PV                   VG           Fmt  Attr PSize   PFree
  /dev/mapper/idmloop1 foo          lvm2 a--  308.00m 308.00m

9 years agoconfig: improve the description of options lists
David Teigland [Tue, 28 Apr 2015 15:06:23 +0000 (10:06 -0500)]
config: improve the description of options lists

Describe
thin_check_options, thin_repair_options,
cache_check_option, scache_repair_options

as a "list of options", rather than a "string of options"
because a single string, e.g. "-q --clear-needs-check-flag"
does not work, and needs to be entered as a list,
e.g. ["-q", "--clear-needs-check-flag"]

9 years agoconfig: also evaluate default unconfigured values in runtime for 'cfg_runtime' settings
Peter Rajnoha [Tue, 28 Apr 2015 13:29:08 +0000 (15:29 +0200)]
config: also evaluate default unconfigured values in runtime for 'cfg_runtime' settings

The settings which have their default value evaluated in runtime should
have their 'unconfigured' counterparts also evaluated in runtime since
those values can be constructed by using other settings.

For example, before this patch:

$ lvm dumpconfig --type default --unconfigured devices/cache_dir devices/cache
cache_dir="@DEFAULT_SYS_DIR@/@DEFAULT_CACHE_SUBDIR@"
cache="/etc/lvm/cache/.cache

With this patch applied:

$ lvm dumpconfig --type default --unconfigured devices/cache_dir devices/cache
cache_dir="@DEFAULT_SYS_DIR@/@DEFAULT_CACHE_SUBDIR@"
cache="@DEFAULT_SYS_DIR@/@DEFAULT_CACHE_SUBDIR@/.cache"

9 years agoconfig: make it possible to set default unconfigured_value for settings of all types...
Peter Rajnoha [Tue, 28 Apr 2015 11:50:23 +0000 (13:50 +0200)]
config: make it possible to set default unconfigured_value for settings of all types, not just strings

The @something@ used for unconfigured default value is not bound to
CFG_TYPE_STRING settings defined in config_settings.h, it can be
used for any other config type too.

9 years agorefactor: rename struct cfg_def_item's 'unconfigured_path' to 'unconfigured_value'
Peter Rajnoha [Tue, 28 Apr 2015 11:29:18 +0000 (13:29 +0200)]
refactor: rename struct cfg_def_item's 'unconfigured_path' to 'unconfigured_value'

It's not only path that can be used for setting's default value
in unconfigured form as @something@.

9 years agoconf: Avoid temp files when generating config.
Alasdair G Kergon [Tue, 28 Apr 2015 12:02:19 +0000 (13:02 +0100)]
conf: Avoid temp files when generating config.

9 years agotests: more help#
Zdenek Kabelac [Tue, 28 Apr 2015 09:35:56 +0000 (11:35 +0200)]
tests: more help#

9 years agotests: always zero disk header
Zdenek Kabelac [Tue, 28 Apr 2015 09:32:52 +0000 (11:32 +0200)]
tests: always zero disk header

It appear that older wipefs doesn't wipe partition table.
So ensure there is no partition on LVM_TEST_BACKING_DEVICE.

9 years agotests: more descriptive aux
Zdenek Kabelac [Mon, 27 Apr 2015 15:45:10 +0000 (17:45 +0200)]
tests: more descriptive aux

Tell what's reason of aux fail here.

9 years agotests: drop debug test
Zdenek Kabelac [Mon, 27 Apr 2015 15:44:29 +0000 (17:44 +0200)]
tests: drop debug test

Remove 'debug leftover' from test.

9 years agoexample.conf.in: regenerate
David Teigland [Mon, 27 Apr 2015 19:15:24 +0000 (14:15 -0500)]
example.conf.in: regenerate

From recent config_settings.h changes.

9 years agoconfig: fix a couple mistakes with defaults
David Teigland [Mon, 27 Apr 2015 18:17:15 +0000 (13:17 -0500)]
config: fix a couple mistakes with defaults

for archive, archive_dir, and cache

9 years agotests: use new help in aux
Zdenek Kabelac [Fri, 24 Apr 2015 22:38:06 +0000 (00:38 +0200)]
tests: use new help in aux

Simplify tests and use aux mdadm helpers.

9 years agotests: aux for mdadm
Zdenek Kabelac [Fri, 24 Apr 2015 22:37:27 +0000 (00:37 +0200)]
tests: aux for mdadm

Implement aux helper fce for mdadm.

9 years agotests: allow add printable skip message
Zdenek Kabelac [Fri, 24 Apr 2015 18:32:21 +0000 (20:32 +0200)]
tests: allow add printable skip message

9 years agotests: check sysfs more generically
Zdenek Kabelac [Fri, 24 Apr 2015 18:31:22 +0000 (20:31 +0200)]
tests: check sysfs more generically

Allow to access more files in device sysfs subtree.

9 years agotests: add double quotes around add_to_kill_list parms
Ondrej Kozina [Fri, 24 Apr 2015 09:42:26 +0000 (11:42 +0200)]
tests: add double quotes around add_to_kill_list parms

9 years agotests: try more advanced clean
Zdenek Kabelac [Fri, 24 Apr 2015 09:12:55 +0000 (11:12 +0200)]
tests: try more advanced clean

When test is executed on real device - lets try a more complete
cleanup - discard whole device first and try to wipe any
headers it might be left from previous test.

9 years agocleanup: ancestors -> lv_ancestors, descendants -> lv_descendants
Peter Rajnoha [Fri, 24 Apr 2015 12:19:23 +0000 (14:19 +0200)]
cleanup: ancestors -> lv_ancestors, descendants -> lv_descendants

Use "lv_" prefix as they're LV fields.

9 years agoreport: add lv_ancestors and lv_descendants reporting fields
Peter Rajnoha [Fri, 24 Apr 2015 09:51:52 +0000 (11:51 +0200)]
report: add lv_ancestors and lv_descendants reporting fields

Show full chain of ancestors and descendants for snapshots
(both thick and thin - in case of thick, the "ancestor" field
is actually equal to "origin" field as snapshots can't be
chained for thick snapshots).

These fields display current state as it is, they do not
display any history! If the snapshot chain is broken in
the middle, we don't report the historical origin (this
is going to be a part of another patch and a different
set of fields or just a switch for existing fields to
show ancestors and descendants with history included).

For example:

(origin --> snapshot)

lvol1 --> lvol2 --> lvol3 --> lvol4
              \
                --> lvol5 --> lvol6 --> lvol7 --> lvol8

$ lvs -o name,pool_lv,origin,ancestors,descendants vg
  LV    Pool Origin Ancestors                     Descendants
  lvol1 pool                                      lvol2,lvol3,lvol4,lvol5,lvol6,lvol7,lvol8
  lvol2 pool lvol1  lvol1                         lvol3,lvol4,lvol5,lvol6,lvol7,lvol8
  lvol3 pool lvol2  lvol2,lvol1                   lvol4
  lvol4 pool lvol3  lvol3,lvol2,lvol1
  lvol5 pool lvol2  lvol2,lvol1                   lvol6,lvol7,lvol8
  lvol6 pool lvol5  lvol5,lvol2,lvol1             lvol7,lvol8
  lvol7 pool lvol6  lvol6,lvol5,lvol2,lvol1       lvol8
  lvol8 pool lvol7  lvol7,lvol6,lvol5,lvol2,lvol1

9 years agoselect: fix matching reserved values while <,<=,>,>= is used in selection criteria
Peter Rajnoha [Fri, 24 Apr 2015 07:47:25 +0000 (09:47 +0200)]
select: fix matching reserved values while <,<=,>,>= is used in selection criteria

Scenario:

$ vgs -o+vg_mda_copies
  VG     #PV #LV #SN Attr   VSize VFree #VMdaCps
  fedora   1   2   0 wz--n- 9.51g    0  unmanaged
  vg      16   9   0 wz--n- 1.94g 1.83g         2

$ lvs -o+read_ahead vg/lvol6 vg/lvol7
  LV    VG   Attr       LSize Pool Origin Data%  Rahead
  lvol6 vg   Vwi-a-tz-- 1.00g pool lvol5  0.00      auto
  lvol7 vg   Vwi---tz-k 1.00g pool lvol6         256.00k

Before this patch:

$vgs -o vg_name,vg_mda_copies -S 'vg_mda_copies < unmanaged'
  VG   #VMdaCps
  vg          2

Problem:
Reserved values can be only used with exact match = or !=, not <,<=,>,>=.
In the example above, the "unamanaged" is internally represented as
18446744073709551615, but this should be ignored while not comparing
field directly with "unmanaged" reserved name with = or !=. Users
should not be aware of this internal mapping of the reserved value
name to its internal value and hence it doesn't make sense for such
reserved value to take place in results of <,<=,> and >=.
There's no order defined for reserved values!!! It's a special
*reserved* value that is taken out of the usual value range
of that type.

This is very similar to what we have already fixed with
2f7f6932dcd450ba75fe590aba8c09838d2618dc, but it's the other way round
now - we're using reserved value name in selection criteria now
(in the patch 2f7f693, we had concrete value and we compared it
with the reserved value). So this patch completes patch 2f7f693.

This patch also fixes this problem:

$ lvs -o+read_ahead vg/lvol6 vg/lvol7 -S 'read_ahead > 32k'
  LV    VG   Attr       LSize Pool Origin Data%  Rahead
  lvol6 vg   Vwi-a-tz-- 1.00g pool lvol5  0.00      auto
  lvol7 vg   Vwi---tz-k 1.00g pool lvol6         256.00k

Problem:
In the example above, the internal reserved value "auto" is in the
range of selection "> 32k" - it shouldn't match as well. Here the
"auto" is internally represented as MAX_DBL and of course, numerically,
MAX_DBL > 256k. But for users, the reserved value should be uncomparable
to any number so the mapping of the reserved value name to its interna
 value is transparent to users. Again, there's no order defined for
reserved values and hence it should never match if using <,<=,>,>=
operators.

This is actually exactly the same problem as already described in
2f7f6932dcd450ba75fe590aba8c09838d2618dc, but that patch failed for
size field types because of incorrect internal representation used.

With this patch applied, both problematic scenarios mentioned
above are fixed now:

$ vgs -o vg_name,vg_mda_copies -S 'vg_mda_copies < unmanaged'
(blank)

$ lvs -o+read_ahead vg/lvol6 vg/lvol7 -S 'read_ahead > 32k'
  LV    VG   Attr       LSize Pool Origin Rahead
  lvol7 vg   Vwi---tz-k 1.00g pool lvol6  256.00k

9 years agotests: fix md raid test on real /dev
Zdenek Kabelac [Thu, 23 Apr 2015 18:26:19 +0000 (20:26 +0200)]
tests: fix md raid test on real /dev

Zero raid signatures when raid is stopped - so signatures
are not requiring wipe when pvcreate follows.

Handle real /dev

9 years agolibdm: Add uuid/devno to ioctl failure log message.
Alasdair G Kergon [Thu, 23 Apr 2015 18:26:52 +0000 (19:26 +0100)]
libdm: Add uuid/devno to ioctl failure log message.

9 years agolibdm: Add DM_INTERNAL_SUSPEND_FLAG.
Alasdair G Kergon [Thu, 23 Apr 2015 17:39:04 +0000 (18:39 +0100)]
libdm: Add DM_INTERNAL_SUSPEND_FLAG.

Still needs to be reported by dmsetup.

9 years agoconfig: fix check_options array
David Teigland [Thu, 23 Apr 2015 15:35:34 +0000 (10:35 -0500)]
config: fix check_options array

The code used it as both a single string, and as
an array of strings in different places.  Fix it
so that it's an array of strings everywhere.

9 years agoconfig: thin_disabled_features default should be undefined
David Teigland [Thu, 23 Apr 2015 15:19:00 +0000 (10:19 -0500)]
config: thin_disabled_features default should be undefined

An array that's empty by default should be flagged as
undefined.

9 years agoImprove duplicate PV handling
David Teigland [Mon, 20 Apr 2015 19:13:50 +0000 (14:13 -0500)]
Improve duplicate PV handling

Make the processing of duplicate PVs the
same with and without lvmetad.

9 years agoman: Escape single quotes in an example to avoid groff's unicode conversion.
Petr Rockai [Wed, 22 Apr 2015 15:27:43 +0000 (17:27 +0200)]
man: Escape single quotes in an example to avoid groff's unicode conversion.

9 years agomake: autoconfisms for generate
David Teigland [Wed, 22 Apr 2015 15:05:02 +0000 (10:05 -0500)]
make: autoconfisms for generate

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