]> sourceware.org Git - lvm2.git/log
lvm2.git
11 years agosnapshot: update merging fix
Zdenek Kabelac [Tue, 23 Jul 2013 13:15:04 +0000 (15:15 +0200)]
snapshot: update merging fix

Activation is needed only for clustered VG.
For non-clustered VG skip activation, since deactivate_lv()
is called without problems (no testing for lock presence).

(updates f6ded62291682e40c7976d27e48915d9d1538940)

11 years agothin: use 64bit arithmetic for checking meta size
Zdenek Kabelac [Tue, 23 Jul 2013 08:46:50 +0000 (10:46 +0200)]
thin: use 64bit arithmetic for checking meta size

Avoid overflow since extents are just 32bit values.

(in release fix 87aca628)

11 years agocleanup: add explicit cast to proper enum type
Zdenek Kabelac [Tue, 23 Jul 2013 08:46:07 +0000 (10:46 +0200)]
cleanup: add explicit cast to proper enum type

11 years agoman: pvs -o ba_start,ba_size -> pv_ba_start,pv_ba_size
Peter Rajnoha [Tue, 23 Jul 2013 12:44:30 +0000 (14:44 +0200)]
man: pvs -o ba_start,ba_size -> pv_ba_start,pv_ba_size

11 years agodeptree: don't remove live node on resume failure
Alasdair G Kergon [Tue, 23 Jul 2013 12:33:35 +0000 (13:33 +0100)]
deptree: don't remove live node on resume failure

When resuming a node needed by a higher layer of the tree,
if the resume fails, only remove it if the node did not
originally have a live table.

Ref. 97f8454eccefe29464336ba1823448f4d1fa009b

11 years agothin: rename extend_pool to create_pool
Alasdair G Kergon [Tue, 23 Jul 2013 12:33:14 +0000 (13:33 +0100)]
thin: rename extend_pool to create_pool

11 years agocleanup: suppress compiler warning
Alasdair G Kergon [Tue, 23 Jul 2013 12:32:47 +0000 (13:32 +0100)]
cleanup: suppress compiler warning

11 years agoMan Pages: Update man pages to reflect changes to various RAID options
Jonathan Brassow [Mon, 22 Jul 2013 18:02:32 +0000 (13:02 -0500)]
Man Pages:  Update man pages to reflect changes to various RAID options

Some of the names for various RAID options have been changed and the man
pages need to reflect it.
lvcreate:
from: minrecoveryrate to: [raid]minrecoveryrate
from: maxrecoveryrate to: [raid]maxrecoveryrate
* plus better clarity on what the arg to these options is
  specifying

lvchange:
from: minrecoveryrate   to: [raid]minrecoveryrate
from: maxrecoveryrate   to: [raid]maxrecoveryrate
* plus better clarity on what the arg to these options is
  specifying
from: syncaction        to: [raid]syncaction
from: writebehind to  [raid]writebehind
* plus change arg from BehindCount to IO/count
from: writemostly to: [raid]writemostly
* plus addition to document [:{t|n|y}] option
lvs:
from: mismatches to: raid_mismatch_count
from: sync_action to: raid_sync_action
add : raid_min|max_recovery_rate, raid_write_behind

11 years agosnapshot: fix merging
Zdenek Kabelac [Mon, 22 Jul 2013 14:20:36 +0000 (16:20 +0200)]
snapshot: fix merging

When the merging of snapshot is finished, we need to clean dm table
intries for snapshot and -cow device. So for merging snapshot
we have to activate_lv plain 'cow' LV and let the table
resolver to its work - shortly deactivation_lv() request
will follow - in cluster this needs LV lock to be held by clvmd.

Also update a test - add small wait - if lvremove is not 'fast enough'
and merging process has not been stopped and $lv1 removed in background.
Ortherwise the following lvcreate occasionally finds name $lv1 still in use.

(in release fix)

11 years agotests: comment about pvscan --cache return value
Peter Rajnoha [Mon, 22 Jul 2013 13:57:18 +0000 (15:57 +0200)]
tests: comment about pvscan --cache return value

11 years agoTEST: Support testing new RAID features in RHEL6 kernels
Jonathan Brassow [Mon, 22 Jul 2013 13:50:27 +0000 (08:50 -0500)]
TEST: Support testing new RAID features in RHEL6 kernels

We check the version number of dm-raid before testing certain
features to make sure they are present.  However, this has
become somewhat complicated by the fact that the version #'s
in the upstream kernel and the REHL6 kernel have been diverging.
This has been a necessity because the upstream kernel has
undergone ABI changes that have necessitated a bump in the
'Y' component of the version #, while the RHEL6 kernel has not.
Thus, we need to know that the ABI has not changed but the
features have been added.  So, the current version #'ing stands
as follows:

RHEL6   Upstream   Comment
======|==========|========
** Same until version 1.3.1 **
------|----------|--------
 N/A  |   1.4.0  | Non-functional change.
      |          | Removes arg from mapping function.
