]> sourceware.org Git - lvm2.git/log
lvm2.git
10 years agocleanup: move test for free arg
Zdenek Kabelac [Wed, 13 Aug 2014 12:19:13 +0000 (14:19 +0200)]
cleanup: move test for free arg

Move test for list of volumes into common place.

10 years agocleanup: postpone confirmation prompt for snapshot
Zdenek Kabelac [Fri, 15 Aug 2014 11:31:53 +0000 (13:31 +0200)]
cleanup: postpone confirmation prompt for snapshot

Prompt user for confimation after more checks are done.
(So we avoid case prompting and failing after prompt)

10 years agoman: add some more reserved names
Zdenek Kabelac [Thu, 14 Aug 2014 09:10:36 +0000 (11:10 +0200)]
man: add some more reserved names

10 years agoman: show lv name for lvs
Zdenek Kabelac [Thu, 14 Aug 2014 09:09:30 +0000 (11:09 +0200)]
man: show lv name for lvs

Make it more obvious that either just vg name or lv name or path could
be passed as an argument.

10 years agotoollib: print ignoring vorigin
Zdenek Kabelac [Fri, 15 Aug 2014 11:53:04 +0000 (13:53 +0200)]
toollib: print ignoring vorigin

When ignoring 'listed' volume, print info message.
(So the final command error message is a bit less confusing,
i.e. when user tries to deactive virtual origin:

> lvchange -an vg/lvol2_vorigin
  Ignoring virtual origin logical volume vg/lvol2_vorigin.
  One or more specified logical volume(s) not found.

10 years agolvconvert: show name of activated volume
Zdenek Kabelac [Thu, 14 Aug 2014 09:12:02 +0000 (11:12 +0200)]
lvconvert: show name of activated volume

Display the name of volume that needs to be activated for merging.

10 years agoAdd lv_layout_and_type fn, lv_layout and lv_type reporting fields.
Peter Rajnoha [Wed, 13 Aug 2014 08:03:45 +0000 (10:03 +0200)]
Add lv_layout_and_type fn, lv_layout and lv_type reporting fields.

The lv_layout and lv_type fields together help with LV identification.
We can do basic identification using the lv_attr field which provides
 very condensed view. In contrast to that, the new lv_layout and lv_type
fields provide more detialed information on exact layout and type used
for LVs.

For top-level LVs which are pure types not combined with any
other LV types, the lv_layout value is equal to lv_type value.

For non-top-level LVs which may be combined with other types,
the lv_layout describes the underlying layout used, while the
lv_type describes the use/type/usage of the LV.

These two new fields are both string lists so selection (-S/--select)
criteria can be defined using the list operators easily:
  [] for strict matching
  {} for subset matching.

For example, let's consider this:

$ lvs -a -o name,vg_name,lv_attr,layout,type
  LV                    VG     Attr       Layout       Type
  [lvol1_pmspare]       vg     ewi------- linear       metadata,pool,spare
  pool                  vg     twi-a-tz-- pool,thin    pool,thin
  [pool_tdata]          vg     rwi-aor--- level10,raid data,pool,thin
  [pool_tdata_rimage_0] vg     iwi-aor--- linear       image,raid
  [pool_tdata_rimage_1] vg     iwi-aor--- linear       image,raid
  [pool_tdata_rimage_2] vg     iwi-aor--- linear       image,raid
  [pool_tdata_rimage_3] vg     iwi-aor--- linear       image,raid
  [pool_tdata_rmeta_0]  vg     ewi-aor--- linear       metadata,raid
  [pool_tdata_rmeta_1]  vg     ewi-aor--- linear       metadata,raid
  [pool_tdata_rmeta_2]  vg     ewi-aor--- linear       metadata,raid
  [pool_tdata_rmeta_3]  vg     ewi-aor--- linear       metadata,raid
  [pool_tmeta]          vg     ewi-aor--- level1,raid  metadata,pool,thin
  [pool_tmeta_rimage_0] vg     iwi-aor--- linear       image,raid
  [pool_tmeta_rimage_1] vg     iwi-aor--- linear       image,raid
  [pool_tmeta_rmeta_0]  vg     ewi-aor--- linear       metadata,raid
  [pool_tmeta_rmeta_1]  vg     ewi-aor--- linear       metadata,raid
  thin_snap1            vg     Vwi---tz-k thin         snapshot,thin
  thin_snap2            vg     Vwi---tz-k thin         snapshot,thin
  thin_vol1             vg     Vwi-a-tz-- thin         thin
  thin_vol2             vg     Vwi-a-tz-- thin         multiple,origin,thin

Which is a situation with thin pool, thin volumes and thin snapshots.
We can see internal 'pool_tdata' volume that makes up thin pool has
actually a level10 raid layout and the internal 'pool_tmeta' has
level1 raid layout. Also, we can see that 'thin_snap1' and 'thin_snap2'
are both thin snapshots while 'thin_vol1' is thin origin (having
multiple snapshots).

Such reporting scheme provides much better base for selection criteria
in addition to providing more detailed information, for example:

$ lvs -a -o name,vg_name,lv_attr,layout,type -S 'type=metadata'
LV                   VG   Attr       Layout      Type
[lvol1_pmspare]      vg   ewi------- linear      metadata,pool,spare
[pool_tdata_rmeta_0] vg   ewi-aor--- linear      metadata,raid
[pool_tdata_rmeta_1] vg   ewi-aor--- linear      metadata,raid
[pool_tdata_rmeta_2] vg   ewi-aor--- linear      metadata,raid
[pool_tdata_rmeta_3] vg   ewi-aor--- linear      metadata,raid
[pool_tmeta]         vg   ewi-aor--- level1,raid metadata,pool,thin
[pool_tmeta_rmeta_0] vg   ewi-aor--- linear      metadata,raid
[pool_tmeta_rmeta_1] vg   ewi-aor--- linear      metadata,raid

(selected all LVs which are related to metadata of any type)

lvs -a -o name,vg_name,lv_attr,layout,type -S 'type={metadata,thin}'
LV           VG   Attr       Layout      Type
[pool_tmeta] vg   ewi-aor--- level1,raid metadata,pool,thin

(selected all LVs which hold metadata related to thin)

lvs -a -o name,vg_name,lv_attr,layout,type -S 'type={thin,snapshot}'
LV         VG   Attr       Layout     Type
thin_snap1 vg   Vwi---tz-k thin       snapshot,thin
thin_snap2 vg   Vwi---tz-k thin       snapshot,thin

(selected all LVs which are thin snapshots)

lvs -a -o name,vg_name,lv_attr,layout,type -S 'layout=raid'
LV           VG   Attr       Layout       Type
[pool_tdata] vg   rwi-aor--- level10,raid data,pool,thin
[pool_tmeta] vg   ewi-aor--- level1,raid  metadata,pool,thin

(selected all LVs with raid layout, any raid layout)

lvs -a -o name,vg_name,lv_attr,layout,type -S 'layout={raid,level1}'
  LV           VG   Attr       Layout      Type
  [pool_tmeta] vg   ewi-aor--- level1,raid metadata,pool,thin

(selected all LVs with raid level1 layout exactly)

And so on...

10 years agolibdm: Add DM_DEFERRED_REMOVE to dm-ioctl.h.
Alasdair G Kergon [Fri, 15 Aug 2014 12:45:55 +0000 (13:45 +0100)]
libdm: Add DM_DEFERRED_REMOVE to dm-ioctl.h.

10 years agoWHATS_NEW: previous commit
Peter Rajnoha [Fri, 15 Aug 2014 11:31:11 +0000 (13:31 +0200)]
WHATS_NEW: previous commit

10 years agoreport: lvs: properly display 'o' for volume type bit and 'C' for target type bit...
Peter Rajnoha [Fri, 15 Aug 2014 11:21:29 +0000 (13:21 +0200)]
report: lvs: properly display 'o' for volume type bit and 'C' for target type bit in lv_attr field for cache origin LVs

Before this patch:
LV                 VG     Attr
[cache_orig_corig] vg     -wi-ao----

With this patch applied:
LV                 VG     Attr
[cache_orig_corig] vg     owi-aoC---

10 years agocache+thin: add lv_is_{cache,thin}_origin fn to identify origin LVs
Peter Rajnoha [Fri, 15 Aug 2014 11:08:30 +0000 (13:08 +0200)]
cache+thin: add lv_is_{cache,thin}_origin fn to identify origin LVs

10 years agorefactor: add defines for raid segtypes
Peter Rajnoha [Fri, 15 Aug 2014 11:03:21 +0000 (13:03 +0200)]
refactor: add defines for raid segtypes

This will be reused later on in upcoming code...

10 years agopvcreate: Fix cache state with filters/sig wiping.
Alasdair G Kergon [Thu, 14 Aug 2014 00:30:01 +0000 (01:30 +0100)]
pvcreate: Fix cache state with filters/sig wiping.

_pvcreate_check() has two missing requirements:
  After refreshing filters there must be a rescan.
    (Otherwise the persistent filter may remain empty.)
  After wiping a signature, the filters must be refreshed.
    (A device that was previously excluded by the filter due to
     its signature might now need to be included.)

If several devices are added at once, the repeated scanning isn't
strictly needed, but we can address that later as part of the command
processing restructuring (by grouping the devices).

Replace the new pvcreate code added by commit
54685c20fc9dfb155a2e5bc9d8cf5f0aad944305 "filters: fix regression caused
by commit e80884cd080cad7e10be4588e3493b9000649426"
with this change to _pvcreate_check().

The filter refresh problem dates back to commit
acb4b5e4de3c49d36fe756f6fb9997ec179b89c2 "Fix pvcreate device check."

10 years agotests: update report-select test for latest changes
Peter Rajnoha [Wed, 13 Aug 2014 15:19:58 +0000 (17:19 +0200)]
tests: update report-select test for latest changes

10 years agoselect: add support for selection to match string list subset, recognize { } operator
Peter Rajnoha [Wed, 13 Aug 2014 13:39:03 +0000 (15:39 +0200)]
select: add support for selection to match string list subset, recognize { } operator

Using "[ ]" operator together with "&&" (or ",") inside causes the
string list to be matched if and only if all the items given match
the value reported and the number of items also match. This is
strict list matching and the original behaviour we already have.

In contrast to that, the new "{ }" operator together with "&&" inside
causes the string list to be matched if and only if all the items given
match the value reported but the number of items don't need to match.
So we can provide a subset in selection criteria and if the subset
is found, it matches.

For example:

$ lvs -o name,tags
  LV    LV Tags
  lvol0 a
  lvol1 a,b
  lvol2 b,c,x
  lvol3 a,b,y

$ lvs -o name,tags -S 'tags=[a,b]'
  LV    LV Tags
  lvol1 a,b

$ lvs -o name,tags -S 'tags={a,b}'
  LV    LV Tags
  lvol1 a,b
  lvol3 a,b,y

So in the example above the a,b is subset of a,b,y and therefore
it also matches.

Clearly, when using "||" (or "#") inside, the { } and [ ] is the
same:

$ lvs -o name,tags -S 'tags=[a#b]'
  LV    LV Tags
  lvol0 a
  lvol1 a,b
  lvol2 b,c,x
  lvol3 a,b,y

$ lvs -o name,tags -S 'tags={a#b}'
  LV    LV Tags
  lvol0 a
  lvol1 a,b
  lvol2 b,c,x
  lvol3 a,b,y

Also in addition to the above feature, fix list with single value
matching when using [ ]:

Before this patch:
$ lvs -o name,tags -S 'tags=[a]'
  LV    LV Tags
  lvol0 a
  lvol1 a,b
  lvol3 a,b,y

With this patch applied:
$ lvs -o name,tags -S 'tags=[a]'
  LV    LV Tags
  lvol0 a

In case neither [] or {} is used, assume {} (the behaviour is not
changed here):

$ lvs -o name,tags -S 'tags=a'
  LV    LV Tags
  lvol0 a
  lvol1 a,b
  lvol3 a,b,y

So in new terms 'tags=a' is equal to 'tags={a}'.

10 years agoselect: fix string list selection to match whole words only but not prefixes of searc...
Peter Rajnoha [Wed, 13 Aug 2014 13:27:00 +0000 (15:27 +0200)]
select: fix string list selection to match whole words only but not prefixes of searched string

$ lvs -o name,tags vg/lvol0
  LV    LV Tags
  lvol0 a

Before this patch:

$ lvs -o name,tags vg/lvol0 -S 'tags=[a]'
  LV    LV Tags
  lvol0 a

$ lvs -o name,tags vg/lvol0 -S 'tags=[ab]'
  LV    LV Tags
  lvol0 a
(incorrect!)

$ lvs -o name,tags vg/lvol0 -S 'tags=[abc]'
  LV    LV Tags
  lvol0 a
(incorrect!)

With this patch applied:

$ lvs -o name,tags vg/lvol0 -S 'tags=[a]'
  LV    LV Tags
  lvol0 a

$ lvs -o name,tags vg/lvol0 -S 'tags=[ab]'
(no result - correct!)

$ lvs -o name,tags vg/lvol0 -S 'tags=[abc]'
(no result - correct!)

10 years agofilter-mpath: fix primary device lookup failure for partition when processing mpath...
Peter Rajnoha [Fri, 8 Aug 2014 08:49:19 +0000 (10:49 +0200)]
filter-mpath: fix primary device lookup failure for partition when processing mpath filter

If using persistent filter and we're refreshing filters (just like we
do for pvcreate now after commit 54685c20fc9dfb155a2e5bc9d8cf5f0aad944305),
we can't rely on getting the primary device of the partition from the cache
as such device could be already filtered by persistent filter and we get
a device cache lookup failure for such device.

