master - lvconvert: position dedicated parity device in raid4 conversions porperly
by Heinz Mauelshagen
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=de78e8eae73cb1...
Commit: de78e8eae73cb155fdb906ef2b8ddc9ca1a918c4
Parent: 34da83d729436d245e91e24e30b6996862fe7725
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Fri Oct 21 18:59:59 2016 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Fri Oct 21 19:00:31 2016 +0200
lvconvert: position dedicated parity device in raid4 conversions porperly
On conversions between striped/raid0* and raid4, the kernel expects
the dedicated raid4 parity SubLVs in the first segment area rather than
in the last it's been allocated to, thus the data mapping ain't proper.
Enhance lvconvert (lib/metadata/raid_manip.c) to shift the dedicated
parity SubLVs on conversions from striped/raid0* to raid4 and vice-versa.
In case of raid0_meta -> raid4 where the MD raid0 personality already has
stored RAID array device positions in the superblocks, the MetaLVs have to
be cleared so that the kernel doesn't fail validating the array positions
after lvm has shifted them up by one.
Add more tests to lvconvert-raid-takeover.sh including one to check for
mapping flaws by converting a created raid4 with filesystem -> striped
and fsck it.
Whilst on it:
- add missing direct striped -> raid4 conversion to the takeover array
to avoid an intermim conversion from striped -> raid0*
- clean up the takeover array
- allow lvconvert to actually call lv_raid_convert() on all takeover requests
in order to check parameters and display messages provided by takeover
functions rather than just "...not supported" from within lvconvert
- fix a typo
Resolves: rhbz1386148
---
WHATS_NEW | 2 +
lib/metadata/raid_manip.c | 277 ++++++++++++++++++++++++++++++---
test/shell/lvconvert-raid-takeover.sh | 53 ++++++-
tools/lvconvert.c | 24 +--
4 files changed, 314 insertions(+), 42 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4138685..3a8e006 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,7 @@
Version 2.02.167 -
======================================
+ Add direct striped -> raid4 conversion
+ Fix raid4 parity image pair position on conversions from striped/raid0*
Fix a few unconverted return code values for some lvconvert error path.
Disable lvconvert of thin pool to raid while active.
Disable systemd service start rate limiting for lvm2-pvscan@.service.
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index e87a4e5..39d27f1 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -2459,7 +2459,7 @@ static struct lv_segment *_convert_striped_to_raid0(struct logical_volume *lv,
0 /* chunk_size */,
0 /* seg->region_size */, 0u /* extents_copied */ ,
NULL /* pvmove_source_seg */))) {
- log_error("Failed to allocate new raid0 segement for LV %s.", display_lvname(lv));
+ log_error("Failed to allocate new raid0 segment for LV %s.", display_lvname(lv));
return NULL;
}
@@ -2519,42 +2519,51 @@ static struct possible_takeover_reshape_type _possible_takeover_reshape_types[]
{ .current_types = SEG_STRIPED_TARGET, /* linear, i.e. seg->area_count = 1 */
.possible_types = SEG_RAID1,
.current_areas = 1,
- .options = ALLOW_NONE },
+ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
{ .current_types = SEG_STRIPED_TARGET, /* linear, i.e. seg->area_count = 1 */
.possible_types = SEG_RAID0|SEG_RAID0_META,
.current_areas = 1,
.options = ALLOW_STRIPE_SIZE },
- { .current_types = SEG_STRIPED_TARGET, /* striped, i.e. seg->area_count > 1 */
+ { .current_types = SEG_STRIPED_TARGET, /* striped -> raid0*, i.e. seg->area_count > 1 */
.possible_types = SEG_RAID0|SEG_RAID0_META,
.current_areas = ~0U,
.options = ALLOW_NONE },
+ { .current_types = SEG_STRIPED_TARGET, /* striped -> raid4 , i.e. seg->area_count > 1 */
+ .possible_types = SEG_RAID4,
+ .current_areas = ~0U,
+ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
/* raid0* -> */
{ .current_types = SEG_RAID0|SEG_RAID0_META, /* seg->area_count = 1 */
.possible_types = SEG_RAID1,
.current_areas = 1,
+ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
+ { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0* -> striped, i.e. seg->area_count > 1 */
+ .possible_types = SEG_STRIPED_TARGET,
+ .current_areas = ~0U,
.options = ALLOW_NONE },
- { .current_types = SEG_RAID0|SEG_RAID0_META, /* seg->area_count > 1 */
- .possible_types = SEG_RAID4,
+ { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0* -> raid0*, i.e. seg->area_count > 1 */
+ .possible_types = SEG_RAID0_META|SEG_RAID0,
.current_areas = ~0U,
.options = ALLOW_NONE },
- { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0 striped, i.e. seg->area_count > 0 */
+ { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0* -> raid4, i.e. seg->area_count > 1 */
+ .possible_types = SEG_RAID4,
+ .current_areas = ~0U,
+ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
+ /* raid4 -> -> */
+ { .current_types = SEG_RAID4, /* raid4 ->striped/raid0*, i.e. seg->area_count > 1 */
.possible_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META,
.current_areas = ~0U,
.options = ALLOW_NONE },
- /* raid1 -> */
+ /* raid1 -> mirror */
{ .current_types = SEG_RAID1,
- .possible_types = SEG_RAID1|SEG_MIRROR,
+ .possible_types = SEG_MIRROR,
.current_areas = ~0U,
- .options = ALLOW_NONE },
+ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
/* mirror -> raid1 with arbitrary number of legs */
{ .current_types = SEG_MIRROR,
- .possible_types = SEG_MIRROR|SEG_RAID1,
- .current_areas = ~0U,
- .options = ALLOW_NONE },
- { .current_types = SEG_RAID4,
- .possible_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META,
+ .possible_types = SEG_RAID1,
.current_areas = ~0U,
- .options = ALLOW_NONE },
+ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */
/* END */
{ .current_types = 0 }
@@ -2861,9 +2870,176 @@ static int _raid1_to_mirrored_wrapper(TAKEOVER_FN_ARGS)
allocate_pvs, 1, &removal_lvs);
}
+/*
+ * HM Helper: (raid0_meta -> raid4)
+ *
+ * To convert raid0_meta to raid4, which involves shifting the
+ * parity device to lv segment area 0 and thus changing MD
+ * array roles, detach the MetaLVs and reload as raid0 in
+ * order to wipe them then reattach and set back to raid0_meta.
+ */
+static int _clear_meta_lvs(struct logical_volume *lv)
+{
+ uint32_t s;
+ struct lv_segment *seg = first_seg(lv);
+ struct lv_segment_area *tmp_areas;
+ const struct segment_type *tmp_segtype;
+ struct dm_list meta_lvs;
+ struct lv_list *lvl_array, *lvl;
+
+ /* Reject non-raid0_meta segment types cautiously */
+ if (!seg_is_raid0_meta(seg) ||
+ !seg->meta_areas)
+ return_0;
+
+ if (!(lvl_array = dm_pool_alloc(lv->vg->vgmem, seg->area_count * sizeof(*lvl_array))))
+ return_0;
+
+ dm_list_init(&meta_lvs);
+ tmp_areas = seg->meta_areas;
+
+ /* Extract all MetaLVs listing them on @meta_lvs */
+ log_debug_metadata("Extracting all MetaLVs of %s to activate as raid0",
+ display_lvname(lv));
+ if (!_extract_image_component_sublist(seg, RAID_META, 0, seg->area_count, &meta_lvs, 0))
+ return_0;
+
+ /* Memorize meta areas and segtype to set again after initializing. */
+ seg->meta_areas = NULL;
+ tmp_segtype = seg->segtype;
+
+ if (!(seg->segtype = get_segtype_from_flag(lv->vg->cmd, SEG_RAID0)) ||
+ !lv_update_and_reload(lv))
+ return_0;
+
+ /*
+ * Now deactivate the MetaLVs before clearing, so
+ * that _clear_lvs() will activate them visible.
+ */
+ log_debug_metadata("Deactivating pulled out MetaLVs of %s before initializing.",
+ display_lvname(lv));
+ dm_list_iterate_items(lvl, &meta_lvs)
+ if (!deactivate_lv(lv->vg->cmd, lvl->lv))
+ return_0;
+
+ log_debug_metadata("Clearing allocated raid0_meta metadata LVs for conversion to raid4");
+ if (!_clear_lvs(&meta_lvs)) {
+ log_error("Failed to initialize metadata LVs");
+ return 0;
+ }
+
+ /* Set memorized meta areas and raid0_meta segtype */
+ seg->meta_areas = tmp_areas;
+ seg->segtype = tmp_segtype;
+
+ log_debug_metadata("Adding metadata LVs back into %s", display_lvname(lv));
+ s = 0;
+ dm_list_iterate_items(lvl, &meta_lvs) {
+ lv_set_hidden(lvl->lv);
+ if (!set_lv_segment_area_lv(seg, s++, lvl->lv, 0, RAID_META))
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * HM Helper: (raid0* <-> raid4)
+ *
+ * Rename SubLVs (pairs) allowing to shift names w/o collisions with active ones.
+ */
+#define SLV_COUNT 2
+static int _rename_area_lvs(struct logical_volume *lv, const char *suffix)
+{
+ uint32_t s;
+ size_t sz = strlen("rimage") + (suffix ? strlen(suffix) : 0) + 1;
+ char *sfx[SLV_COUNT] = { NULL, NULL };
+ struct lv_segment *seg = first_seg(lv);
+
+ /* Create _generate_raid_name() suffixes w/ or w/o passed in @suffix */
+ for (s = 0; s < SLV_COUNT; s++)
+ if (!(sfx[s] = dm_pool_alloc(lv->vg->cmd->mem, sz)) ||
+ dm_snprintf(sfx[s], sz, suffix ? "%s%s" : "%s", s ? "rmeta" : "rimage", suffix) < 0)
+ return_0;
+
+ /* Change names (temporarily) to be able to shift numerical name suffixes */
+ for (s = 0; s < seg->area_count; s++) {
+ if (!(seg_lv(seg, s)->name = _generate_raid_name(lv, sfx[0], s)))
+ return_0;
+ if (seg->meta_areas &&
+ !(seg_metalv(seg, s)->name = _generate_raid_name(lv, sfx[1], s)))
+ return_0;
+ }
+
+ for (s = 0; s < SLV_COUNT; s++)
+ dm_pool_free(lv->vg->cmd->mem, sfx[s]);
+
+ return 1;
+}
+
+/*
+ * HM Helper: (raid0* <-> raid4)
+ *
+ * Switch area LVs in lv segment @seg indexed by @s1 and @s2
+ */
+static void _switch_area_lvs(struct lv_segment *seg, uint32_t s1, uint32_t s2)
+{
+ struct logical_volume *lvt;
+
+ lvt = seg_lv(seg, s1);
+ seg_lv(seg, s1) = seg_lv(seg, s2);
+ seg_lv(seg, s2) = lvt;
+
+ /* Be cautious */
+ if (seg->meta_areas) {
+ lvt = seg_metalv(seg, s1);
+ seg_metalv(seg, s1) = seg_metalv(seg, s2);
+ seg_metalv(seg, s2) = lvt;
+ }
+}
+
+/*
+ * HM Helper:
+ *
+ * shift range of area LVs in @seg in range [ @s1, @s2 ] up if @s1 < @s2,
+ * else down bubbling the parity SubLVs up/down whilst shifting.
+ */
+static void _shift_area_lvs(struct lv_segment *seg, uint32_t s1, uint32_t s2)
+{
+ uint32_t s;
+
+ if (s1 < s2)
+ /* Forward shift n+1 -> n */
+ for (s = s1; s < s2; s++)
+ _switch_area_lvs(seg, s, s + 1);
+ else
+ /* Reverse shift n-1 -> n */
+ for (s = s1; s > s2; s--)
+ _switch_area_lvs(seg, s, s - 1);
+}
+
+/*
+ * Switch position of first and last area lv within
+ * @lv to move parity SubLVs from end to end.
+ *
+ * Direction depends on segment type raid4 / raid0_meta.
+ */
+static int _shift_parity_dev(struct lv_segment *seg)
+{
+ if (seg_is_raid0_meta(seg))
+ _shift_area_lvs(seg, seg->area_count - 1, 0);
+ else if (seg_is_raid4(seg))
+ _shift_area_lvs(seg, 0, seg->area_count - 1);
+ else
+ return 0;
+
+ return 1;
+}
+
/* raid45 -> raid0* / striped */
static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
{
+ int rename_sublvs = 0;
struct lv_segment *seg = first_seg(lv);
struct dm_list removal_lvs;
@@ -2879,10 +3055,39 @@ static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
if (!_raid_in_sync(lv))
return 0;
+ if (!yes && yes_no_prompt("Are you sure you want to convert \"%s\" LV %s to \"%s\" "
+ "type using all resilience? [y/n]: ",
+ lvseg_name(seg), display_lvname(lv), new_segtype->name) == 'n') {
+ log_error("Logical volume %s NOT converted to \"%s\"",
+ display_lvname(lv), new_segtype->name);
+ return 0;
+ }
+ if (sigint_caught())
+ return_0;
+
/* Archive metadata */
if (!archive(lv->vg))
return_0;
+ /*
+ * raid4 (which actually gets mapped to raid5/dedicated first parity disk)
+ * needs shifting of SubLVs to move the parity SubLV pair in the first area
+ * to the last one before conversion to raid0[_meta]/striped to allow for
+ * SubLV removal from the end of the areas arrays.
+ */
+ if (seg_is_raid4(seg)) {
+ /* Shift parity SubLV pair "PDD..." -> "DD...P" to be able to remove it off the end */
+ if (!_shift_parity_dev(seg))
+ return 0;
+
+ if (segtype_is_any_raid0(new_segtype) &&
+ !(rename_sublvs = _rename_area_lvs(lv, "_"))) {
+ log_error("Failed to rename %s LV %s MetaLVs", lvseg_name(seg), display_lvname(lv));
+ return 0;
+ }
+
+ }
+
/* Remove meta and data LVs requested */
if (!_lv_raid_change_image_count(lv, new_image_count, allocate_pvs, &removal_lvs, 0, 0))
return 0;
@@ -2902,7 +3107,19 @@ static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS)
seg->region_size = 0;
- return _lv_update_reload_fns_reset_eliminate_lvs(lv, &removal_lvs);
+ if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, &removal_lvs))
+ return_0;
+
+ if (rename_sublvs) {
+ if (!_rename_area_lvs(lv, NULL)) {
+ log_error("Failed to rename %s LV %s MetaLVs", lvseg_name(seg), display_lvname(lv));
+ return 0;
+ }
+ if (!lv_update_and_reload(lv))
+ return_0;
+ }
+
+ return 1;
}
static int _striped_to_raid0_wrapper(struct logical_volume *lv,
@@ -2930,6 +3147,9 @@ static int _striped_to_raid0_wrapper(struct logical_volume *lv,
static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS)
{
struct lv_segment *seg = first_seg(lv);
+ struct dm_list removal_lvs;
+
+ dm_list_init(&removal_lvs);
if (seg_is_raid10(seg))
return _takeover_unsupported_yet(lv, new_stripes, new_segtype);
@@ -2944,6 +3164,13 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS)
return 0;
}
+ /* FIXME: restricted to raid4 for the time being... */
+ if (!segtype_is_raid4(new_segtype)) {
+ /* Can't convert striped/raid0* to e.g. raid10_offset */
+ log_error("Can't convert %s to %s", display_lvname(lv), new_segtype->name);
+ return 0;
+ }
+
/* Archive metadata */
if (!archive(lv->vg))
return_0;
@@ -2961,7 +3188,10 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS)
log_debug_metadata("Adding metadata LVs to %s", display_lvname(lv));
if (!_raid0_add_or_remove_metadata_lvs(lv, 1 /* update_and_reload */, allocate_pvs, NULL))
return 0;
- }
+ /* raid0_meta -> raid4 needs clearing of MetaLVs in order to avoid raid disk role cahnge issues in the kernel */
+ } else if (segtype_is_raid4(new_segtype) &&
+ !_clear_meta_lvs(lv))
+ return 0;
/* Add the additional component LV pairs */
log_debug_metadata("Adding %" PRIu32 " component LV pair(s) to %s", new_image_count - lv_raid_image_count(lv),
@@ -2969,8 +3199,9 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS)
if (!_lv_raid_change_image_count(lv, new_image_count, allocate_pvs, NULL, 0, 1))
return 0;
- if (!segtype_is_raid4(new_segtype)) {
- /* Can't convert striped/raid0* to e.g. raid10_offset */
+ if (segtype_is_raid4(new_segtype) &&
+ (!_shift_parity_dev(seg) ||
+ !_rename_area_lvs(lv, "_"))) {
log_error("Can't convert %s to %s", display_lvname(lv), new_segtype->name);
return 0;
}
@@ -2987,6 +3218,14 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS)
if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, NULL))
return_0;
+ if (segtype_is_raid4(new_segtype)) {
+ /* We had to rename SubLVs because of collision free sgifting, rename back... */
+ if (!_rename_area_lvs(lv, NULL))
+ return 0;
+ if (!lv_update_and_reload(lv))
+ return_0;
+ }
+
return 1;
}
diff --git a/test/shell/lvconvert-raid-takeover.sh b/test/shell/lvconvert-raid-takeover.sh
index 19a65d3..0140e22 100644
--- a/test/shell/lvconvert-raid-takeover.sh
+++ b/test/shell/lvconvert-raid-takeover.sh
@@ -78,22 +78,58 @@ aux wait_for_sync $vg $lv1
# Clean up
lvremove --yes $vg/$lv1
-# Create 3-way raid0
-lvcreate -y -aey --type raid0 -i 3 -L 64M -n $lv1 $vg
-check lv_field $vg/$lv1 segtype "raid0"
+# Create 3-way striped
+lvcreate -y -aey --type striped -i 3 -L 64M -n $lv1 $vg
+check lv_field $vg/$lv1 segtype "striped"
check lv_field $vg/$lv1 stripes 3
echo y | mkfs -t ext4 /dev/mapper/$vg-$lv1
fsck -fn /dev/mapper/$vg-$lv1
-# Convert raid0 -> raid4
+# Create 3-way raid0
+lvcreate -y -aey --type raid0 -i 3 -L 64M -n $lv2 $vg
+check lv_field $vg/$lv2 segtype "raid0"
+check lv_field $vg/$lv2 stripes 3
+echo y | mkfs -t ext4 /dev/mapper/$vg-$lv2
+fsck -fn /dev/mapper/$vg-$lv2
+
+# Create 3-way raid0_meta
+lvcreate -y -aey --type raid0_meta -i 3 -L 64M -n $lv3 $vg
+check lv_field $vg/$lv3 segtype "raid0_meta"
+check lv_field $vg/$lv3 stripes 3
+echo y | mkfs -t ext4 /dev/mapper/$vg-$lv3
+fsck -fn /dev/mapper/$vg-$lv3
+
+# Create 3-way raid4
+lvcreate -y -aey --type raid4 -i 3 -L 64M -n $lv4 $vg
+check lv_field $vg/$lv4 segtype "raid4"
+check lv_field $vg/$lv4 stripes 4
+echo y | mkfs -t ext4 /dev/mapper/$vg-$lv4
+fsck -fn /dev/mapper/$vg-$lv4
+aux wait_for_sync $vg $lv4
+fsck -fn /dev/mapper/$vg-$lv4
+
+# Convert raid4 -> striped (correct raid4 mapping test!)
+lvconvert -y --ty striped $vg/$lv4
+check lv_field $vg/$lv4 segtype "striped"
+check lv_field $vg/$lv4 stripes 3
+fsck -fn /dev/mapper/$vg-$lv4
+
+# Convert striped -> raid4
lvconvert -y --ty raid4 $vg/$lv1
-lvchange --refresh $vg/$lv1
check lv_field $vg/$lv1 segtype "raid4"
check lv_field $vg/$lv1 stripes 4
fsck -fn /dev/mapper/$vg-$lv1
aux wait_for_sync $vg $lv1
fsck -fn /dev/mapper/$vg-$lv1
+# Convert raid0 -> raid4
+lvconvert -y --ty raid4 $vg/$lv2
+check lv_field $vg/$lv2 segtype "raid4"
+check lv_field $vg/$lv2 stripes 4
+fsck -fn /dev/mapper/$vg-$lv2
+aux wait_for_sync $vg $lv2
+fsck -fn /dev/mapper/$vg-$lv2
+
# Convert raid4 -> raid0_meta
lvconvert -y --ty raid0_meta $vg/$lv1
check lv_field $vg/$lv1 segtype "raid0_meta"
@@ -116,11 +152,16 @@ fsck -fn /dev/mapper/$vg-$lv1
# Convert raid0 -> raid4
lvconvert -y --ty raid4 $vg/$lv1
-lvchange --refresh $vg/$lv1
check lv_field $vg/$lv1 segtype "raid4"
check lv_field $vg/$lv1 stripes 4
fsck -fn /dev/mapper/$vg-$lv1
aux wait_for_sync $vg $lv1
fsck -fn /dev/mapper/$vg-$lv1
+# Convert raid4 -> striped
+lvconvert -y --ty striped $vg/$lv1
+check lv_field $vg/$lv1 segtype "striped"
+check lv_field $vg/$lv1 stripes 3
+fsck -fn /dev/mapper/$vg-$lv1
+
vgremove -ff $vg
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 772c268..1fbe1ea 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -1937,7 +1937,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
return 1;
}
goto try_new_takeover_or_reshape;
- } else if (!lp->repair && !lp->replace && (!*lp->type_str || seg->segtype == lp->segtype)) {
+ } else if (!lp->repair && !lp->replace && !*lp->type_str) {
log_error("Conversion operation not yet supported.");
return 0;
}
@@ -2005,28 +2005,18 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l
return 1;
}
-
try_new_takeover_or_reshape:
-
/* FIXME This needs changing globally. */
if (!arg_is_set(cmd, stripes_long_ARG))
lp->stripes = 0;
- /* Only let raid4 through for now. */
- if (lp->type_str && lp->type_str[0] && lp->segtype != seg->segtype &&
- ((seg_is_raid4(seg) && seg_is_striped(lp) && lp->stripes > 1) ||
- (seg_is_striped(seg) && seg->area_count > 1 && seg_is_raid4(lp)))) {
- if (!lv_raid_convert(lv, lp->segtype, lp->yes, lp->force, lp->stripes, lp->stripe_size_supplied, lp->stripe_size,
- lp->region_size, lp->pvh))
- return_0;
-
- log_print_unless_silent("Logical volume %s successfully converted.",
- display_lvname(lv));
- return 1;
- }
+ if (!lv_raid_convert(lv, lp->segtype, lp->yes, lp->force, lp->stripes, lp->stripe_size_supplied, lp->stripe_size,
+ lp->region_size, lp->pvh))
+ return_0;
- log_error("Conversion operation not yet supported.");
- return 0;
+ log_print_unless_silent("Logical volume %s successfully converted.",
+ display_lvname(lv));
+ return 1;
}
static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volume *cow,
7 years, 6 months
master - dmsetup: Produce partial output if dev disappears.
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=34da83d729436d...
Commit: 34da83d729436d245e91e24e30b6996862fe7725
Parent: 5c55c4ac18f60822da6bf61dde9dec3467a9e79a
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Tue Oct 18 18:01:52 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Tue Oct 18 18:01:52 2016 +0100
dmsetup: Produce partial output if dev disappears.
If a device disappears after obtaining the list of devices but before
processing it as a member of that list, dmsetup exits with a failure code.
Most commands still produce what output they can in these circumstances,
but 'ls --tree' and 'info -c' with fields depending on device dependencies
didn't. Change this.
---
WHATS_NEW_DM | 1 +
tools/dmsetup.c | 53 ++++++++++++++++++++++++++++++++++++-----------------
2 files changed, 37 insertions(+), 17 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index c69eb27..58a302e 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.136 -
======================================
+ Still produce output when dmsetup dependency tree building finds dev missing.
Check and report pthread_sigmask() failure in dmeventd.
Check mem alloc fail in _canonicalize_field_ids().
Use unsigned math when checking more then 31 legs of raid.
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 5b817bb..9d357ec 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -2707,6 +2707,9 @@ static int _add_dep(CMD_ARGS)
/*
* Create and walk dependency tree
+ *
+ * An incomplete _dtree may still be used by the caller,
+ * but the error must be reported.
*/
static int _build_whole_deptree(const struct command *cmd)
{
@@ -2724,12 +2727,14 @@ static int _build_whole_deptree(const struct command *cmd)
static int _display_tree(CMD_ARGS)
{
- if (!_build_whole_deptree(cmd))
- return_0;
+ int r;
- _display_tree_walk_children(dm_tree_find_node(_dtree, 0, 0), 0);
+ r = _build_whole_deptree(cmd);
- return 1;
+ if (_dtree)
+ _display_tree_walk_children(dm_tree_find_node(_dtree, 0, 0), 0);
+
+ return r;
}
/*
@@ -4471,9 +4476,14 @@ static int _report_init(const struct command *cmd, const char *subcommand)
selection, NULL, NULL)))
goto_out;
- if ((_report_type & DR_TREE) && cmd && !_build_whole_deptree(cmd)) {
- err("Internal device dependency tree creation failed.");
- goto out;
+ r = 1;
+
+ if ((_report_type & DR_TREE) && cmd) {
+ r = _build_whole_deptree(cmd);
+ if (!_dtree) {
+ err("Internal device dependency tree creation failed.");
+ goto out;
+ }
}
if (!_switches[INTERVAL_ARG])
@@ -4484,8 +4494,6 @@ static int _report_init(const struct command *cmd, const char *subcommand)
if (field_prefixes)
dm_report_set_output_field_name_prefix(_report, "dm_");
- r = 1;
-
out:
if (len)
dm_free(options);
@@ -6782,8 +6790,15 @@ unknown:
argc--, argv++;
}
- if (_switches[COLS_ARG] && !_report_init(cmd, subcommand))
- goto_out;
+ /* Default to success */
+ ret = 0;
+
+ if (_switches[COLS_ARG]) {
+ if (!_report_init(cmd, subcommand))
+ ret = 1;
+ if (!_report)
+ goto_out;
+ }
if (_switches[COUNT_ARG])
_count = ((uint32_t)_int_args[COUNT_ARG]) ? : UINT32_MAX;
@@ -6795,14 +6810,17 @@ unknown:
&_disp_units);
if (!_disp_factor) {
log_error("Invalid --units argument.");
+ ret = 1;
goto out;
}
}
/* Start interval timer. */
if (_count > 1)
- if (!_start_timer())
+ if (!_start_timer()) {
+ ret = 1;
goto_out;
+ }
doit:
multiple_devices = (cmd->repeatable_cmd && argc != 1 &&
@@ -6819,18 +6837,19 @@ doit:
if (_count > 1 && r) {
printf("\n");
/* wait for --interval and update timestamps */
- if (!_do_report_wait())
+ if (!_do_report_wait()) {
+ ret = 1;
goto_out;
+ }
}
}
- if (!r)
+ if (!r) {
+ ret = 1;
goto_out;
+ }
} while (--_count);
- /* Success */
- ret = 0;
-
out:
if (_report)
dm_report_free(_report);
7 years, 6 months
master - spec: move dmeventd -R from post to posttrans script for device-mapper-event package
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5c55c4ac18f608...
Commit: 5c55c4ac18f60822da6bf61dde9dec3467a9e79a
Parent: 900e899739b95bcf5a429fc46dd6f16a4b7b50d0
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Wed Oct 12 13:50:22 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Wed Oct 12 13:52:13 2016 +0200
spec: move dmeventd -R from post to posttrans script for device-mapper-event package
See also https://bugzilla.redhat.com/show_bug.cgi?id=1382688.
---
spec/packages.inc | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/spec/packages.inc b/spec/packages.inc
index 41f6ff7..85c9e6d 100644
--- a/spec/packages.inc
+++ b/spec/packages.inc
@@ -609,9 +609,6 @@ of device-mapper devices.
%if %{enable_systemd}
systemctl preset dm-event.socket > /dev/null 2>&1 || :
%endif
-if [ -e %{_default_pid_dir}/dmeventd.pid ]; then
- %{_sbindir}/dmeventd -R || echo "Failed to restart dmeventd daemon. Please, try manual restart."
-fi
%preun -n device-mapper-event
%if %{enable_systemd}
@@ -626,6 +623,11 @@ if [ $1 = 0 ]; then
%daemon_reload
fi
+%posttrans -n device-mapper-event
+if [ -e %{_default_pid_dir}/dmeventd.pid ]; then
+ %{_sbindir}/dmeventd -R || echo "Failed to restart dmeventd daemon. Please, try manual restart."
+fi
+
%files -n device-mapper-event
%defattr(-,root,root,-)
%{_sbindir}/dmeventd
7 years, 6 months
master - lvconvert: still use strcmp for now
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=900e899739b95b...
Commit: 900e899739b95bcf5a429fc46dd6f16a4b7b50d0
Parent: 8859d4508a9862af25b4c7d75aee84367b19da79
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Oct 12 11:12:48 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Oct 12 11:18:23 2016 +0200
lvconvert: still use strcmp for now
Keep for now function logic making its decision on string content.
We need bigger patch converting all things to bit-checks later.
This needs however bigger refactoring.
So this commit reverts some changes from:
c8b6c130158e1cc1a639afc21f5fd6306286fdb3
---
tools/lvconvert.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index c3ec1a6..772c268 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4180,7 +4180,7 @@ static int _convert_cache_volume(struct cmd_context *cmd, struct logical_volume
if (arg_is_set(cmd, splitmirrors_ARG))
return _convert_cache_volume_splitmirrors(cmd, lv, lp);
- if (segtype_is_thin_pool(lp->segtype) ||
+ if (!strcmp(lp->type_str, SEG_TYPE_NAME_THIN_POOL) ||
arg_is_set(cmd, thinpool_ARG))
return _convert_cache_volume_thin_pool(cmd, lv, lp);
@@ -4340,11 +4340,11 @@ static int _convert_raid(struct cmd_context *cmd, struct logical_volume *lv,
if (lp->cache)
return _convert_raid_cache(cmd, lv, lp);
- if (segtype_is_thin_pool(lp->segtype) ||
+ if (!strcmp(lp->type_str, SEG_TYPE_NAME_THIN_POOL) ||
arg_is_set(cmd, thinpool_ARG))
return _convert_raid_thin_pool(cmd, lv, lp);
- if (segtype_is_cache_pool(lp->segtype) ||
+ if (!strcmp(lp->type_str, SEG_TYPE_NAME_CACHE_POOL) ||
arg_is_set(cmd, cachepool_ARG))
return _convert_raid_cache_pool(cmd, lv, lp);
}
@@ -4365,7 +4365,7 @@ static int _convert_striped(struct cmd_context *cmd, struct logical_volume *lv,
if (lp->merge)
return _convert_striped_merge(cmd, lv, lp);
- if (lp->snapshot || segtype_is_snapshot(lp->segtype))
+ if (lp->snapshot || !strcmp(lp->type_str, SEG_TYPE_NAME_SNAPSHOT))
return _convert_striped_snapshot(cmd, lv, lp);
if (lp->thin)
@@ -4374,11 +4374,11 @@ static int _convert_striped(struct cmd_context *cmd, struct logical_volume *lv,
if (lp->cache)
return _convert_striped_cache(cmd, lv, lp);
- if (segtype_is_thin_pool(lp->segtype) ||
+ if (!strcmp(lp->type_str, SEG_TYPE_NAME_THIN_POOL) ||
arg_is_set(cmd, thinpool_ARG))
return _convert_striped_thin_pool(cmd, lv, lp);
- if (segtype_is_cache_pool(lp->segtype) ||
+ if (!strcmp(lp->type_str, SEG_TYPE_NAME_CACHE_POOL) ||
arg_is_set(cmd, cachepool_ARG))
return _convert_striped_cache_pool(cmd, lv, lp);
7 years, 6 months
master - lvconvert: fix RAID SubLV --splitmirror regression
by Heinz Mauelshagen
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8859d4508a9862...
Commit: 8859d4508a9862af25b4c7d75aee84367b19da79
Parent: e57fd9d96327f1f715748de99c23f9521a2d7b9b
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Wed Oct 12 00:24:57 2016 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Wed Oct 12 00:24:57 2016 +0200
lvconvert: fix RAID SubLV --splitmirror regression
Commit 088b3d036a73a7d947f6e9b12e8fad8a9f40d97f allowed repair on cache origin RAID LVs
and restricted lvconvert actions on RAID SubLVs to change number of mirrors, repair,
replace and type changes in order to avoid unsuitable coversions on them.
This introduced a regression prohibiting --splitmirrors on any RAID SubLVs
(e.g. of cache or thin LVs; lvconvert-{cache,thin}-raid.sh tests failing).
Fix allows split mirrors again.
Fix some indenting whilst on it.
---
tools/lvconvert.c | 49 +++++++++++++++++++++++++------------------------
1 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 48e8cc8..c3ec1a6 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4272,28 +4272,29 @@ static int _convert_raid(struct cmd_context *cmd, struct logical_volume *lv,
/* Permitted convert options on visible or hidden RaidLVs */
/* The --thinpool alternative for --type thin-pool is not preferred, so not shown. */
const char *permitted_options = lv_is_visible(lv) ?
- " --mirrors\n"
- " --splitmirrors\n"
- " --merge\n"
- " --repair\n"
- " --replace\n"
- " --type snapshot\n"
- " --type thin\n"
- " --type cache\n"
- " --type thin-pool\n"
- " --type cache-pool\n"
- " --type raid*\n"
- " --type mirror\n"
- " --type striped\n"
- " --type linear\n"
+ " --mirrors\n"
+ " --splitmirrors\n"
+ " --merge\n"
+ " --repair\n"
+ " --replace\n"
+ " --type snapshot\n"
+ " --type thin\n"
+ " --type cache\n"
+ " --type thin-pool\n"
+ " --type cache-pool\n"
+ " --type raid*\n"
+ " --type mirror\n"
+ " --type striped\n"
+ " --type linear\n"
:
- " --mirrors\n"
- " --repair\n"
- " --replace\n"
- " --type raid*\n"
- " --type mirror\n"
- " --type striped\n"
- " --type linear\n";
+ " --mirrors\n"
+ " --splitmirrors\n"
+ " --repair\n"
+ " --replace\n"
+ " --type raid*\n"
+ " --type mirror\n"
+ " --type striped\n"
+ " --type linear\n";
/* Applicable to any hidden _or_ visible LVs. */
if (arg_is_set(cmd, mirrors_ARG))
@@ -4305,6 +4306,9 @@ static int _convert_raid(struct cmd_context *cmd, struct logical_volume *lv,
if (arg_is_set(cmd, replace_ARG))
return _convert_raid_replace(cmd, lv, lp);
+ if (arg_is_set(cmd, splitmirrors_ARG))
+ return _convert_raid_splitmirrors(cmd, lv, lp);
+
if (segtype_is_raid(lp->segtype)) {
/* Only --type allowed on hidden RaidLV. */
if (!lv_is_visible(lv) && !arg_is_set(cmd, type_ARG))
@@ -4324,9 +4328,6 @@ static int _convert_raid(struct cmd_context *cmd, struct logical_volume *lv,
/* Applicable to visible LVs only. */
if (lv_is_visible(lv)) {
- if (arg_is_set(cmd, splitmirrors_ARG))
- return _convert_raid_splitmirrors(cmd, lv, lp);
-
if (lp->merge)
return _convert_raid_merge(cmd, lv, lp);
7 years, 6 months
master - lvmdbustest.py: ws fixes
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e57fd9d96327f1...
Commit: e57fd9d96327f1f715748de99c23f9521a2d7b9b
Parent: 9c56902365c4987b291e9ecdb853d9c4d14767c8
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Oct 11 12:22:31 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Oct 11 13:16:57 2016 -0500
lvmdbustest.py: ws fixes
---
test/dbus/lvmdbustest.py | 159 ++++++++++++++++++++++++---------------------
test/dbus/testlib.py | 32 +++++-----
2 files changed, 101 insertions(+), 90 deletions(-)
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 9432c79..e5b8243 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -9,6 +9,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# noinspection PyUnresolvedReferences
import dbus
# noinspection PyUnresolvedReferences
from dbus.mainloop.glib import DBusGMainLoop
@@ -49,9 +50,10 @@ def lv_n(suffix=None):
def get_objects():
- rc = {MANAGER_INT: [], PV_INT: [], VG_INT: [], LV_INT: [],
- THINPOOL_INT: [], JOB_INT: [], SNAPSHOT_INT: [], LV_COMMON_INT: [],
- CACHE_POOL_INT: [], CACHE_LV_INT: []}
+ rc = {
+ MANAGER_INT: [], PV_INT: [], VG_INT: [], LV_INT: [],
+ THINPOOL_INT: [], JOB_INT: [], SNAPSHOT_INT: [], LV_COMMON_INT: [],
+ CACHE_POOL_INT: [], CACHE_LV_INT: []}
manager = dbus.Interface(bus.get_object(
BUSNAME, "/com/redhat/lvmdbus1"),
@@ -289,7 +291,7 @@ class TestDbusService(unittest.TestCase):
if len(self.objs[PV_INT]) >= 2:
vg = self._vg_create(
[self.objs[PV_INT][0].object_path,
- self.objs[PV_INT][1].object_path]).Vg
+ self.objs[PV_INT][1].object_path]).Vg
path = self.handle_return(
vg.Reduce(False, [vg.Pvs[0]], g_tmo, {})
@@ -338,12 +340,14 @@ class TestDbusService(unittest.TestCase):
for l in lv_paths:
lv_proxy = ClientProxy(self.bus, l).LvCommon
- self.assertTrue(lv_proxy.Vg == vg.object_path, "%s != %s" %
- (lv_proxy.Vg, vg.object_path))
+ self.assertTrue(
+ lv_proxy.Vg == vg.object_path, "%s != %s" %
+ (lv_proxy.Vg, vg.object_path))
full_name = "%s/%s" % (new_name, lv_proxy.Name)
lv_path = mgr.LookUpByLvmId(full_name)
- self.assertTrue(lv_path == lv_proxy.object_path, "%s != %s" %
- (lv_path, lv_proxy.object_path))
+ self.assertTrue(
+ lv_path == lv_proxy.object_path, "%s != %s" %
+ (lv_path, lv_proxy.object_path))
def _verify_hidden_lookups(self, lv_common_object, vgname):
mgr = self.objs[MANAGER_INT][0].Manager
@@ -392,8 +396,9 @@ class TestDbusService(unittest.TestCase):
full_name = "%s/%s" % (vg_name_start, lv_name)
lookup_lv_path = mgr.LookUpByLvmId(full_name)
- self.assertTrue(thin_lv_path == lookup_lv_path,
- "%s != %s" % (thin_lv_path, lookup_lv_path))
+ self.assertTrue(
+ thin_lv_path == lookup_lv_path,
+ "%s != %s" % (thin_lv_path, lookup_lv_path))
# Rename the VG
new_name = 'renamed_' + vg.Name
@@ -411,13 +416,15 @@ class TestDbusService(unittest.TestCase):
for l in lv_paths:
lv_proxy = ClientProxy(self.bus, l).LvCommon
- self.assertTrue(lv_proxy.Vg == vg.object_path, "%s != %s" %
- (lv_proxy.Vg, vg.object_path))
+ self.assertTrue(
+ lv_proxy.Vg == vg.object_path, "%s != %s" %
+ (lv_proxy.Vg, vg.object_path))
full_name = "%s/%s" % (new_name, lv_proxy.Name)
# print('Full Name %s' % (full_name))
lv_path = mgr.LookUpByLvmId(full_name)
- self.assertTrue(lv_path == lv_proxy.object_path, "%s != %s" %
- (lv_path, lv_proxy.object_path))
+ self.assertTrue(
+ lv_path == lv_proxy.object_path, "%s != %s" %
+ (lv_path, lv_proxy.object_path))
# noinspection PyTypeChecker
self._verify_hidden_lookups(thin_pool.LvCommon, new_name)
@@ -444,13 +451,13 @@ class TestDbusService(unittest.TestCase):
self._test_lv_create(
vg.LvCreate,
(lv_n(), mib(4),
- dbus.Array([], '(ott)'), g_tmo, {}), vg)
+ dbus.Array([], '(ott)'), g_tmo, {}), vg)
def test_lv_create_job(self):
vg = self._vg_create().Vg
- (object_path, job_path) = vg.LvCreate(lv_n(), mib(4),
- dbus.Array([], '(ott)'), 0, {})
+ (object_path, job_path) = vg.LvCreate(
+ lv_n(), mib(4), dbus.Array([], '(ott)'), 0, {})
self.assertTrue(object_path == '/')
self.assertTrue(job_path != '/')
@@ -471,9 +478,7 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create(pv_paths).Vg
self._test_lv_create(
- vg.LvCreateStriped,
- (lv_n(), mib(4), 2, 8, False,
- g_tmo, {}), vg)
+ vg.LvCreateStriped, (lv_n(), mib(4), 2, 8, False, g_tmo, {}), vg)
def test_lv_create_mirror(self):
pv_paths = []
@@ -481,8 +486,8 @@ class TestDbusService(unittest.TestCase):
pv_paths.append(pp.object_path)
vg = self._vg_create(pv_paths).Vg
- self._test_lv_create(vg.LvCreateMirror,
- (lv_n(), mib(4), 2, g_tmo, {}), vg)
+ self._test_lv_create(
+ vg.LvCreateMirror, (lv_n(), mib(4), 2, g_tmo, {}), vg)
def test_lv_create_raid(self):
pv_paths = []
@@ -490,9 +495,8 @@ class TestDbusService(unittest.TestCase):
pv_paths.append(pp.object_path)
vg = self._vg_create(pv_paths).Vg
- self._test_lv_create(vg.LvCreateRaid,
- (lv_n(), 'raid4',
- mib(16), 2, 8, g_tmo, {}), vg)
+ self._test_lv_create(
+ vg.LvCreateRaid, (lv_n(), 'raid4', mib(16), 2, 8, g_tmo, {}), vg)
def _create_lv(self, thinpool=False, size=None, vg=None):
@@ -535,8 +539,9 @@ class TestDbusService(unittest.TestCase):
def test_lv_thinpool_rename(self):
# Rename a thin pool
tp = self._create_lv(True)
- self.assertTrue(THINPOOL_LV_PATH in tp.object_path,
- "%s" % (tp.object_path))
+ self.assertTrue(
+ THINPOOL_LV_PATH in tp.object_path,
+ "%s" % (tp.object_path))
new_name = 'renamed_' + tp.LvCommon.Name
self.handle_return(tp.Lv.Rename(new_name, g_tmo, {}))
@@ -612,11 +617,13 @@ class TestDbusService(unittest.TestCase):
pv = vg.Pvs
- pv_proxy = ClientProxy(self.bus, pv[0])
+ pvp = ClientProxy(self.bus, pv[0])
- self._test_lv_create(vg.LvCreate, (lv_n(), mib(4),
- dbus.Array([[pv_proxy.object_path, 0, (pv_proxy.Pv.PeCount - 1)]],
- '(ott)'), g_tmo, {}), vg)
+ self._test_lv_create(
+ vg.LvCreate,
+ (lv_n(), mib(4),
+ dbus.Array([[pvp.object_path, 0, (pvp.Pv.PeCount - 1)]],
+ '(ott)'), g_tmo, {}), vg)
def test_lv_resize(self):
@@ -646,8 +653,8 @@ class TestDbusService(unittest.TestCase):
rc = self.handle_return(
lv.Lv.Resize(
size,
- dbus.Array([[p.object_path, 0, p.Pv.PeCount - 1]],
- '(oii)'),
+ dbus.Array(
+ [[p.object_path, 0, p.Pv.PeCount - 1]], '(oii)'),
g_tmo, {}))
else:
rc = self.handle_return(
@@ -674,8 +681,8 @@ class TestDbusService(unittest.TestCase):
lv = self._create_lv(vg=vg)
with self.assertRaises(dbus.exceptions.DBusException):
- lv.Lv.Resize(lv.LvCommon.SizeBytes, dbus.Array([], '(oii)'),
- -1, {})
+ lv.Lv.Resize(
+ lv.LvCommon.SizeBytes, dbus.Array([], '(oii)'), -1, {})
def test_lv_move(self):
lv = self._create_lv()
@@ -693,8 +700,8 @@ class TestDbusService(unittest.TestCase):
lv.update()
new_pv = str(lv.LvCommon.Devices[0][0])
- self.assertTrue(pv_path_move != new_pv, "%s == %s" %
- (pv_path_move, new_pv))
+ self.assertTrue(
+ pv_path_move != new_pv, "%s == %s" % (pv_path_move, new_pv))
def test_lv_activate_deactivate(self):
lv_p = self._create_lv()
@@ -923,8 +930,9 @@ class TestDbusService(unittest.TestCase):
vg.MaxPvSet(p, g_tmo, {}))
self.assertEqual(rc, '/')
vg.update()
- self.assertTrue(vg.MaxPv == p, "Expected %s != Actual %s" %
- (str(p), str(vg.MaxPv)))
+ self.assertTrue(
+ vg.MaxPv == p,
+ "Expected %s != Actual %s" % (str(p), str(vg.MaxPv)))
def test_vg_max_lv(self):
vg = self._vg_create().Vg
@@ -935,8 +943,9 @@ class TestDbusService(unittest.TestCase):
rc = self.handle_return(vg.MaxLvSet(p, g_tmo, {}))
self.assertEqual(rc, '/')
vg.update()
- self.assertTrue(vg.MaxLv == p, "Expected %s != Actual %s" %
- (str(p), str(vg.MaxLv)))
+ self.assertTrue(
+ vg.MaxLv == p,
+ "Expected %s != Actual %s" % (str(p), str(vg.MaxLv)))
def test_vg_uuid_gen(self):
# TODO renable test case when
@@ -950,8 +959,9 @@ class TestDbusService(unittest.TestCase):
rc = self.handle_return(vg.UuidGenerate(g_tmo, {}))
self.assertEqual(rc, '/')
vg.update()
- self.assertTrue(vg.Uuid != prev_uuid, "Expected %s != Actual %s" %
- (vg.Uuid, prev_uuid))
+ self.assertTrue(
+ vg.Uuid != prev_uuid,
+ "Expected %s != Actual %s" % (vg.Uuid, prev_uuid))
def test_vg_activate_deactivate(self):
vg = self._vg_create().Vg
@@ -1032,8 +1042,9 @@ class TestDbusService(unittest.TestCase):
self.assertEqual(
self.handle_return(
- mgr.PvScan(False, True, dbus.Array([], 's'),
- dbus.Array([], '(ii)'), g_tmo, {})), '/')
+ mgr.PvScan(
+ False, True, dbus.Array([], 's'),
+ dbus.Array([], '(ii)'), g_tmo, {})), '/')
self.assertEqual(self._refresh(), 0)
self.assertEqual(
@@ -1063,13 +1074,8 @@ class TestDbusService(unittest.TestCase):
mm.append((int(d.properties['MAJOR']), int(d.properties['MINOR'])))
self.assertEqual(
-
self.handle_return(
- mgr.PvScan
- (False, True,
- block_path,
- mm, g_tmo, {})
- ), '/')
+ mgr.PvScan(False, True, block_path, mm, g_tmo, {})), '/')
self.assertEqual(self._refresh(), 0)
@@ -1150,8 +1156,8 @@ class TestDbusService(unittest.TestCase):
vg, cache_pool = self._create_cache_pool()
- self.assertTrue('/com/redhat/lvmdbus1/CachePool' in
- cache_pool.object_path)
+ self.assertTrue(
+ '/com/redhat/lvmdbus1/CachePool' in cache_pool.object_path)
def test_cache_lv_create(self):
@@ -1167,11 +1173,10 @@ class TestDbusService(unittest.TestCase):
cached_lv = ClientProxy(self.bus, c_lv_path)
uncached_lv_path = self.handle_return(
- cached_lv.CachedLv.DetachCachePool(
- destroy_cache, g_tmo, {}))
+ cached_lv.CachedLv.DetachCachePool(destroy_cache, g_tmo, {}))
- self.assertTrue('/com/redhat/lvmdbus1/Lv' in
- uncached_lv_path)
+ self.assertTrue(
+ '/com/redhat/lvmdbus1/Lv' in uncached_lv_path)
rc = self.handle_return(vg.Remove(g_tmo, {}))
self.assertTrue(rc == '/')
@@ -1236,19 +1241,21 @@ class TestDbusService(unittest.TestCase):
lv_n() + c,
mib(4), False, g_tmo, {}))
- for r in ("_cdata", "_cmeta", "_corig", "_mimage", "_mlog",
- "_pmspare", "_rimage", "_rmeta", "_tdata", "_tmeta", "_vorigin"):
+ for reserved in (
+ "_cdata", "_cmeta", "_corig", "_mimage", "_mlog",
+ "_pmspare", "_rimage", "_rmeta", "_tdata", "_tmeta",
+ "_vorigin"):
with self.assertRaises(dbus.exceptions.DBusException):
self.handle_return(
vg_proxy.Vg.LvCreateLinear(
- lv_n() + r,
+ lv_n() + reserved,
mib(4), False, g_tmo, {}))
- for r in ("snapshot", "pvmove"):
+ for reserved in ("snapshot", "pvmove"):
with self.assertRaises(dbus.exceptions.DBusException):
self.handle_return(
vg_proxy.Vg.LvCreateLinear(
- r + lv_n(),
+ reserved + lv_n(),
mib(4), False, g_tmo, {}))
_ALLOWABLE_TAG_CH = string.ascii_letters + string.digits + "._-+/=!:&#"
@@ -1288,16 +1295,18 @@ class TestDbusService(unittest.TestCase):
for i in range(1, 64):
tag = rs(i, "", self._ALLOWABLE_TAG_CH)
- r = self.handle_return(
+ tmp = self.handle_return(
vg_proxy.Vg.TagsAdd([tag], g_tmo, {}))
- self.assertTrue(r == '/')
+ self.assertTrue(tmp == '/')
vg_proxy.update()
- self.assertTrue(tag in vg_proxy.Vg.Tags, "%s not in %s" %
- (tag, str(vg_proxy.Vg.Tags)))
+ self.assertTrue(
+ tag in vg_proxy.Vg.Tags,
+ "%s not in %s" % (tag, str(vg_proxy.Vg.Tags)))
- self.assertEqual(i, len(vg_proxy.Vg.Tags), "%d != %d" %
- (i, len(vg_proxy.Vg.Tags)))
+ self.assertEqual(
+ i, len(vg_proxy.Vg.Tags),
+ "%d != %d" % (i, len(vg_proxy.Vg.Tags)))
def test_tag_regression(self):
mgr = self.objs[MANAGER_INT][0].Manager
@@ -1309,14 +1318,15 @@ class TestDbusService(unittest.TestCase):
tag = '--h/K.6g0A4FOEatf3+k_nI/Yp&L_u2oy-=j649x:+dUcYWPEo6.IWT0c'
- r = self.handle_return(
+ tmp = self.handle_return(
vg_proxy.Vg.TagsAdd([tag], g_tmo, {})
)
- self.assertTrue(r == '/')
+ self.assertTrue(tmp == '/')
vg_proxy.update()
- self.assertTrue(tag in vg_proxy.Vg.Tags, "%s not in %s" %
- (tag, str(vg_proxy.Vg.Tags)))
+ self.assertTrue(
+ tag in vg_proxy.Vg.Tags,
+ "%s not in %s" % (tag, str(vg_proxy.Vg.Tags)))
class AggregateResults(object):
@@ -1364,7 +1374,8 @@ if __name__ == '__main__':
r.register_result(unittest.main(exit=False))
else:
r.register_fail()
- std_err_print("ERROR: Unable to dynamically configure "
- "service to use lvm shell!")
+ std_err_print(
+ "ERROR: Unable to dynamically configure service to use "
+ "lvm shell!")
r.exit_run()
diff --git a/test/dbus/testlib.py b/test/dbus/testlib.py
index b382482..d88ebbd 100644
--- a/test/dbus/testlib.py
+++ b/test/dbus/testlib.py
@@ -32,8 +32,7 @@ THINPOOL_LV_PATH = '/' + THINPOOL_INT.replace('.', '/')
def rs(length, suffix, character_set=string.ascii_lowercase):
- return ''.join(random.choice(character_set)
- for _ in range(length)) + suffix
+ return ''.join(random.choice(character_set) for _ in range(length)) + suffix
def mib(s):
@@ -50,8 +49,7 @@ class DbusIntrospection(object):
for c in root:
if c.tag == "interface":
in_f = c.attrib['name']
- interfaces[in_f] = \
- dict(methods=OrderedDict(), properties={})
+ interfaces[in_f] = dict(methods=OrderedDict(), properties={})
for nested in c:
if nested.tag == "method":
mn = nested.attrib['name']
@@ -71,7 +69,8 @@ class DbusIntrospection(object):
v = dict(
name=mn,
a_dir=arg_dir,
- a_type=arg_type)
+ a_type=arg_type
+ )
interfaces[in_f]['methods'][mn][n] = v
elif nested.tag == 'property':
@@ -148,10 +147,9 @@ def verify_type(value, dbus_str_rep):
# print("%s ~= %s" % (dbus_str_rep, actual_str_rep))
# Unless we have a full filled out type we won't match exactly
if not dbus_str_rep.startswith(actual_str_rep):
- raise RuntimeError("Incorrect type, expected= %s actual "
- "= %s object= %s" %
- (dbus_str_rep, actual_str_rep,
- str(type(value))))
+ raise RuntimeError(
+ "Incorrect type, expected= %s actual = %s object= %s" %
+ (dbus_str_rep, actual_str_rep, str(type(value))))
class RemoteObject(object):
@@ -174,12 +172,14 @@ class RemoteObject(object):
if props:
for kl, vl in list(props.items()):
# Verify type is correct!
- verify_type(vl,
+ verify_type(
+ vl,
self.introspect[self.interface]['properties'][kl]['p_type'])
setattr(self, kl, vl)
- def __init__(self, specified_bus, object_path, interface, introspect,
- properties=None):
+ def __init__(
+ self, specified_bus, object_path, interface, introspect,
+ properties=None):
self.object_path = object_path
self.interface = interface
self.bus = specified_bus
@@ -238,11 +238,11 @@ class ClientProxy(object):
# print('Client proxy has interface: %s %s' % (k, sn))
if interface and interface == k and props is not None:
- ro = RemoteObject(specified_bus, object_path, k,
- self.intro_spect, props)
+ ro = RemoteObject(
+ specified_bus, object_path, k, self.intro_spect, props)
else:
- ro = RemoteObject(specified_bus, object_path, k,
- self.intro_spect)
+ ro = RemoteObject(
+ specified_bus, object_path, k, self.intro_spect)
setattr(self, sn, ro)
7 years, 6 months
master - lvmdbustest.py: Add $PREFIX support
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9c56902365c498...
Commit: 9c56902365c4987b291e9ecdb853d9c4d14767c8
Parent: 595af62ebd8eca6b95266f617df67528f3b70fd8
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Oct 11 12:02:10 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Oct 11 13:16:57 2016 -0500
lvmdbustest.py: Add $PREFIX support
Use the env variable PREFIX for vg & lv names
---
test/dbus/lvmdbustest.py | 52 +++++++++++++++++++++++++++++----------------
1 files changed, 33 insertions(+), 19 deletions(-)
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index 1991c94..9432c79 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -21,6 +21,8 @@ from testlib import *
g_tmo = 0
+g_prefix = os.getenv('PREFIX', '')
+
use_session = os.getenv('LVMDBUSD_USE_SESSION', False)
if use_session:
@@ -34,6 +36,18 @@ def std_err_print(*args):
sys.stderr.flush()
+def vg_n():
+ return g_prefix + rs(8, '_vg')
+
+
+def lv_n(suffix=None):
+ if not suffix:
+ s = '_lv'
+ else:
+ s = suffix
+ return g_prefix + rs(8, s)
+
+
def get_objects():
rc = {MANAGER_INT: [], PV_INT: [], VG_INT: [], LV_INT: [],
THINPOOL_INT: [], JOB_INT: [], SNAPSHOT_INT: [], LV_COMMON_INT: [],
@@ -146,7 +160,7 @@ class TestDbusService(unittest.TestCase):
if not pv_paths:
pv_paths = [self.objs[PV_INT][0].object_path]
- vg_name = rs(8, '_vg')
+ vg_name = vg_n()
vg_path = self.handle_return(
self.objs[MANAGER_INT][0].Manager.VgCreate(
@@ -367,7 +381,7 @@ class TestDbusService(unittest.TestCase):
self._verify_hidden_lookups(thin_pool.LvCommon, vg_name_start)
for i in range(0, 5):
- lv_name = rs(8, '_lv')
+ lv_name = lv_n()
thin_lv_path = self.handle_return(
thin_pool.ThinPool.LvCreate(
@@ -429,13 +443,13 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create().Vg
self._test_lv_create(
vg.LvCreate,
- (rs(8, '_lv'), mib(4),
+ (lv_n(), mib(4),
dbus.Array([], '(ott)'), g_tmo, {}), vg)
def test_lv_create_job(self):
vg = self._vg_create().Vg
- (object_path, job_path) = vg.LvCreate(rs(8, '_lv'), mib(4),
+ (object_path, job_path) = vg.LvCreate(lv_n(), mib(4),
dbus.Array([], '(ott)'), 0, {})
self.assertTrue(object_path == '/')
@@ -448,7 +462,7 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create().Vg
self._test_lv_create(
vg.LvCreateLinear,
- (rs(8, '_lv'), mib(4), False, g_tmo, {}), vg)
+ (lv_n(), mib(4), False, g_tmo, {}), vg)
def test_lv_create_striped(self):
pv_paths = []
@@ -458,7 +472,7 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create(pv_paths).Vg
self._test_lv_create(
vg.LvCreateStriped,
- (rs(8, '_lv'), mib(4), 2, 8, False,
+ (lv_n(), mib(4), 2, 8, False,
g_tmo, {}), vg)
def test_lv_create_mirror(self):
@@ -468,7 +482,7 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create(pv_paths).Vg
self._test_lv_create(vg.LvCreateMirror,
- (rs(8, '_lv'), mib(4), 2, g_tmo, {}), vg)
+ (lv_n(), mib(4), 2, g_tmo, {}), vg)
def test_lv_create_raid(self):
pv_paths = []
@@ -477,7 +491,7 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create(pv_paths).Vg
self._test_lv_create(vg.LvCreateRaid,
- (rs(8, '_lv'), 'raid4',
+ (lv_n(), 'raid4',
mib(16), 2, 8, g_tmo, {}), vg)
def _create_lv(self, thinpool=False, size=None, vg=None):
@@ -494,7 +508,7 @@ class TestDbusService(unittest.TestCase):
return self._test_lv_create(
vg.LvCreateLinear,
- (rs(8, '_lv'), size, thinpool, g_tmo, {}), vg)
+ (lv_n(), size, thinpool, g_tmo, {}), vg)
def test_lv_create_rounding(self):
self._create_lv(size=(mib(2) + 13))
@@ -540,7 +554,7 @@ class TestDbusService(unittest.TestCase):
thin_path = self.handle_return(
tp.ThinPool.LvCreate(
- rs(10, '_thin_lv'), mib(8), g_tmo, {})
+ lv_n('_thin_lv'), mib(8), g_tmo, {})
)
lv = ClientProxy(self.bus, thin_path)
@@ -600,7 +614,7 @@ class TestDbusService(unittest.TestCase):
pv_proxy = ClientProxy(self.bus, pv[0])
- self._test_lv_create(vg.LvCreate, (rs(8, '_lv'), mib(4),
+ self._test_lv_create(vg.LvCreate, (lv_n(), mib(4),
dbus.Array([[pv_proxy.object_path, 0, (pv_proxy.Pv.PeCount - 1)]],
'(ott)'), g_tmo, {}), vg)
@@ -745,7 +759,7 @@ class TestDbusService(unittest.TestCase):
for pp in self.objs[PV_INT]:
pv_paths.append(pp.object_path)
- vg_name = rs(8, '_vg')
+ vg_name = vg_n()
# Test getting a job right away
vg_path, vg_job = self.objs[MANAGER_INT][0].Manager.VgCreate(
@@ -775,7 +789,7 @@ class TestDbusService(unittest.TestCase):
if vg_proxy.Vg.FreeCount > 0:
job = self.handle_return(
vg_proxy.Vg.LvCreateLinear(
- rs(8, "_lv"), mib(4), False, g_tmo, {}))
+ lv_n(), mib(4), False, g_tmo, {}))
self.assertTrue(job != '/')
else:
# We ran out of space, test will probably fail
@@ -871,7 +885,7 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create().Vg
lv = self._test_lv_create(
vg.LvCreateLinear,
- (rs(8, '_lv'), mib(4), False, g_tmo, {}),
+ (lv_n(), mib(4), False, g_tmo, {}),
vg)
t = ['Testing', 'tags']
@@ -943,7 +957,7 @@ class TestDbusService(unittest.TestCase):
vg = self._vg_create().Vg
self._test_lv_create(
vg.LvCreateLinear,
- (rs(8, '_lv'), mib(4), False, g_tmo, {}),
+ (lv_n(), mib(4), False, g_tmo, {}),
vg)
vg.update()
@@ -1102,7 +1116,7 @@ class TestDbusService(unittest.TestCase):
thin_path = self.handle_return(
tp.ThinPool.LvCreate(
- rs(10, '_thin_lv'), mib(10), g_tmo, {}))
+ lv_n('_thin_lv'), mib(10), g_tmo, {}))
lv_p = ClientProxy(self.bus, thin_path)
@@ -1219,7 +1233,7 @@ class TestDbusService(unittest.TestCase):
with self.assertRaises(dbus.exceptions.DBusException):
self.handle_return(
vg_proxy.Vg.LvCreateLinear(
- rs(8, '_lv') + c,
+ lv_n() + c,
mib(4), False, g_tmo, {}))
for r in ("_cdata", "_cmeta", "_corig", "_mimage", "_mlog",
@@ -1227,14 +1241,14 @@ class TestDbusService(unittest.TestCase):
with self.assertRaises(dbus.exceptions.DBusException):
self.handle_return(
vg_proxy.Vg.LvCreateLinear(
- rs(8, '_lv') + r,
+ lv_n() + r,
mib(4), False, g_tmo, {}))
for r in ("snapshot", "pvmove"):
with self.assertRaises(dbus.exceptions.DBusException):
self.handle_return(
vg_proxy.Vg.LvCreateLinear(
- r + rs(8, '_lv'),
+ r + lv_n(),
mib(4), False, g_tmo, {}))
_ALLOWABLE_TAG_CH = string.ascii_letters + string.digits + "._-+/=!:&#"
7 years, 6 months
master - lvmdbustest.py: Use more compatible syntax
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=595af62ebd8eca...
Commit: 595af62ebd8eca6b95266f617df67528f3b70fd8
Parent: 4fab8339207fd8846e04e775897a7ba7a3cd074c
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Oct 11 10:43:41 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Oct 11 13:16:57 2016 -0500
lvmdbustest.py: Use more compatible syntax
---
test/dbus/lvmdbustest.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index d222264..1991c94 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -29,8 +29,9 @@ else:
bus = dbus.SystemBus(mainloop=DBusGMainLoop())
-def std_err_print(*args, **kwargs):
- print(*args, file=sys.stderr, **kwargs)
+def std_err_print(*args):
+ sys.stderr.write(' '.join(map(str, args)) + '\n')
+ sys.stderr.flush()
def get_objects():
7 years, 6 months
master - lvmdbusd: Remove log ouput when ec=0 & stderr != 0 bytes
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4fab8339207fd8...
Commit: 4fab8339207fd8846e04e775897a7ba7a3cd074c
Parent: 2830f722882d064a6ffbe143f5a580364bcba2e6
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Oct 11 09:42:18 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Oct 11 13:16:57 2016 -0500
lvmdbusd: Remove log ouput when ec=0 & stderr != 0 bytes
lvm likes to log to stderr virtually all the time, this isn't
helpful.
---
daemons/lvmdbusd/cmdhandler.py | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/daemons/lvmdbusd/cmdhandler.py b/daemons/lvmdbusd/cmdhandler.py
index 4bdbee5..fa34a7a 100644
--- a/daemons/lvmdbusd/cmdhandler.py
+++ b/daemons/lvmdbusd/cmdhandler.py
@@ -108,12 +108,6 @@ def call_lvm(command, debug=False):
if debug or process.returncode != 0:
_debug_c(command, process.returncode, (stdout_text, stderr_text))
- if process.returncode == 0:
- if cfg.args and cfg.args.debug and out[1] and len(out[1]) and \
- 'help' not in command:
- log_error('WARNING: lvm is out-putting text to STDERR on success!')
- _debug_c(command, process.returncode, (stdout_text, stderr_text))
-
return process.returncode, stdout_text, stderr_text
# The actual method which gets called to invoke the lvm command, can vary
7 years, 6 months
master - lvmdbusd: Disable lvm abort on too much log output
by tasleson
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2830f722882d06...
Commit: 2830f722882d064a6ffbe143f5a580364bcba2e6
Parent: fe437a6e7d9367eecd977d2504db82469016c780
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Tue Oct 11 09:36:47 2016 -0500
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Oct 11 13:16:57 2016 -0500
lvmdbusd: Disable lvm abort on too much log output
The commit:
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=34c55d98eefd88f8547...
introduced an abort if lvm logs too much. In the case of utilizing
lvm shell this is a pretty normal occurance, so we will disable
when we use lvm shell.
---
daemons/lvmdbusd/lvm_shell_proxy.py | 4 ++++
test/api/dbustest.sh | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/daemons/lvmdbusd/lvm_shell_proxy.py b/daemons/lvmdbusd/lvm_shell_proxy.py
index 6e6d52a..9edf336 100755
--- a/daemons/lvmdbusd/lvm_shell_proxy.py
+++ b/daemons/lvmdbusd/lvm_shell_proxy.py
@@ -121,6 +121,10 @@ class LVMShellProxy(object):
local_env["LVM_REPORT_FD"] = "32"
local_env["LVM_COMMAND_PROFILE"] = "lvmdbusd"
+ # Disable the abort logic if lvm logs too much, which easily happens
+ # when utilizing the lvm shell.
+ local_env["LVM_LOG_FILE_MAX_LINES"] = "0"
+
flags = fcntl(self.report_r, F_GETFL)
fcntl(self.report_r, F_SETFL, flags | os.O_NONBLOCK)
diff --git a/test/api/dbustest.sh b/test/api/dbustest.sh
index 16dc186..5ffe967 100644
--- a/test/api/dbustest.sh
+++ b/test/api/dbustest.sh
@@ -29,8 +29,4 @@ export LVM_BINARY=$TESTOLDPWD/../tools/lvm
aux prepare_lvmdbusd
-# Lets limit testing until the lvm SIGABRT is fixed as
-# we are running into that when using the lvm shell
-export LVM_DBUS_TEST_SHELL=0
-
$test_data_dir/dbus/lvmdbustest.py -v
7 years, 6 months