]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agoPython: Improve lv property test coverage
Tony Asleson [Tue, 5 May 2015 18:48:52 +0000 (13:48 -0500)]
Python: Improve lv property test coverage

Improve the python unit test case to cover all of the properties of a LV and
the properties of a LV segment.

In addition we also add a 'tag' to the lv so that we can retrieve it
using the 'lv_tags' property to ensure that this works as expected.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agolvm2app: Correct missing string properties
Tony Asleson [Mon, 4 May 2015 20:20:55 +0000 (15:20 -0500)]
lvm2app: Correct missing string properties

Synopsis: STR_LIST needs to be treated as STR for properties.

For any lvm property that was internally 'typed' as a string list we were failing
to return a string in the property API.  This was due to the fact that for the
properties to work the value needs to either be evaulated as a string or a
number.  This change corrects the macro used to build the memory array of
structures so that the string bitfield is set as needed to ensure that the value
is a string.

https://bugzilla.redhat.com/show_bug.cgi?id=1139920

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agopython: Check for NULL value before constructing string property
Tony Asleson [Mon, 4 May 2015 20:19:48 +0000 (15:19 -0500)]
python: Check for NULL value before constructing string property

When retrieving a property value that is a string, if the character pointer in C
was NULL, we would segfault.  This change checks for non-null before creating a
python string representation.  In the case where the character pointer is NULL
we will return a python 'None' for the value.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agopython: Build correct python value for numerical property
Tony Asleson [Mon, 4 May 2015 19:55:00 +0000 (14:55 -0500)]
python: Build correct python value for numerical property

With the lvm2app C API adding the ability to determine when a property is
signed we can then use this information to construct the correct representation
of the number for python which will maintain value and sign.  Previously, we
only represented the numbers in python as positive integers.

Python long type exceeds the range for unsigned and signed integers, we just
need to use the appropriate parsing code to build correctly.

Python part of the fix for:
https://bugzilla.redhat.com/show_bug.cgi?id=838257

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agolvm2app: Add signed numerical property values
Tony Asleson [Mon, 4 May 2015 19:51:41 +0000 (14:51 -0500)]
lvm2app: Add signed numerical property values

Currently lvm2app properties have the following structure:

typedef struct lvm_property_value {
        uint32_t is_settable:1;
        uint32_t is_string:1;
        uint32_t is_integer:1;
        uint32_t is_valid:1;
        uint32_t padding:28;
        union {
                const char *string;
                uint64_t integer;
        } value;
} lvm_property_value_t;

which assumes that numerical values were in the range of 0 to 2**64-1.  However,
some of the properties were 'signed', like LV major/minor numbers and some
reserved values for properties that represent percentages.  Thus when the
values were retrieved they were in two's complement notation.  So for a -1
major number the API user would get a value of 18446744073709551615.  The
API user could cast the returned value to an int64_t to handle this, but that
requires the API developer to look at the source code and determine when it
should be done.

This change modifies the return property structure to:

typedef struct lvm_property_value {
        uint32_t is_settable:1;
        uint32_t is_string:1;
        uint32_t is_integer:1;
        uint32_t is_valid:1;
        uint32_t is_signed:1;
        uint32_t padding:27;
        union {
                const char *string;
                uint64_t integer;
                int64_t signed_integer;
        } value;
} lvm_property_value_t;

With this addition the API user can interrogate that the value is numerical,
(is_integer = 1) and subsequently check if it's signed (is_signed = 1) too.
If signed, then the API developer should use the union's signed_integer to
avoid casting.

This change maintains backwards compatibility as the structure size remains
unchanged and integer value remains unchanged.  Only the additional bit
taken from the pad is utilized.

Bugzilla reference:
https://bugzilla.redhat.com/show_bug.cgi?id=838257

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agotests: do not restart lvmetad when not necessary
Ondrej Kozina [Wed, 6 May 2015 13:20:11 +0000 (15:20 +0200)]
tests: do not restart lvmetad when not necessary

overlooked pvmove-restart test during cleanup

9 years agoWHATS_NEW: update for recent changes
Ondrej Kozina [Tue, 5 May 2015 17:35:52 +0000 (19:35 +0200)]
WHATS_NEW: update for recent changes

commits:
bda26acf70e92232b1ed644dba6b44ecbff2a058
76a0dffe6f4869de9ca457119c9d7ced837d4e0b

9 years agopolldaemon: make wait_for_single_lv public
Ondrej Kozina [Fri, 10 Apr 2015 14:36:50 +0000 (16:36 +0200)]
polldaemon: make wait_for_single_lv public

referenced by new lvpoll command after lvmpolld
gets merged.

9 years agopolldaemon: introduce _nanosleep function
Ondrej Kozina [Fri, 10 Apr 2015 14:31:28 +0000 (16:31 +0200)]
polldaemon: introduce _nanosleep function

querying future lvmpolld with zero wait time is highly undesirable
and can cause serious performance drop of the future daemon. The new
wrapper function may avoid immediate return from syscal by
introducing minimal wait time on demand.

9 years agopolldaemon: refactor polling interfaces
Ondrej Kozina [Fri, 10 Apr 2015 12:08:19 +0000 (14:08 +0200)]
polldaemon: refactor polling interfaces

Routines responsible for polling of in-progress pvmove, snapshot merge
or mirror conversion each used custom lookup functions to find vg and
lv involved in polling.

Especially pvmove used pvname to lookup pvmove in-progress. The future
lvmpolld will poll each operation by vg/lv name (internally by lvid).
Also there're plans to make pvmove able to move non-overlaping ranges
of extents instead of single PVs as of now. This would also require
to identify the opertion in different manner.

The poll_operation_id structure together with daemon_parms structure they
identify unambiguously the polling task.

9 years agopolldaemon: optimise out waiting after polling
Ondrej Kozina [Tue, 5 May 2015 14:09:53 +0000 (16:09 +0200)]
polldaemon: optimise out waiting after polling

Waiting even after _check_lv_status returned success and
'finished' flag was set to true doesn't make much sense.

Note that while we skip the wait() we also skip the
init_full_scan_done(0) inside the routine. This should
have no impact as long as the code after _wait_for_single_lv
doesn't presume anything about the state of the cache.

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.

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