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-06 14:55:24 -0600
commitb49a93a1187e0dba1618b562948c0ede1f81d0af (patch)
treeaa8927d1767762e364c238b6f8a255f55f6db1e7
parent977a841f0759d1b83d32dbf8a42c510aea290974 (diff)
downloadlvm2-b49a93a1187e0dba1618b562948c0ede1f81d0af.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 444c49511..0026ae826 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;