]> sourceware.org Git - lvm2.git/log
lvm2.git
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

9 years agomake: let generate use the just built libdm
David Teigland [Wed, 22 Apr 2015 14:35:50 +0000 (09:35 -0500)]
make: let generate use the just built libdm

9 years agodoc: Update dm kernel files.
Alasdair G Kergon [Wed, 22 Apr 2015 14:34:25 +0000 (15:34 +0100)]
doc: Update dm kernel files.

v4.0-9804-gdb4fd9c

9 years agotests: add missing "" around dev
Zdenek Kabelac [Wed, 22 Apr 2015 09:06:29 +0000 (11:06 +0200)]
tests: add missing "" around dev

9 years agotests: aux works better with installed_testsuite
Zdenek Kabelac [Wed, 22 Apr 2015 09:04:47 +0000 (11:04 +0200)]
tests: aux works better with installed_testsuite

When test suite is used from installed rpm package
we need to handle things better.

This patch is rather first approach - expecting few more
tweaks needed.

9 years agotests: simplify teardown
Zdenek Kabelac [Wed, 22 Apr 2015 09:03:31 +0000 (11:03 +0200)]
tests: simplify teardown

If TESTNAME has not been created yet, avoid running complex teardown.

9 years agomakefiles: avoid // in datadir usage
Zdenek Kabelac [Wed, 22 Apr 2015 08:59:03 +0000 (10:59 +0200)]
makefiles: avoid // in datadir usage

DESTDIR already comes with '/'

9 years agotests: install also api test
Zdenek Kabelac [Wed, 22 Apr 2015 08:57:42 +0000 (10:57 +0200)]
tests: install also api test

Install .t & .py binaries.
On 'make clean'  ensure also -t files are removed.

9 years agotests: drop DEBUG log after success
Zdenek Kabelac [Wed, 22 Apr 2015 08:55:37 +0000 (10:55 +0200)]
tests: drop DEBUG log after success

At this moment LVM_LOG_FILE_EPOCH with
LVM_EXPECTED_EXIT_STATUS  properly deletes debug logs
only for real commands - support for lvm2 API does not yet
exists

9 years agotests: use 800ms delay
Zdenek Kabelac [Wed, 22 Apr 2015 07:01:03 +0000 (09:01 +0200)]
tests: use 800ms delay

Worked better with pvmove-abort-all so use here as well.

9 years agotests: notify drops log always
Zdenek Kabelac [Wed, 22 Apr 2015 07:01:49 +0000 (09:01 +0200)]
tests: notify drops log always

Even on success remove debug.log here.

9 years agotests: explicitely ignore result code
Zdenek Kabelac [Tue, 21 Apr 2015 13:46:03 +0000 (15:46 +0200)]
tests: explicitely ignore result code

9 years agotests: allow to use sysfs filter
Zdenek Kabelac [Tue, 21 Apr 2015 11:27:40 +0000 (13:27 +0200)]
tests: allow to use sysfs filter

Current filtering logic in lvm2 needs some rework.
For now at least enable it in test suite.

9 years agonix: install also mdadm
Zdenek Kabelac [Wed, 22 Apr 2015 07:00:21 +0000 (09:00 +0200)]
nix: install also mdadm

Some tests are checking functinality of lvm2 with mdadm.

9 years agoconfig: thin_repair_options and cache_repair_options are undefined
David Teigland [Tue, 21 Apr 2015 21:01:15 +0000 (16:01 -0500)]
config: thin_repair_options and cache_repair_options are undefined

By default these are empty strings, so the config settings
should be flagged as undefined, so they will be commented
out of the generated config.  Otherwise, the lines:

thin_repair_options=""
cache_repair_options=""

in the dump output cause a warning when processed since
lvm doesn't want an empty string.

Also regenerate lvm.conf.in.

9 years agogenerate example.conf.in, lvmlocal.conf.in
David Teigland [Tue, 21 Apr 2015 20:04:22 +0000 (15:04 -0500)]
generate example.conf.in, lvmlocal.conf.in