------|----------|--------
1.3.2 |   1.4.1  | RAID10 fix redundancy validation checks.
------|----------|--------
1.3.5 |   1.4.2  | Add RAID10 "far" and "offset" algorithm support.
      |          | Note this feature came later in RHEL6 as part of
      |          | a separate update/feature.
------|----------|--------
1.3.3 |   1.5.0  | Add message interface to allow manipulation of
      |          | the sync_action.
      |          | New status (STATUSTYPE_INFO) fields: sync_action
      |          | and mismatch_cnt.
------|----------|--------
1.3.4 |   1.5.1  | Add ability to restore transiently failed devices
      |          | on resume.
------|----------|--------
1.3.5 |   1.5.2  | 'mismatch_cnt' is zero unless [last_]sync_action
      |          | is "check".
------|----------|--------

To simplify, writemostly/writebehind, scrubbing, and transient device
failure restoration are all tested based on the same version
requirements: (1.3.5 < V < 1.4.0) || (V > 1.5.2).  Since kernel
support for writemostly/writebehind has been around for some time,
this could mean a reduction in the scope of kernels tested for this
feature.  I don't view this as much of a problem, since support for
this feature was only recently added to LVM.  Thus, the user would
have to be using a very recent LVM version with an older kernel.

11 years agopvscan: Respect lvmetad (global) filter in --cache w/ a device.
Petr Rockai [Mon, 22 Jul 2013 13:03:56 +0000 (15:03 +0200)]
pvscan: Respect lvmetad (global) filter in --cache w/ a device.

11 years agosystemd: lvm2-activation-generator: use LOG_DEBUG/ERR severity for kmsg
Peter Rajnoha [Mon, 22 Jul 2013 12:04:12 +0000 (14:04 +0200)]
systemd: lvm2-activation-generator: use LOG_DEBUG/ERR severity for kmsg

11 years agolvconvert: drop limit on thin pool conversion
Zdenek Kabelac [Sun, 16 Jun 2013 19:05:00 +0000 (21:05 +0200)]
lvconvert: drop limit on thin pool conversion

11 years agopython: make install to prefix dir
Zdenek Kabelac [Fri, 19 Jul 2013 18:48:41 +0000 (20:48 +0200)]
python: make install to prefix dir

Respect $prefix and avoid install to live system.

11 years agodumpconfig: check conf tree was created
Zdenek Kabelac [Fri, 19 Jul 2013 15:32:08 +0000 (17:32 +0200)]
dumpconfig: check conf tree was created

Missing error path.

11 years agoliblvm: check lvmetad cache return values
Zdenek Kabelac [Fri, 19 Jul 2013 15:31:13 +0000 (17:31 +0200)]
liblvm: check lvmetad cache return values

Missing error path.

11 years agocleanup: do not return stack content
Zdenek Kabelac [Fri, 19 Jul 2013 15:29:37 +0000 (17:29 +0200)]
cleanup: do not return stack content

Return initialized struct in error path.

11 years agocoverity: pointer validation
Zdenek Kabelac [Fri, 19 Jul 2013 15:28:43 +0000 (17:28 +0200)]
coverity: pointer validation

Check for metadata_lv and make sure we have got proper thin pool segment.

Check we are working with merging snapshot when adding merging target.

11 years agoliblvm: check extents_from_size
Zdenek Kabelac [Fri, 19 Jul 2013 13:35:04 +0000 (15:35 +0200)]
liblvm: check extents_from_size

Since the function may fail, check for error.
(in release fix)

11 years agocleanup: lvm complient style
Zdenek Kabelac [Fri, 19 Jul 2013 13:33:26 +0000 (15:33 +0200)]
cleanup: lvm complient style

drop unused assignments.

11 years agocleanup: simplier string reset
Zdenek Kabelac [Fri, 19 Jul 2013 13:32:49 +0000 (15:32 +0200)]
cleanup: simplier string reset

11 years agocleanup: remove unused headers
Zdenek Kabelac [Fri, 19 Jul 2013 13:31:26 +0000 (15:31 +0200)]
cleanup: remove unused headers

11 years agometadata: Fix tracking of read_status flags in _vg_make_handle.
Petr Rockai [Mon, 22 Jul 2013 10:04:47 +0000 (12:04 +0200)]
metadata: Fix tracking of read_status flags in _vg_make_handle.

11 years agometadata: Do not ignore errors in _vg_update_vg_ondisk.
Petr Rockai [Mon, 22 Jul 2013 10:00:48 +0000 (12:00 +0200)]
metadata: Do not ignore errors in _vg_update_vg_ondisk.

11 years agoTEST: Add a regression test for the ondisk/orphan bug.
Petr Rockai [Mon, 22 Jul 2013 09:57:23 +0000 (11:57 +0200)]
TEST: Add a regression test for the ondisk/orphan bug.

11 years agometadata: Do not try to maintain an ondisk copy of orphan VGs.
Petr Rockai [Mon, 22 Jul 2013 09:51:35 +0000 (11:51 +0200)]
metadata: Do not try to maintain an ondisk copy of orphan VGs.

