summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2017-02-06 11:51:06 -0600
committerDavid Teigland <teigland@redhat.com>2017-02-13 08:20:10 -0600
commit2224b6a70158a820de2a9f1fd961a36b0188da51 (patch)
tree51abaafce08cd9d609e661e7ec7646dd53fe0490
parentc3faa5816d223b0a77a248aed9a88e73461268ce (diff)
downloadlvm2-2224b6a70158a820de2a9f1fd961a36b0188da51.tar.gz
commands: recognize raid variations
-rw-r--r--tools/lv_types.h2
-rw-r--r--tools/toollib.c16
2 files changed, 7 insertions, 11 deletions
diff --git a/tools/lv_types.h b/tools/lv_types.h
index 22d05225c..bd4666ed4 100644
--- a/tools/lv_types.h
+++ b/tools/lv_types.h
@@ -21,7 +21,7 @@ lvt(thinpool_LVT, "thinpool", NULL)
lvt(cache_LVT, "cache", NULL)
lvt(cachepool_LVT, "cachepool", NULL)
lvt(mirror_LVT, "mirror", NULL)
-lvt(raid_LVT, "raid", NULL)
+lvt(raid_LVT, "raid", NULL) /* any raid type */
lvt(raid0_LVT, "raid0", NULL)
lvt(raid1_LVT, "raid1", NULL)
lvt(raid4_LVT, "raid4", NULL)
diff --git a/tools/toollib.c b/tools/toollib.c
index 3b479894b..a539878c8 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2515,17 +2515,15 @@ static int _lv_is_type(struct cmd_context *cmd, struct logical_volume *lv, int l
case raid_LVT:
return lv_is_raid(lv);
case raid0_LVT:
- return seg_is_raid0(seg);
+ return seg_is_any_raid0(seg);
case raid1_LVT:
return seg_is_raid1(seg);
case raid4_LVT:
return seg_is_raid4(seg);
-#if 0
case raid5_LVT:
- return seg_is_raid5(seg);
+ return seg_is_any_raid5(seg);
case raid6_LVT:
- return seg_is_raid6(seg);
-#endif
+ return seg_is_any_raid6(seg);
case raid10_LVT:
return seg_is_raid10(seg);
case error_LVT:
@@ -2566,18 +2564,16 @@ int get_lvt_enum(struct logical_volume *lv)
return mirror_LVT;
if (lv_is_raid(lv))
return raid_LVT;
- if (seg_is_raid0(seg))
+ if (seg_is_any_raid0(seg))
return raid0_LVT;
if (seg_is_raid1(seg))
return raid1_LVT;
if (seg_is_raid4(seg))
return raid4_LVT;
-#if 0
- if (seg_is_raid5(seg))
+ if (seg_is_any_raid5(seg))
return raid5_LVT;
- if (seg_is_raid6(seg))
+ if (seg_is_any_raid6(seg))
return raid6_LVT;
-#endif
if (seg_is_raid10(seg))
return raid10_LVT;