These were created by 'make generate'.

9 years agoconfig: remove duplication of settings
David Teigland [Wed, 15 Apr 2015 21:15:30 +0000 (16:15 -0500)]
config: remove duplication of settings

The specific config settings have been removed
from the lvm.conf(5) man page, and replaced with
a description of how to use lvm dumpconfig to
view the settings.

The sample lvm.conf and lvmlocal.conf files are now generated:

example.conf.base  - initial ungenerated part of the file
example.conf.gen   - generated portion from dumpconfig
example.conf.in    - combination of .base and .gen files
example.conf       - result of configure processing .in file

lvmlocal.conf.base - initial ungenerated part of the file
lvmlocal.conf.gen  - generated portion from dumpconfig
lvmlocal.conf.in   - combination of .base and .gen files
lvmlocal.conf      - result of configure processing .in file

Do not edit the .in files, but edit config_settings.h
or the .base files, and then use 'make generate' to create
the new .in files.

- configure
  with options

- make
  creates tools/lvm

- make generate
  uses tools/lvm to create example.conf.in and lvmlocal.conf.in
  by combining .base files with dumpconfig output.

- configure
  with same options as above
  creates example.conf and lvmlocal.conf from .in files

9 years agodumpconfig: add --ignorelocal
David Teigland [Tue, 21 Apr 2015 19:53:54 +0000 (14:53 -0500)]
dumpconfig: add --ignorelocal

When generating a sample lvm.conf file, we don't want to
include the "local" section, which is kept in lvmlocal.conf.

9 years agotoollib: fix duplicate handling in process_each_pv
David Teigland [Mon, 20 Apr 2015 19:35:35 +0000 (14:35 -0500)]
toollib: fix duplicate handling in process_each_pv

With use_lvmetad=0, duplicate PVs /dev/loop0 and /dev/loop1,
where in this example, /dev/loop1 is the cached device
referenced by pv->dev, the command 'pvs /dev/loop0' reports:

Failed to find physical volume "/dev/loop0".

This is because the duplicate PV detection by pvid is
not working because _get_all_devices() is not setting
any dev->pvid for any entries.  This is because the
pvid information has not yet been saved in lvmcache.
This is fixed by calling _get_vgnameids_on_system()
before _get_all_devices(), which has the effect of
caching the necessary pvid information.

With this fix, running pvs /dev/loop0, or pvs /dev/loop1,
produces no error and one line of output for the PV (the
device printed is the one cached in pv->dev, in this
example /dev/loop1.)

Running 'pvs /dev/loop0 /dev/loop1' produces no error
and two lines of output, with each device displayed
on one of the lines.

Running 'pvs -a' shows two PVs, one with loop0 and one
with loop1, and both shown as a member of the same VG.

Running 'pvs' shows only one of the duplicate PVs,
and that shows the device cached in pv->dev (loop1).

The above output is what the duplicate handling code
was previously designed to output in commits:

b64da4d8b521 toollib: search for duplicate PVs only when needed
3a7c47af0e88 toollib: pvs -a should display VG name for each duplicate PV
57d74a45a05e toollib: override the PV device with duplicates
c1f246fedfc3 toollib: handle duplicate pvs in process_in_pv

As a further step after this, we may choose to change
some of those.

For all of these commands, a warning is printed about
the existence of the duplicate PVs:

Found duplicate PV ...: using /dev/loop1 not /dev/loop0

9 years agotests: update to renamed envvars
Zdenek Kabelac [Mon, 20 Apr 2015 17:16:33 +0000 (19:16 +0200)]
tests: update to renamed envvars

Enhance 'not' so 'should' now shows log trace from
command which has failed but should not.

9 years agotests: add extra keyword for timing control
Zdenek Kabelac [Mon, 20 Apr 2015 17:09:02 +0000 (19:09 +0200)]
tests: add extra keyword for timing control

Control logging of timer with
"## timing off"  and "## timing on"