11 years agoTEST: Update syncaction test to match latest kernel updates
Jonathan Brassow [Fri, 19 Jul 2013 20:24:34 +0000 (15:24 -0500)]
TEST: Update syncaction test to match latest kernel updates

The mismatch count reported by a dm-raid kernel target used
to be effectively random, unless it was checked after a
"check" scrubbing action had been performed.  Updates to the
kernel now mean that the mismatch count will be 0 unless a
check has been performed and discrepancies had been found.
This has been the intended behaviour all along.

This patch updates the test suite to handle the change.

11 years agocmdline: support ARG_GROUPABLE in merge_synonym
Alasdair G Kergon [Fri, 19 Jul 2013 19:37:43 +0000 (20:37 +0100)]
cmdline: support ARG_GROUPABLE in merge_synonym

11 years agocommandline: add prefix aliases for raid options
Alasdair G Kergon [Fri, 19 Jul 2013 18:24:54 +0000 (19:24 +0100)]
commandline: add prefix aliases for raid options

Accept --raidwritemostly as well as --writemostly etc.

11 years agoRAID: Fix segfault when reporting raid_syncaction field on older kernel
Jonathan Brassow [Fri, 19 Jul 2013 15:01:48 +0000 (10:01 -0500)]
RAID: Fix segfault when reporting raid_syncaction field on older kernel

The status printed for dm-raid targets on older kernels does not include
the syncaction field.  This is handled by dev_manager_raid_status() just
fine by populating the raid status structure with NULL for that field.
However, lv_raid_sync_action() does not properly handle that field being
NULL.  So, check for it and return 0 if it is NULL.

11 years agodev-type: dev_get_primary_dev default error code 0, not -1
Peter Rajnoha [Fri, 19 Jul 2013 13:26:53 +0000 (15:26 +0200)]
dev-type: dev_get_primary_dev default error code 0, not -1

11 years agoreporting: tidy recent new fields
Alasdair G Kergon [Fri, 19 Jul 2013 00:30:02 +0000 (01:30 +0100)]
reporting: tidy recent new fields

Add underscores and prefixes to recently-added fields.
(Might add more alias functionality in future.)

11 years agopython-lvm: Add call to close/re-open C lib.
Tony Asleson [Thu, 18 Jul 2013 20:53:43 +0000 (16:53 -0400)]
python-lvm: Add call to close/re-open C lib.

As the library handle has a dm pool associated with
it for long running processes it is required to close and
re-open the library to free the dm pool.  Call added so
python clients can reclaim memory, lvm.gc().

Note: Any python objects on the heap become invalid at the
time this call is made.  If referenced, a seg. fault could
occur.  No simple way to make this safe with the current
memory management in the C library.  Use with caution!

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agodisplay: fix units for sizes <1k
Alasdair G Kergon [Thu, 18 Jul 2013 16:55:58 +0000 (17:55 +0100)]
display: fix units for sizes <1k

11 years agothin: vgsplit and vgmerge spare support
Zdenek Kabelac [Tue, 9 Jul 2013 10:01:25 +0000 (12:01 +0200)]
thin: vgsplit and vgmerge spare support

When spliting a VG with spare, update to which VG it will belong.

When merging and both VGs have spare, unmark the smaller one first.

11 years agothin: add lvconvert pool metadata spare
Zdenek Kabelac [Tue, 25 Jun 2013 11:35:12 +0000 (13:35 +0200)]
thin: add lvconvert pool metadata spare

Support poolmetadataspare when convering volumes into thin pool.
Same rules applied as with lvcreate.

11 years agothin: add spare lvcreate support
Zdenek Kabelac [Tue, 25 Jun 2013 11:34:31 +0000 (13:34 +0200)]
thin: add spare lvcreate support

Add --poolmetadataspare option and creates and handles
pool metadata spare lv when thin pool is created.
With default setting 'y' it tries to ensure, spare has
at least the size of created LV.

11 years agothin: removal of spare disables recovery
Zdenek Kabelac [Mon, 17 Jun 2013 17:54:15 +0000 (19:54 +0200)]
thin: removal of spare disables recovery

Warn user when removing spare LV.
Remove spare automatically, when last pool from VG is removed.

11 years agothin: report 'e' volume type pool metadata spare
Zdenek Kabelac [Mon, 17 Jun 2013 17:42:52 +0000 (19:42 +0200)]
thin: report 'e' volume type pool metadata spare

Reuse m'e'tadata volume type for spar'e' volume as well.
Essentially they are related and there is no big reason
to introduce new flag.

11 years agothin: add pool metadata spare lv support
Zdenek Kabelac [Fri, 5 Jul 2013 15:10:47 +0000 (17:10 +0200)]
thin: add pool metadata spare lv support

Add support for pool's metadata spare volume.

11 years agothin: improve pool creation activation order
Zdenek Kabelac [Thu, 18 Jul 2013 14:44:39 +0000 (16:44 +0200)]
thin: improve pool creation activation order