For example:

$ lvm dumpconfig --type diff
devices {
obtain_device_list_from_udev=0
}

$lsblk /dev/sda
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  128M  0 disk
`-sda1   8:1    0  127M  0 part

$cat /etc/lvm/cache/.cache | grep sda
"/dev/sda1",

$pvcreate /dev/sda1
  dev_is_mpath: failed to get device for 8:1
  Physical volume "/dev/sda1" successfully created

The problematic part of the code called dev_cache_get_by_devt
to get the device for the device number supplied. Then the code
used dev_name(dev) to get the name which is then used in check
whether there's any mpath on top of this dev...

This patch uses sysfs to get the base name for the partition
instead, hence avoiding the device cache which is a correct
approach here.

10 years agoactivation: if LV inactive and non-clustered, do not issue "Cannot deactivate" on...
Peter Rajnoha [Thu, 7 Aug 2014 14:44:09 +0000 (16:44 +0200)]
activation: if LV inactive and non-clustered, do not issue "Cannot deactivate" on -aln

The message "Cannot deactivate remotely exclusive device locally." makes
sense only for clustered LV. If the LV is non-clustered, then it's
always exclusive by definition and if it's already deactivated, this
message pops up inappropriately as those two conditions are met.

So issue the message only if the conditions are met AND we have clustered VG.

10 years agopvmove: remove spurious "Skipping mirror LV" message on pvmove of clustered mirror
Peter Rajnoha [Thu, 7 Aug 2014 13:23:58 +0000 (15:23 +0200)]
pvmove: remove spurious "Skipping mirror LV" message on pvmove of clustered mirror

With cmirrord, we can do pvmove of clustered mirror. The code checking
suitability of LVs on the PV being moved issued a message if a mirror
LV was found and the VG was clustered. However, the actual pvmove did
work correctly.

The top-level mirror LV is actually skipped in the code since it's
always layered on top of internal LVs making up the mirror LV and for pvmove
we consider these internal devices only as they're actually layered on
top of concrete PVs then. But we don't need to issue any message here
about skipping the top-level mirror LV - it's misleading here.

10 years agopost-release
Alasdair G Kergon [Tue, 5 Aug 2014 01:12:20 +0000 (02:12 +0100)]
post-release

10 years agopre-release v2_02_109
Alasdair G Kergon [Tue, 5 Aug 2014 01:07:35 +0000 (02:07 +0100)]
pre-release

10 years agoreport: Remove lv_volume_type field.
Alasdair G Kergon [Tue, 5 Aug 2014 01:04:16 +0000 (02:04 +0100)]
report: Remove lv_volume_type field.

Like lv_target_type, this field needs reworking.

10 years agolvscan: Fix possible gcc warnings in --cache implementation.
Petr Rockai [Mon, 4 Aug 2014 15:36:12 +0000 (17:36 +0200)]
lvscan: Fix possible gcc warnings in --cache implementation.

10 years agoWHATS_NEW: lvscan --cache SEGV fix
Petr Rockai [Mon, 4 Aug 2014 15:05:08 +0000 (17:05 +0200)]
WHATS_NEW: lvscan --cache SEGV fix

10 years agolvscan: Make --cache impervious to already-missing devices.
Petr Rockai [Mon, 4 Aug 2014 15:02:26 +0000 (17:02 +0200)]
lvscan: Make --cache impervious to already-missing devices.

10 years agotest: Add a test for lvscan --cache.
Petr Rockai [Mon, 4 Aug 2014 15:00:34 +0000 (17:00 +0200)]
test: Add a test for lvscan --cache.

10 years agofilters: fix regression caused by commit e80884cd080cad7e10be4588e3493b9000649426
Peter Rajnoha [Fri, 1 Aug 2014 09:28:18 +0000 (11:28 +0200)]
filters: fix regression caused by commit e80884cd080cad7e10be4588e3493b9000649426

Commit e80884cd080cad7e10be4588e3493b9000649426 tried to dump filters
for them to be reevaluated when creating a PV to avoid overwriting
any existing signature that may have been created after last
scan/filtering.

However, we need to call refresh_filters instead of
persistent_filter->dump since dump requires proper rescannig to fill
up the persistent filter again. However, this is true only for pvcreate
but not for vgcreate with PV creation where the scanning happens before
this PV creation and hence the next rescan (if not full scan), does not
fill the persistent filter.

Also, move refresh_filters so that it's called sooner and only for
pvcreate, vgcreate already calls lvmcache_label_scan(cmd, 2) which
then calls refresh_filters itself, so no need to reevaluate this again.

This caused the persistent filter (/etc/lvm/cache/.cache file) to be
wrong and contain only the PV just being processed with
vgcreate <vg_name> <pv_name_to_create>.

This regression caused other block devices to be filtered out in case
the vgcreate with PV creation was used and then the persistent filter
is used by any other LVM command afterwards.

10 years agolvresize: Allow approximation with +%FREE.
Alasdair G Kergon [Thu, 31 Jul 2014 23:35:43 +0000 (00:35 +0100)]
lvresize: Allow approximation with +%FREE.

Make lvresize -l+%FREE support approximate allocation.

Move existing "Reducing/Extending' message to verbose level
and change it to say 'up to' if approximate allocation is being used.

Replace it with a new message that gives the actual old and new size or
says 'unchanged'.

10 years agotest: Skip lvextend-thin when thin not available
Marian Csontos [Thu, 31 Jul 2014 20:56:19 +0000 (22:56 +0200)]
test: Skip lvextend-thin when thin not available

10 years agometadata: remove spurious "Physical volume <dev_name> not found"
Peter Rajnoha [Thu, 31 Jul 2014 07:30:25 +0000 (09:30 +0200)]
metadata: remove spurious "Physical volume <dev_name> not found"

This is addendum to commit 2e82a070f3c9224da5c9f383d47e75a1715586cf
which fixed these spurious messages that appeared after commit
651d5093edde3e0ebee9d75be1c9834efc152d91 ("avoid pv_read in
find_pv_by_name").

There was one more "not found" message issued in case the device
could not be found in device cache (commit 2e82a07 fixed this only
for PV lookup itself). But if we "allow_unformatted" for
find_pv_by_name, we should not issue this message even in case
the device can't be found in dev cache as we just need to know
whether there's a PV or not for the code to decide on next steps
and we don't want to issue any messages if either device itself
is not found or PV is not found.

For example, when we were creating a new PV (and so allow_unformatted = 1)
and the device had a signature on it which caused it to be filtered
by device filter (e.g. MD signature if md filtering is enabled),
or it was part of some other subsystem (e.g. multipath), this message
was issued on find_pv_by_name call which was misleading.

Also, remove misleading "stack" call in case find_pv_by_name
returns NULL in pvcreate_check - any error state is reported
later by pvcreate_check code so no need to "stack" here.

There's one more and proper check to issue "not found" message if
the device can't be found in device cache within pvcreate_check fn
so this situation is still covered properly later in the code.

Before this patch (/dev/sda contains MD signature and is therefore filtered):

$ pvcreate /dev/sda
  Physical volume /dev/sda not found
WARNING: linux_raid_member signature detected on /dev/sda at offset 4096. Wipe it? [y/n]:

With this patch applied:

$ pvcreate /dev/sda
WARNING: linux_raid_member signature detected on /dev/sda at offset 4096. Wipe it? [y/n]:

Non-existent devices are still caught properly:

$ pvcreate /dev/sdx
  Device /dev/sdx not found (or ignored by filtering).

10 years agoactivation: Fix upgrades using uuid suffixes.
Alasdair G Kergon [Wed, 30 Jul 2014 20:55:11 +0000 (21:55 +0100)]
activation: Fix upgrades using uuid suffixes.

2.02.106 added suffixes to some LV uuids in the kernel.

If any of these LVs is activated with 2.02.105 or earlier,
and then a later version is used, the LVs appear invisible and
activation commands fail.

The code now has to check the kernel for both old and new uuids.

10 years agotest: Add a test for lvextend -l+100%FREE of a striped thin pool.
Petr Rockai [Wed, 30 Jul 2014 14:15:16 +0000 (16:15 +0200)]
test: Add a test for lvextend -l+100%FREE of a striped thin pool.

10 years agopost-release
Alasdair G Kergon [Wed, 23 Jul 2014 15:23:52 +0000 (16:23 +0100)]
post-release

10 years agoraid: Fix partial activation logic for non-raid. v2_02_108
Alasdair G Kergon [Wed, 23 Jul 2014 15:13:12 +0000 (16:13 +0100)]
raid: Fix partial activation logic for non-raid.

10 years agopre-release
Alasdair G Kergon [Wed, 23 Jul 2014 15:05:22 +0000 (16:05 +0100)]
pre-release

10 years agotests: still unusable kernel
Zdenek Kabelac [Tue, 22 Jul 2014 22:29:32 +0000 (00:29 +0200)]
tests: still unusable kernel

10 years agotests: support cluster run
Zdenek Kabelac [Tue, 22 Jul 2014 22:25:49 +0000 (00:25 +0200)]
tests: support cluster run

needs exclusive activation

10 years agotests: use exclusive activation
Zdenek Kabelac [Tue, 22 Jul 2014 21:43:26 +0000 (23:43 +0200)]
tests: use exclusive activation

10 years agoman: Update the lvscan manpage with a section on --cache.
Petr Rockai [Tue, 22 Jul 2014 20:47:27 +0000 (22:47 +0200)]
man: Update the lvscan manpage with a section on --cache.

10 years agoWHATS_NEW: lvscan --cache, dmeventd RAID + lvmetad
Petr Rockai [Tue, 22 Jul 2014 20:33:42 +0000 (22:33 +0200)]
WHATS_NEW: lvscan --cache, dmeventd RAID + lvmetad

10 years agodmeventd: Call lvscan --cache in the RAID plugin.
Petr Rockai [Mon, 21 Jul 2014 02:33:21 +0000 (04:33 +0200)]
dmeventd: Call lvscan --cache in the RAID plugin.

10 years agolvscan: Implement a --cache mode.
Petr Rockai [Mon, 21 Jul 2014 01:55:46 +0000 (03:55 +0200)]
lvscan: Implement a --cache mode.

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

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

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

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

Add missing description for --poolmetadataspare option.

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

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

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

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

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

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

Revert logic and rename new arg_ functions to:

arg_from_list_is_set()
arg_outside_list_is_set()

When err_found is given, log_error message is automaticaly
printed.

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

Reorganize and rewrite parts to match lvmthin(7).

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

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

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

Adjust some messages & fn names.

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

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

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

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

Revert part of cac0722cacaac06ac1211194f1d6c21572a32998

This was deliberate and aids the investigation of problems.

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

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

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

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

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

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

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

in-release fix.

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

Do not check quiet_ARG more then necessary.

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

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

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

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

TODO: needed validation against newline char...

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

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

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

Easier check for conflicting options with --merge.

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

Easier check for conflicting options with --splitsnapshot.

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

Validate all LV names in _lvconvert_name_params().

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

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

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

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

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

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

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

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

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

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

Commits:
d169ff1e039ecdfb1efac0a6464ca149d71d8767
bccc2bef33af081264bbc356e37efe89ef78b796
f76879ba440aa93f2e237335fe2cca6951a636bf

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

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

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

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

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

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

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

Various more cleanups.

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

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

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

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

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

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

as well as:

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

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

Detects as much cmdline errors prior opening VG.

Uses single lvconvert_name_params to convert LV names.

Detects as much incompatibilies in VG prior prompting.

Uses single prompt to confirm whole conversion.

TODO: still the code needs fixes...

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

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

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

Simplify code.

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

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

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

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

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

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

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

Helpful functions to more easily detect conflicting
set of options.

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

Extend the callback functionality to handle also cache pools.

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

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

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

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

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

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

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

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

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

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

Using '--yes' will skip this prompt:

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

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

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

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

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

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

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

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

Introducing cache tool support.

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

This is addendum for commit 6dc7b783c80c6834aa724df49b5d47b9b5601506.

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

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

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

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

Before the patch:

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

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

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

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