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-10 11:07:41 -0600
commitd48dd64e35468097e2db5ebda879cab386143992 (patch)
tree511fd8d78a8ff2001a776b24e9f7c0e6f083432d
parenteee727883b3f813872808bb108b4ddc442cdb65f (diff)
downloadlvm2-d48dd64e35468097e2db5ebda879cab386143992.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 eb9025f71..817faed0a 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;