Pool creation involves clearing of metadata device
which triggers udev watch rule we cannot udev synchronize with
in current code.

This metadata devices needs to be activated localy,
so in cluster mode deactivation and reactivation
is always needed.

However for non-clustered mode we may reload table
via suspend/resume path which avoids collision with
udev watch rule which was occasionaly triggering
retry deactivation loop.

Code has been also split into 2 separate code paths
for thin pools and thin volumes which improved readability
of the code as well.

Deactivation has been moved out of extend_pool() and
decision is now in _lv_create_an_lv() which knows
the change mode.

11 years agothin: for thin volumes properly list modules
Zdenek Kabelac [Thu, 18 Jul 2013 14:06:26 +0000 (16:06 +0200)]
thin: for thin volumes properly list modules

thin volume needs   thin-pool and  thin kernel modules so print them
both for   lvs -o+modules

11 years agothin: fix error paths for metadata creation
Zdenek Kabelac [Thu, 18 Jul 2013 14:01:38 +0000 (16:01 +0200)]
thin: fix error paths for metadata creation

Since we vg_write&commit metadata LV inside  lv_extend() call,
proper restore is needed in case something fails.

So add bad: section which deactivates activated LV
and removes it from VG.

Also check early for metadata LV name lengh fail.

11 years agothin: fix error path in creation path
Zdenek Kabelac [Wed, 17 Jul 2013 13:26:41 +0000 (15:26 +0200)]
thin: fix error path in creation path

Remove some calls to revert_new_lv when no LV has been created/commited so far.
When the pool update failed - then only revert is needed.

11 years agolv_manip: move some validation code before archiving
Zdenek Kabelac [Wed, 17 Jul 2013 12:52:21 +0000 (14:52 +0200)]
lv_manip: move some validation code before archiving

Make as much test we can, before actualy modifying metadata.
Avoids also unnecessary archiving.

11 years agosnapshot: local activation for clear COW device
Zdenek Kabelac [Thu, 18 Jul 2013 14:20:48 +0000 (16:20 +0200)]
snapshot: local activation for clear COW device

To clear snapshot cow device in cluster enforce local
activation here.

11 years agometadata: add is_change_activating
Zdenek Kabelac [Thu, 18 Jul 2013 14:17:23 +0000 (16:17 +0200)]
metadata: add is_change_activating

Add simple inline function to check, whether the change is activating.
(better then macro since we get type checking).

11 years agocleanup: move detection of change mode before commit point
Zdenek Kabelac [Thu, 18 Jul 2013 14:25:16 +0000 (16:25 +0200)]
cleanup: move detection of change mode before commit point

Following patch will need to know change state before commit point.
Also the test mode should properly report all ongoing operation.

11 years agocleanup: use dm_list_empty
Zdenek Kabelac [Wed, 17 Jul 2013 12:49:21 +0000 (14:49 +0200)]
cleanup: use dm_list_empty

Check for empty list directly.

11 years agocleanup: exit earlier in lv_rename_update
Zdenek Kabelac [Wed, 17 Jul 2013 12:40:22 +0000 (14:40 +0200)]
cleanup: exit earlier in lv_rename_update

List doesn't need to be created when the metadata are not updated.

11 years agocleanup: stack and remove braces
Zdenek Kabelac [Tue, 16 Jul 2013 21:35:56 +0000 (23:35 +0200)]
cleanup: stack and remove braces

Add stack trace for error path.
Remove unneeded braces.

11 years agosystemd: generator: add lvm2-activation-net.service
Peter Rajnoha [Wed, 17 Jul 2013 14:21:18 +0000 (16:21 +0200)]
systemd: generator: add lvm2-activation-net.service

The new lvm2-activation-net.service activates LVM volumes
after network-attached devices are set up (iSCSI and FCoE)
if lvmetad is disabled and hence the autoactivation is not
used.

11 years agoprofile: move profile assignment to common lv_create_empty fn
Peter Rajnoha [Wed, 17 Jul 2013 09:31:54 +0000 (11:31 +0200)]
profile: move profile assignment to common lv_create_empty fn

11 years agoconfig_settings: add comment about possible types
Peter Rajnoha [Tue, 16 Jul 2013 13:18:40 +0000 (15:18 +0200)]
config_settings: add comment about possible types

11 years agotests: one missed automatic name
Zdenek Kabelac [Mon, 15 Jul 2013 14:38:55 +0000 (16:38 +0200)]
tests: one missed automatic name

Avoid depending on auto-names lvol%d.

11 years agotests: thin lvol0 updates
Zdenek Kabelac [Mon, 15 Jul 2013 11:37:07 +0000 (13:37 +0200)]
tests: thin lvol0 updates

11 years agotests: more thin external origin tests
Zdenek Kabelac [Mon, 15 Jul 2013 12:46:52 +0000 (14:46 +0200)]
tests: more thin external origin tests

