master - thin: no delete message for device_id 0
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e2eb1dc501aca4b1199...
Commit: e2eb1dc501aca4b11997b31978c9ce62916a7c98
Parent: fc9e7328113fb3c1563909cce3abde329684c637
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Sep 25 22:42:53 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Sep 25 22:54:07 2020 +0200
thin: no delete message for device_id 0
Since we always use device_id > 0, we could use
device_id == 0 to actually mark thinLV as an
LV we want to remove without delete message.
---
lib/metadata/pool_manip.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c
index 23b5b63ba..a9dc6116d 100644
--- a/lib/metadata/pool_manip.c
+++ b/lib/metadata/pool_manip.c
@@ -310,7 +310,8 @@ int detach_pool_lv(struct lv_segment *seg)
if (!detach_thin_external_origin(seg))
return_0;
- if (!attach_pool_message(first_seg(seg->pool_lv),
+ if (seg->device_id && /* Only thins with device_id > 0 can be deleted */
+ !attach_pool_message(first_seg(seg->pool_lv),
DM_THIN_MESSAGE_DELETE,
NULL, seg->device_id, no_update))
return_0;
3 years, 7 months
master - vgsplit: support for VDO volumes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fc9e7328113fb3c1563...
Commit: fc9e7328113fb3c1563909cce3abde329684c637
Parent: 502b895bb4a132fa0a45d30a2db0f8f06591b272
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Sep 24 20:49:18 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Sep 25 22:51:50 2020 +0200
vgsplit: support for VDO volumes
Enable support and ensure VDO always moves with VDOPOOL.
---
WHATS_NEW | 1 +
tools/vgsplit.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/WHATS_NEW b/WHATS_NEW
index ad3cbde6a..267914382 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.11 -
==================================
+ Enable vgsplit for VDO volumes.
Lvextend of vdo pool volumes ensure at least 1 new VDO slab is added.
Use revert_lv() on reload error path after vg_revert().
Configure --with-integrity enabled.
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index 1a422e683..778e63d47 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -125,6 +125,10 @@ static int _move_lvs(struct volume_group *vg_from, struct volume_group *vg_to)
lv_is_thin_volume(lv))
continue;
+ if (lv_is_vdo_pool(lv) ||
+ lv_is_vdo(lv))
+ continue;
+
if (lv_is_cache(lv) || lv_is_cache_pool(lv))
/* further checks by _move_cache() */
continue;
@@ -374,6 +378,42 @@ static int _move_thins(struct volume_group *vg_from,
return 1;
}
+static int _move_vdos(struct volume_group *vg_from,
+ struct volume_group *vg_to)
+{
+ struct dm_list *lvh, *lvht;
+ struct logical_volume *lv, *vdo_data_lv;
+ struct lv_segment *seg;
+
+ dm_list_iterate_safe(lvh, lvht, &vg_from->lvs) {
+ lv = dm_list_item(lvh, struct lv_list)->lv;
+
+ if (lv_is_vdo(lv)) {
+ seg = first_seg(lv);
+ vdo_data_lv = seg_lv(first_seg(seg_lv(seg, 0)), 0);
+
+ /* Ignore, if no allocations on PVs of @vg_to */
+ if (!lv_is_on_pvs(vdo_data_lv, &vg_to->pvs))
+ continue;
+
+ if (!_move_one_lv(vg_from, vg_to, lvh, &lvht))
+ return_0;
+ } else if (lv_is_vdo_pool(lv)) {
+ seg = first_seg(lv);
+ vdo_data_lv = seg_lv(seg, 0);
+
+ /* Ignore, if no allocations on PVs of @vg_to */
+ if (!lv_is_on_pvs(vdo_data_lv, &vg_to->pvs))
+ continue;
+
+ if (!_move_one_lv(vg_from, vg_to, lvh, &lvht))
+ return_0;
+ }
+ }
+
+ return 1;
+}
+
static int _move_cache(struct volume_group *vg_from,
struct volume_group *vg_to)
{
@@ -621,6 +661,10 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
if (!(_move_thins(vg_from, vg_to)))
goto_bad;
+ /* Move required vdo pools across */
+ if (!(_move_vdos(vg_from, vg_to)))
+ goto_bad;
+
/* Move required cache LVs across */
if (!(_move_cache(vg_from, vg_to)))
goto_bad;
3 years, 7 months
master - tests: basic test for vdo on raid LV
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=502b895bb4a132fa0a4...
Commit: 502b895bb4a132fa0a45d30a2db0f8f06591b272
Parent: 39cdc1469d192e48bf5e1b39fc51a42c64e46ab6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 14:48:17 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Sep 23 14:58:24 2020 +0200
tests: basic test for vdo on raid LV
Check stacing of VDO on top of raid LV works.
---
test/shell/lvconvert-vdo-raid.sh | 71 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 71 insertions(+)
diff --git a/test/shell/lvconvert-vdo-raid.sh b/test/shell/lvconvert-vdo-raid.sh
new file mode 100644
index 000000000..998315160
--- /dev/null
+++ b/test/shell/lvconvert-vdo-raid.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Exercise vdo-pool's on raidLV
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+#
+# Main
+#
+
+#
+aux have_vdo 6 2 1 || skip
+aux have_raid 1 3 0 || skip
+
+
+aux prepare_vg 2 9000
+
+lvcreate --yes --vdo -L4G $vg/vpool
+
+aux zero_dev "$dev1" "$(( $(get first_extent_sector "$dev1") + 8192 )):"
+aux zero_dev "$dev2" "$(( $(get first_extent_sector "$dev2") + 8192 )):"
+
+# convert _vdata to raid
+lvconvert --yes --type raid1 $vg/vpool_vdata
+check lv_field $vg/vpool_vdata segtype raid1 -a
+
+lvconvert --yes -m 0 $vg/vpool_vdata "$dev2"
+check lv_field $vg/vpool_vdata segtype linear -a
+
+# vpool should redirect to _vdata
+lvconvert --yes --type raid1 $vg/vpool
+check lv_field $vg/vpool_vdata segtype raid1 -a
+
+lvremove -f $vg
+
+aux enable_dev "$dev1"
+aux enable_dev "$dev2"
+
+
+lvcreate --type raid1 -L4G --nosync -n vpool1 $vg
+
+lvconvert --yes --vdopool $vg/vpool1 -V2G -n $lv1
+
+mkfs.ext4 -E nodiscard "$DM_DEV_DIR/$vg/$lv1"
+
+not lvrename $vg/vpool1
+
+lvchange -an $vg
+
+lvrename $vg/vpool1 $vg/vpool
+
+lvchange -ay $vg
+
+fsck -n "$DM_DEV_DIR/$vg/$lv1"
+
+lvs -a $vg
+
+vgremove -ff $vg
3 years, 7 months
master - tests: add check for rename of cached vdopool
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=39cdc1469d192e48bf5...
Commit: 39cdc1469d192e48bf5e1b39fc51a42c64e46ab6
Parent: cfc4dd4c7cb39354525866c9cd1b3c6442a6f558
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 13:22:08 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Sep 23 14:47:30 2020 +0200
tests: add check for rename of cached vdopool
---
test/shell/lvcreate-vdo-cache.sh | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvcreate-vdo-cache.sh b/test/shell/lvcreate-vdo-cache.sh
index b502986b4..c31ccccda 100644
--- a/test/shell/lvcreate-vdo-cache.sh
+++ b/test/shell/lvcreate-vdo-cache.sh
@@ -32,10 +32,22 @@ export MKE2FS_CONFIG="$TESTDIR/lib/mke2fs.conf"
aux prepare_vg 1 9000
-lvcreate --vdo -L4G -V2G --name $lv1 $vg/vpool
+lvcreate --vdo -L4G -V2G --name $lv1 $vg/vpool1
# Test caching VDOPoolLV
-lvcreate -H -L10 $vg/vpool
+lvcreate -H -L10 $vg/vpool1
+
+# Current VDO target driver cannot handle online rename
+# once this will be supported - update this test
+not lvrename $vg/vpool1 $vg/vpool 2>&1 | tee out
+grep "Cannot rename" out
+
+lvchange -an $vg
+
+# Ofline should work
+lvrename $vg/vpool1 $vg/vpool
+
+lvchange -ay $vg
mkfs.ext4 -E nodiscard "$DM_DEV_DIR/$vg/$lv1"
3 years, 7 months
master - tests: a bit bigger mirrors
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cfc4dd4c7cb39354525...
Commit: cfc4dd4c7cb39354525866c9cd1b3c6442a6f558
Parent: 90c50c1b537dd89b62dad3047e27420d411293f5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 14:06:19 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Sep 23 14:47:30 2020 +0200
tests: a bit bigger mirrors
Seems even with throttling we occasinally need slightly more.
---
test/shell/lvconvert-mirror.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/shell/lvconvert-mirror.sh b/test/shell/lvconvert-mirror.sh
index 7cf498de4..160b086f6 100644
--- a/test/shell/lvconvert-mirror.sh
+++ b/test/shell/lvconvert-mirror.sh
@@ -323,7 +323,7 @@ SHOULD=
aux throttle_dm_mirror || SHOULD=should
# Use large enough mirror that takes time to sychronize with small regionsize
-lvcreate -aey -L20 -Zn -Wn --type mirror --regionsize 16k -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
+lvcreate -aey -L30 -Zn -Wn --type mirror --regionsize 16k -m2 -n $lv1 $vg "$dev1" "$dev2" "$dev4" "$dev3:$DEVRANGE"
$SHOULD not lvconvert -m-1 $vg/$lv1 "$dev1" 2>&1 | tee out
aux restore_dm_mirror
grep "not in-sync" out
@@ -341,7 +341,7 @@ lvremove -ff $vg
aux throttle_dm_mirror || :
# No parallel lvconverts on a single LV please
# Use big enough mirror size and small regionsize to run on all test machines succesfully
-lvcreate -aey -Zn -Wn -L20 --type mirror --regionsize 16k -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-8"
+lvcreate -aey -Zn -Wn -L30 --type mirror --regionsize 16k -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3:0-8"
check mirror $vg $lv1
check mirror_legs $vg $lv1 2
3 years, 7 months
master - lvconvert: suppport vdo raid conversion also through vpool
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=90c50c1b537dd89b62d...
Commit: 90c50c1b537dd89b62dad3047e27420d411293f5
Parent: 50a37948b5b2245a8f5d7d78aa88fa0679dfe0e5
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 14:44:44 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Sep 23 14:47:30 2020 +0200
lvconvert: suppport vdo raid conversion also through vpool
User could directly use 'vdopool' LV name for conversion into raid.
(lvconvert --type raid1 vg/vdopool)
---
tools/lvconvert.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 780a81567..60c0fca21 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1790,6 +1790,9 @@ static int _lvconvert_raid_types(struct cmd_context *cmd, struct logical_volume
if (lv_is_cache(lv))
lv = seg_lv(first_seg(lv), 0);
+ if (lv_is_vdo_pool(lv))
+ return _lvconvert_raid_types(cmd, seg_lv(first_seg(lv), 0), lp);
+
if (lv_is_mirror(lv)) {
ret = _convert_mirror(cmd, lv, lp);
goto out;
@@ -5064,6 +5067,7 @@ static int _lvconvert_raid_types_check(struct cmd_context *cmd, struct logical_v
!lv_is_cache_pool_data(lv) &&
!lv_is_thin_pool_metadata(lv) &&
!lv_is_thin_pool_data(lv) &&
+ !lv_is_vdo_pool_data(lv) &&
!lv_is_used_cache_pool(lv) &&
!lv_is_mirrored(lv) &&
!lv_is_raid(lv))
3 years, 7 months
master - vdo: allow passing renamed vdopool name to kernel
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=50a37948b5b2245a8f5...
Commit: 50a37948b5b2245a8f5d7d78aa88fa0679dfe0e5
Parent: 7c19186271d3bf37412b7e7dcc271bc9b79f9f4a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 13:20:28 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Sep 23 13:20:28 2020 +0200
vdo: allow passing renamed vdopool name to kernel
Although kernel does not allow to load a new dm table
with renamed vdopool, at least make lvm2 code ready
it it every will get supported.
---
device_mapper/all.h | 1 +
device_mapper/libdm-deptree.c | 3 ++-
lib/vdo/vdo.c | 6 ++++--
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/device_mapper/all.h b/device_mapper/all.h
index df47d1a5a..1080d25ad 100644
--- a/device_mapper/all.h
+++ b/device_mapper/all.h
@@ -1019,6 +1019,7 @@ int dm_tree_node_add_integrity_target(struct dm_tree_node *node,
*/
int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
uint64_t size,
+ const char *vdo_pool_name,
const char *data_uuid,
uint64_t data_size,
const struct dm_vdo_target_params *param);
diff --git a/device_mapper/libdm-deptree.c b/device_mapper/libdm-deptree.c
index 2722a2c3b..653dd0959 100644
--- a/device_mapper/libdm-deptree.c
+++ b/device_mapper/libdm-deptree.c
@@ -4360,6 +4360,7 @@ int dm_tree_node_add_cache_target_base(struct dm_tree_node *node,
int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
uint64_t size,
+ const char *vdo_pool_name,
const char *data_uuid,
uint64_t data_size,
const struct dm_vdo_target_params *vtp)
@@ -4381,7 +4382,7 @@ int dm_tree_node_add_vdo_target(struct dm_tree_node *node,
return_0;
seg->vdo_params = *vtp;
- seg->vdo_name = node->name;
+ seg->vdo_name = vdo_pool_name;
seg->vdo_data_size = data_size;
node->props.send_messages = 2;
diff --git a/lib/vdo/vdo.c b/lib/vdo/vdo.c
index ab6d00825..c43a5dc26 100644
--- a/lib/vdo/vdo.c
+++ b/lib/vdo/vdo.c
@@ -362,19 +362,21 @@ static int _vdo_pool_add_target_line(struct dev_manager *dm,
struct dm_tree_node *node, uint64_t len,
uint32_t *pvmove_mirror_count __attribute__((unused)))
{
- char *data_uuid;
+ char *vdo_pool_name, *data_uuid;
if (!seg_is_vdo_pool(seg)) {
log_error(INTERNAL_ERROR "Passed segment is not VDO pool.");
return 0;
}
+ if (!(vdo_pool_name = dm_build_dm_name(mem, seg->lv->vg->name, seg->lv->name, lv_layer(seg->lv))))
+ return_0;
if (!(data_uuid = build_dm_uuid(mem, seg_lv(seg, 0), lv_layer(seg_lv(seg, 0)))))
return_0;
/* VDO uses virtual size instead of its physical size */
if (!dm_tree_node_add_vdo_target(node, get_vdo_pool_virtual_size(seg),
- data_uuid, seg_lv(seg, 0)->size,
+ vdo_pool_name, data_uuid, seg_lv(seg, 0)->size,
&seg->vdo_params))
return_0;
3 years, 7 months
master - vdo: disable support for online rename of vdopool LV
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7c19186271d3bf37412...
Commit: 7c19186271d3bf37412b7e7dcc271bc9b79f9f4a
Parent: 3869c9c4f630f33ef1b7e8c4e7e08968e6ef3c09
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Sep 23 13:18:23 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Sep 23 13:18:23 2020 +0200
vdo: disable support for online rename of vdopool LV
Since ATM kernel does not support this operation,
disable 'lvrename' of an active vdopool.
As a workaround, user may simply deactivate, rename and activate.
---
lib/metadata/lv_manip.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9f15e9f21..ff86a7ab3 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4717,6 +4717,12 @@ int lv_rename_update(struct cmd_context *cmd, struct logical_volume *lv,
return 0;
}
+ if (lv_is_vdo_pool(lv) && lv_is_active(lv_lock_holder(lv))) {
+ log_error("Cannot rename active VDOPOOL volume %s.",
+ display_lvname(lv));
+ return 0;
+ }
+
if (update_mda && !archive(vg))
return_0;
3 years, 7 months
master - tests: use aux wrapper and add more notes
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3869c9c4f630f33ef1b...
Commit: 3869c9c4f630f33ef1b7e8c4e7e08968e6ef3c09
Parent: e280f56dd3fa1419c37c486ae651b000f26cfeca
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 22 16:27:21 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 22 23:43:26 2020 +0200
tests: use aux wrapper and add more notes
This test seems to be hitting some corner case in handling
out-of-metadata space condintion in thin-pool.
Add few more aid notes and functionality.
Also add missing '|| true' with now direct-IO dd command.
---
test/shell/thin-flags.sh | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/test/shell/thin-flags.sh b/test/shell/thin-flags.sh
index df139b211..91bcad12e 100644
--- a/test/shell/thin-flags.sh
+++ b/test/shell/thin-flags.sh
@@ -47,7 +47,7 @@ lvchange -an $vg
# Overfill data area
lvchange -ay $vg
-dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=2 oflag=direct
+dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=2 oflag=direct || true
check lv_attr_bit health $vg/pool "D"
# TODO use spaces ??
check lv_field $vg/pool lv_health_status "out_of_data"
@@ -67,8 +67,15 @@ lvchange -an $vg
aux lvmconf 'global/thin_check_executable = ""'
# Prepare some fake metadata prefilled to ~100%
-lvcreate -L2 -n $lv1 $vg # tmp for metadata
-aux prepare_thin_metadata 490 1 | tee data
+lvcreate -L2 -n $lv1 $vg "$dev2" # tmp for metadata
+
+VOLS=490
+aux thin_restore_needs_more_volumes || VOLS=445
+aux prepare_thin_metadata $VOLS 1 | tee data
+
+# Note: we like want to test BOTH sizes (445 & 490) as ATM it gives
+# different errors (5.9-rc5 kernel does not handle it as expected by this test)
+
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
# Swap volume with restored fake metadata
@@ -78,13 +85,15 @@ lvchange -ay $vg
lvchange -ay $vg/$lv2
# Provisiong and last free bits in metadata
-dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=32K count=1 oflag=direct
+dd if=/dev/zero of="$DM_DEV_DIR/mapper/$vg-$lv2" bs=1M count=1 oflag=direct || true
check lv_attr_bit health $vg/pool "M"
# TODO - use spaces ??
check lv_field $vg/pool lv_health_status "metadata_read_only"
check lv_attr_bit health $vg/$lv2 "-"
+lvs -ao+seg_pe_ranges $vg
+
# needs_check needs newer version
if aux have_thin 1 16 0 ; then
check lv_attr_bit state $vg/pool "c"
3 years, 7 months
master - tests: move function to aux for reuse
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=e280f56dd3fa1419c37...
Commit: e280f56dd3fa1419c37c486ae651b000f26cfeca
Parent: adead83dc2763a12f2f0e711793b5fd8c446b3f9
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Sep 22 23:37:50 2020 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Sep 22 23:43:26 2020 +0200
tests: move function to aux for reuse
---
test/lib/aux.sh | 8 ++++++++
test/shell/lvextend-thin-metadata-dmeventd.sh | 5 +----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index a17bf846c..77942009b 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -1467,6 +1467,14 @@ thin_pool_error_works_32() {
esac
}
+thin_restore_needs_more_volumes() {
+ case $("$LVM_TEST_THIN_RESTORE_CMD" -V) in
+ # With older version of thin-tool we got slightly more compact metadata
+ 0.[0-6]*|0.7.0*) return 0 ;;
+ esac
+ return 1
+}
+
udev_wait() {
pgrep udev >/dev/null || return 0
which udevadm &>/dev/null || return 0
diff --git a/test/shell/lvextend-thin-metadata-dmeventd.sh b/test/shell/lvextend-thin-metadata-dmeventd.sh
index 5f6db994a..3193cc29c 100644
--- a/test/shell/lvextend-thin-metadata-dmeventd.sh
+++ b/test/shell/lvextend-thin-metadata-dmeventd.sh
@@ -61,10 +61,7 @@ test -n "$LVM_TEST_THIN_RESTORE_CMD" || LVM_TEST_THIN_RESTORE_CMD=$(which thin_r
aux have_thin 1 10 0 || skip
BIG_DATA=""
-case $("$LVM_TEST_THIN_RESTORE_CMD" -V) in
- # With older version of thin-tool we got slightly more compact metadata
- 0.[0-6]*|0.7.0*) BIG_DATA="generate_more_metadata" ;;
-esac
+aux thin_restore_needs_more_volumes && BIG_DATA="generate_more_metadata"
aux prepare_dmeventd
3 years, 7 months