9 years agodebug: change envvar
Zdenek Kabelac [Mon, 20 Apr 2015 17:10:29 +0000 (19:10 +0200)]
debug: change envvar

Rename envvar LVM_LOG_FILE_UNLINK_STATUS to LVM_EXPECTED_EXIT_STATUS
and change compare sign from  '!' to  '>'.

Validate LVM_LOG_FILE_EPOCH and support strictly only
up-to 32 alpha chars. If the content doesn't pass
epoch is simply ignored.

9 years agotests: use new debug logging feature
Zdenek Kabelac [Mon, 20 Apr 2015 08:05:27 +0000 (10:05 +0200)]
tests: use new debug logging feature

Enhance 'not' to manage autodeletion of log files in right cases.
Use separately marked epoch log files for clvmd and dmeventd.
Properly manage stack tracing for new debug.log names.

9 years agodebug: use epoch for dmeventd logging
Zdenek Kabelac [Mon, 20 Apr 2015 08:04:33 +0000 (10:04 +0200)]
debug: use epoch for dmeventd logging

When LVM_LOG_FILE_EPOCH is set, route lvm command debug message
to lvm.conf log file instead of syslog.

9 years agodebug: add new envvar
Zdenek Kabelac [Mon, 20 Apr 2015 08:04:18 +0000 (10:04 +0200)]
debug: add new envvar

Add support for 2 new envvars for internal lvm2 test suite
(though it could be possible usable for other cases)

LVM_LOG_FILE_EPOCH

Whether to add 'epoch' extension that consist from
the envvar 'string' + pid + starttime in kernel units
obtained from /proc/self/stat.

LVM_LOG_FILE_UNLINK_STATUS

Whether to unlink the log depending on return status value,
so if the command is successful the log is automatically
deleted.

API is still for now experimental to catch various issue.

9 years agoWHATS_NEW: update for various commits
Ondrej Kozina [Mon, 20 Apr 2015 08:31:43 +0000 (10:31 +0200)]
WHATS_NEW: update for various commits

add info for various commits, most significant were:

- toollib: close connection to lvmetad after fork
  (fe30658a4d5fe4e4e6bb346c9c9ee7142a98f49d)

- toollib: do not spawn polling in lv_change_activate
  (c26d81d6e6939906729d91fae83cd8bbdd743bb7)

- pvmove: split pvmove_update_metadata function
  (65623b63a20a221b48dfd87455dc77f5ac0c6bf4)

- lvconvert: move poll code in before refactoring
  (5190f566055ab4584772b1288fd8cbf69565eb4a)

- pvmove: move poll code in before refactoring
  (a098aa419f5be5d8f805ab6dc747770e58a4b7b1)

9 years agodumpconfig: add --unconfigured option
David Teigland [Fri, 17 Apr 2015 16:31:16 +0000 (11:31 -0500)]
dumpconfig: add --unconfigured option

Using this option, default string values that are
configurable are printed as unconfigured values,
e.g. "@CONFDIR@" instead of "/etc".

9 years agopvmove: fix wrong error path in _update_metadata
Ondrej Kozina [Thu, 16 Apr 2015 15:46:38 +0000 (17:46 +0200)]
pvmove: fix wrong error path in _update_metadata

fix regression introduced in 65623b63a20a221b48dfd87455dc77f5ac0c6bf4

should return zero no matter the result of resume_lvs fn in error
path

9 years agoconfig: edit descriptions
David Teigland [Wed, 15 Apr 2015 19:21:20 +0000 (14:21 -0500)]
config: edit descriptions

Take some new information and wording from lvm.conf.5.

9 years agodumpconfig: add --withfullcomments option
David Teigland [Wed, 15 Apr 2015 15:56:42 +0000 (10:56 -0500)]
dumpconfig: add --withfullcomments option

--withfullcomments prints all comment lines for each config option.
--withcomments prints only the first comment line, which should be
a short one-line summary of the option.

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