11 years agothin: improve external origin tree creation
Zdenek Kabelac [Tue, 9 Jul 2013 10:34:49 +0000 (12:34 +0200)]
thin: improve external origin tree creation

When tree for thin LVs was using external_lv, there has been
far less optimal solution, that has tried to add certain
existing dependencie only when new node was added.
However this has lead to way to complex tree construction since
many repeated checks have been made during such tree build.

This patch move this detection to the proper _partial_tree generation
code and uses for it new  'activation' flag, which is set when
tree for ACTIVATION or PRELOAD is generated.

It increases performance when thins with external origins are used.

(in release update)

11 years agodev_manager: lower memory usage
Zdenek Kabelac [Sun, 14 Jul 2013 13:08:26 +0000 (15:08 +0200)]
dev_manager: lower memory usage

Created dlid for test is not needed afterward, so lower a memory
usage of this call is repeatedly used for building some large tree.

TODO: create function to use given buffer on stack as much cheaper.

11 years agothin: add sub volumes as whole volumes
Zdenek Kabelac [Mon, 15 Jul 2013 11:39:53 +0000 (13:39 +0200)]
thin: add sub volumes as whole volumes

Do not use origin_only when add log_lv and metadata as a subvolume.
The stacked volume needs to access whole volume in this case.

11 years agothin: lvcreate man examples
Zdenek Kabelac [Mon, 15 Jul 2013 09:52:05 +0000 (11:52 +0200)]
thin: lvcreate man examples

Add more examples to man page about thin volume snapshot creation
and try to make the text more explicit about size specification.

11 years agothin: check and use layered origin lv
Zdenek Kabelac [Mon, 15 Jul 2013 09:47:10 +0000 (11:47 +0200)]
thin: check and use layered origin lv

Code needs to check if the layer origin device is suspended,
It's valid to create  thinvolume snapshot of thinvolume which is also
used as an old-style snapshot. In this case we need to check -real
is suspended.

When adding origin_only - add only layer thin volume.
(in case it's also old-snapshot add only -real device)

11 years agothin: write back when command successfully finished
Zdenek Kabelac [Mon, 15 Jul 2013 09:39:03 +0000 (11:39 +0200)]
thin: write back when command successfully finished

Remove backup() call from update_pool_lv() as it's been there
duplicated and preperly order backup() call after lvresize,
so there is just one such call.

11 years agothin: send messages to active pool
Zdenek Kabelac [Mon, 15 Jul 2013 09:27:57 +0000 (11:27 +0200)]
thin: send messages to active pool

If the thin pool is known to be active, messages can be passed
to the pool even when the created thin volume is not going to be
activated.

So we do not need to stack large list of message and validate
and catch creation errors earlier in this case.

Replace the test for valid activation combination with simpler list of
deactivation combinations.

11 years agolibdm: thin pool target sends messages once
Zdenek Kabelac [Mon, 15 Jul 2013 09:53:30 +0000 (11:53 +0200)]
libdm: thin pool target sends messages once

Clear send_messages flag when they have been delivered successfully.
There is no need to validate it for all other activations of the same
node in the dm_tree.

Also add extra debug message which shows the reason for skipping
sending of messages because the transaction_id has already the matching
value.

11 years agolibdm: remove unneeded read_ahead settings
Zdenek Kabelac [Mon, 15 Jul 2013 09:41:07 +0000 (11:41 +0200)]
libdm: remove unneeded read_ahead settings

Skip settings are read_ahead value which is already set in kernel.

11 years agocleanup: update commented-out code part
Zdenek Kabelac [Mon, 15 Jul 2013 11:05:15 +0000 (13:05 +0200)]
cleanup: update commented-out code part

Just make it in-sync with latest proposal.

11 years agocleanup: update comments
Zdenek Kabelac [Sat, 6 Jul 2013 09:04:19 +0000 (11:04 +0200)]
cleanup: update comments

Add and indent.

11 years agofix: apply profile and then get the config path + auto_set_activation not profilable
Peter Rajnoha [Mon, 15 Jul 2013 11:33:14 +0000 (13:33 +0200)]
fix: apply profile and then get the config path + auto_set_activation not profilable

cfg_def_get_path uses a global static var to store the result (for efficiency).
So we need to apply the profile first and then get the path for the config item
when calling find_config_tree_* fns.

Also activation/auto_set_activation is not profilable (at least not now,
maybe later if we need that).

11 years agoapi test: remove unused variable
Peter Rajnoha [Mon, 15 Jul 2013 07:26:31 +0000 (09:26 +0200)]
api test: remove unused variable

11 years agolvm2api: Add missing files from prev commit.
Tony Asleson [Fri, 12 Jul 2013 22:42:48 +0000 (18:42 -0400)]
lvm2api: Add missing files from prev commit.

Missing files for commit 0a048d5274612049467a3defd13de7aca2419137

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agolvm-percent.c: Add #include "lib.h"
Tony Asleson [Fri, 12 Jul 2013 21:47:16 +0000 (17:47 -0400)]
lvm-percent.c: Add #include "lib.h"

This standard include for library files was missing,
adding it.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agolvm2app: Add thin and thin pool lv creation
Tony Asleson [Fri, 12 Jul 2013 20:40:10 +0000 (16:40 -0400)]
lvm2app: Add thin and thin pool lv creation

Add thin and thin pool lv creation support to lvm library

This is Mohan's thinp patch, re-worked to include suggestions
from Zdenek and Mohan.

Rework of commit 4d5de8322b3a6050def60542b167b46d97b2824d
which uses refactored properties handling.

Based on work done by M. Mohan Kumar <mohan@in.ibm.com>

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agolib/properties: Common code for handling properties.
Tony Asleson [Fri, 12 Jul 2013 17:09:44 +0000 (13:09 -0400)]
lib/properties: Common code for handling properties.

The common bits from lib/report/properties.[c|h] have
been moved to lib/properties/prop_common.[c|h] to allow
re-use of property handling functionality without
polluting the report handling functionality.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
11 years agoman: lvs lv_attr 's(k)ip activation'
Peter Rajnoha [Fri, 12 Jul 2013 20:24:26 +0000 (22:24 +0200)]
man: lvs lv_attr 's(k)ip activation'

11 years agoWHATS_NEW: support for LV activation skip flag
Peter Rajnoha [Fri, 12 Jul 2013 17:52:32 +0000 (19:52 +0200)]
WHATS_NEW: support for LV activation skip flag

11 years agotests: use lvcreate -s -K for thin snapshots
Peter Rajnoha [Fri, 12 Jul 2013 11:54:53 +0000 (13:54 +0200)]
tests: use lvcreate -s -K for thin snapshots

Thin snapshots are not activated now by default so this needs
to be explicitly overridden with -K now.

11 years agotests: fix tests to cope with latest changes
Peter Rajnoha [Fri, 12 Jul 2013 11:07:40 +0000 (13:07 +0200)]
tests: fix tests to cope with latest changes

- lvs -o lv_attr has now 10 indicator bits
- use '--ignoremonitoring' instead of the shortcut '--ig' used before (since
it would be ambiguous with new '--ignoreactivationskip')

11 years agoconf: add activation/auto_set_activation_skip
Peter Rajnoha [Fri, 12 Jul 2013 07:27:17 +0000 (09:27 +0200)]
conf: add activation/auto_set_activation_skip

The activation/auto_set_activation_skip enables/disables automatic
adding of the ACTIVATION_SKIP LV flag. By default thin snapshots
are flagged to be skipped during activation.

And by default, the auto_set_activation_skip is enabled.

11 years agolvs: add 's(k)ip activatoin' lv_attr field
Peter Rajnoha [Thu, 11 Jul 2013 12:05:05 +0000 (14:05 +0200)]
lvs: add 's(k)ip activatoin' lv_attr field

A new 10-th bit in lvs lv_attr field to indicate whether an LV
has the ACTIVATION_SKIP flag attached (stored in metadata).

11 years agotools: add --setactivationskip and --ignoreactivationskip to vgchange/lvchange
Peter Rajnoha [Thu, 11 Jul 2013 10:44:36 +0000 (12:44 +0200)]
tools: add --setactivationskip and --ignoreactivationskip to vgchange/lvchange

The lvchange has both -k/--setactivationskip and
-K/--ignoreactivationskip option available for use.

The vgchange has only -K/--ignoreactivationskip, but
not the -k/--setactivationskip as the ACTIVATION_SKIP
flag is an LV property, not a VG one and so we change it
only by using the lvchange...

11 years agoactivation: add support for skipping activation of selected LVs
Peter Rajnoha [Wed, 10 Jul 2013 12:06:50 +0000 (14:06 +0200)]
activation: add support for skipping activation of selected LVs

Also add -k/--setactivationskip y/n and -K/--ignoreactivationskip
options to lvcreate.

The --setactivationskip y sets the flag in metadata for an LV to
skip the LV during activation. Also, the newly created LV is not
activated.

Thin snapsots have this flag set automatically if not specified
directly by the --setactivationskip y/n option.

The --ignoreactivationskip overrides the activation skip flag set
in metadata for an LV (just for the run of the command - the flag
is not changed in metadata!)

A few examples for the lvcreate with the new options:

  (non-thin snap LV => skip flag not set in MDA + LV activated)
  raw/~ $ lvcreate -l1 vg
    Logical volume "lvol0" created
  raw/~ $ lvs -o lv_name,attr vg/lvol0
    LV    Attr
    lvol0 -wi-a----

  (non-thin snap LV + -ky => skip flag set in MDA + LV not activated)
  raw/~ $ lvcreate -l1 -ky vg
    Logical volume "lvol1" created
  raw/~ $ lvs -o lv_name,attr vg/lvol1
    LV    Attr
    lvol1 -wi------

  (non-thin snap LV + -ky + -K => skip flag set in MDA + LV activated)
  raw/~ $ lvcreate -l1 -ky -K vg
    Logical volume "lvol2" created
  raw/~ $ lvs -o lv_name,attr vg/lvol2
    LV    Attr
    lvol2 -wi-a----

  (thin snap LV => skip flag set in MDA (default behaviour) + LV not activated)
  raw/~ $ lvcreate -L100M -T vg/pool -V 1T -n thin_lv
    Logical volume "thin_lv" created
  raw/~ $ lvcreate -s vg/thin_lv -n thin_snap
    Logical volume "thin_snap" created
  raw/~ $ lvs -o name,attr vg
    LV        Attr
    pool      twi-a-tz-
    thin_lv   Vwi-a-tz-
    thin_snap Vwi---tz-

  (thin snap LV + -K => skip flag set in MDA (default behaviour) + LV activated)
  raw/~ $ lvcreate -s vg/thin_lv -n thin_snap -K
    Logical volume "thin_snap" created
  raw/~ $ lvs -o name,attr vg/thin_lv
    LV      Attr
    thin_lv Vwi-a-tz-

  (thins snap LV + -kn => no skip flag in MDA (default behaviour overridden) + LV activated)
  [0] raw/~ # lvcreate -s vg/thin_lv -n thin_snap -kn
    Logical volume "thin_snap" created
  [0] raw/~ # lvs -o name,attr vg/thin_snap
    LV        Attr
    thin_snap Vwi-a-tz-

11 years agolvchange: backup VG after changing profile
Peter Rajnoha [Thu, 11 Jul 2013 10:25:10 +0000 (12:25 +0200)]
lvchange: backup VG after changing profile

11 years agolvm2api: Make the vg_list_* functions work with lvmetad (+ test).
Petr Rockai [Thu, 11 Jul 2013 06:01:04 +0000 (08:01 +0200)]
lvm2api: Make the vg_list_* functions work with lvmetad (+ test).

11 years agoconfig: fix unterminated strings in arrays
Peter Rajnoha [Tue, 9 Jul 2013 11:41:44 +0000 (13:41 +0200)]
config: fix unterminated strings in arrays

...when creating config trees while calling config_def_create_tree fn
that constructs a tree out of config_settings.h definition
(CFG_DEF_TREE_NEW/MISSING/DEFAULT/PROFILABLE).

11 years agometadata: cleanup comments and formatting
Alasdair G Kergon [Tue, 9 Jul 2013 11:34:48 +0000 (12:34 +0100)]
metadata: cleanup comments and formatting

11 years agodumpconfig: honour --atversion with --type profilable
Peter Rajnoha [Tue, 9 Jul 2013 08:23:46 +0000 (10:23 +0200)]
dumpconfig: honour --atversion with --type profilable

  raw/~ $ lvm dumpconfig --type profilable
  allocation {
  thin_pool_zero=1
  thin_pool_discards="passdown"
  thin_pool_chunk_size=64
  }
  activation {
  thin_pool_autoextend_threshold=100
  thin_pool_autoextend_percent=20
  }

  raw/~ $ lvm dumpconfig --type profilable --atversion 2.2.90
  activation {
  thin_pool_autoextend_threshold=100
  thin_pool_autoextend_percent=20
  }

11 years agodumpconfig: add --type profilable
Peter Rajnoha [Tue, 9 Jul 2013 07:57:46 +0000 (09:57 +0200)]
dumpconfig: add --type profilable

The --type profilable shows all config settings that
are customizable by profiles:

  raw/~ $ lvm dumpconfig --type profilable
  allocation {
  thin_pool_zero=1
  thin_pool_discards="passdown"
  thin_pool_chunk_size=64
  }
  activation {
  thin_pool_autoextend_threshold=100
  thin_pool_autoextend_percent=20
  }

11 years agotools: remove metadata-exported.h
Alasdair G Kergon [Tue, 9 Jul 2013 02:07:55 +0000 (03:07 +0100)]
tools: remove metadata-exported.h

metadata-exported.h is included by tools.h

11 years agotools: remove metadata.h
Alasdair G Kergon [Tue, 9 Jul 2013 01:51:24 +0000 (02:51 +0100)]
tools: remove metadata.h

11 years agotools: remove metadata.h from pvresize/vgck
Alasdair G Kergon [Tue, 9 Jul 2013 01:41:56 +0000 (02:41 +0100)]
tools: remove metadata.h from pvresize/vgck

11 years agopvcreate: remove metadata.h header
Alasdair G Kergon [Tue, 9 Jul 2013 01:37:56 +0000 (02:37 +0100)]
pvcreate: remove metadata.h header

Files in tools/ should only use metadata-exported.h not metadata.h.
Rename pvcreate_locked to pvcreate_single.

11 years agoreport: remove LV_CREATE_PARAMS report type
Alasdair G Kergon [Tue, 9 Jul 2013 01:06:29 +0000 (02:06 +0100)]
report: remove LV_CREATE_PARAMS report type

Remove LV_CREATE_PARAMS from lib/report as it is not a type of metadata.
Added by 4d5de8322b3a6050def60542b167b46d97b2824d

11 years agodumpconfig: add --mergedconfig option
Peter Rajnoha [Mon, 8 Jul 2013 13:34:27 +0000 (15:34 +0200)]
dumpconfig: add --mergedconfig option

Normally, the lvm dumpconfig processes only the configuration tree
that is at the top of the cascade. Considering the cascade is:

  CONFIG_STRING -> CONFIG_PROFILE -> CONFIG_MERGED_FILES/CONFIG_FILE

...then:

  (dumpconfig of lvm.conf only)
  raw/~ $ lvm dumpconfig allocation
  allocation {
  maximise_cling=1
  mirror_logs_require_separate_pvs=0
  thin_pool_metadata_require_separate_pvs=0
  thin_pool_chunk_size=64
  }

  (dumpconfig of selected profile configuration only)
  raw/~ $ lvm dumpconfig --profile test allocation
  allocation {
  thin_pool_chunk_size=8
  thin_pool_discards="passdown"
  thin_pool_zero=1
  }

  (dumpconfig of given --config configuration only)
  raw/~ $ lvm dumpconfig --config 'allocation{thin_pool_chunk_size=16}' allocation
  allocation {
  thin_pool_chunk_size=16
  }

The --mergedconfig option causes the configuration cascade to be
merged before processing it with dumpconfig:

  (dumpconfig of merged selected profile and lvm.conf)
  raw/~ $ lvm dumpconfig --profile test allocation --mergedconfig
  allocation {
  maximise_cling=1
  thin_pool_zero=1
  thin_pool_discards="passdown"
  mirror_logs_require_separate_pvs=0
  thin_pool_metadata_require_separate_pvs=0
  thin_pool_chunk_size=8
  }

  (dumpconfig merged given --config and selected profile and lvm.conf)
  raw/~ $ lvm dumpconfig --profile test --config 'allocation{thin_pool_chunk_size=16}' allocation --mergedconfig
  allocation {
  maximise_cling=1
  thin_pool_zero=1
  thin_pool_discards="passdown"
  mirror_logs_require_separate_pvs=0
  thin_pool_metadata_require_separate_pvs=0
  thin_pool_chunk_size=16
  }

Hence with the --mergedconfig, we are able to see the
configuration that is actually used when processing any
LVM command while using any combination of --config/--profile
options together with lvm.conf file.

11 years agoconfig: make it possible to do a raw config tree merge
Peter Rajnoha [Mon, 8 Jul 2013 12:31:44 +0000 (14:31 +0200)]
config: make it possible to do a raw config tree merge

Till now, we needed the config tree merge only for merging
tag configs with lvm.conf. However, this type of merging
did a few extra exceptions:

  - leaving out the tags section
  - merging values in activation/volume_list
  - merging values in devices/filter
  - merging values in devices/types

Any other config values were replaced by new values.
However, we'd like to do a 'raw merge' as well, simply
bypassing the exceptions listed above. This will help
us to create a single tree representing the cascaded
configs like CONFIG_STRING -> CONFIG_PROFILE -> ...

The reason for this patch is that when trees are cascaded,
the first value found while traversing the cascade is used,
not making any exceptions like we do for tag configs.

11 years agoconfig: fix use of last config check status if creating CFG_DEF_TREE_MISSING tree
Peter Rajnoha [Mon, 8 Jul 2013 12:13:09 +0000 (14:13 +0200)]
config: fix use of last config check status if creating CFG_DEF_TREE_MISSING tree

When CFG_DEF_TREE_MISSING is created, it needs to know the status
of the check done on the tree used (the CFG_USED flag).

This bug was introduced with f1c292cc38f4ba2e8d9b7272bc1a1ce17bd729a5
"make it possible to run several instances of configuration check at
once". This patch separated the CFG_USED and CFG_VALID flags in
a separate 'status' field in struct cft_check_handle.

However, when creating some trees, like CFG_DEF_TREE_MISSING,
we need this status to do a comparison with full config definition
to determine which items are missing and for which default values
were used. Otherwise, all items would be considered missing.

So, pass this status in a new field called 'check_status' in
struct config_def_tree_spec that defines how the (dumpconfig) tree
should be constructed (and this struct is passed to
config_def_create_tree fn then).

11 years agocleanup: cleanup dumpconfig code
Peter Rajnoha [Mon, 8 Jul 2013 11:45:37 +0000 (13:45 +0200)]
cleanup: cleanup dumpconfig code

11 years agolocking: unlock memory on error path
Zdenek Kabelac [Sat, 6 Jul 2013 08:58:56 +0000 (10:58 +0200)]
locking: unlock memory on error path

Unlock memory and unblock signals on error path.

11 years agopvremove: stack trace
Zdenek Kabelac [Sat, 6 Jul 2013 12:15:42 +0000 (14:15 +0200)]
pvremove: stack trace

Stack trace error.
Remove unused var.

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