summaryrefslogtreecommitdiffstats
path: root/tools/lvm.c
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2002-02-01 17:54:39 +0000
committerAlasdair Kergon <agk@redhat.com>2002-02-01 17:54:39 +0000
commit812c699c8d7fb0c0c57abeba1d39b21bfd0d9917 (patch)
tree6a0169790a821701cf4887a16a1b57ad17d3d319 /tools/lvm.c
parentdcde8bf026fef9ee22b966971ac490a8cde85182 (diff)
downloadlvm2-812c699c8d7fb0c0c57abeba1d39b21bfd0d9917.tar.gz
lvm2-812c699c8d7fb0c0c57abeba1d39b21bfd0d9917.tar.xz
lvm2-812c699c8d7fb0c0c57abeba1d39b21bfd0d9917.zip
Basic support for persistent minor numbers;
slightly different from the current LVM1 method. lvcreate --persistent y --minor 10 (to specify when created) lvchange --persistent n (to turn off) lvchange --persistent y --minor 11 (to change) --persistent uses a new LV status flag stored on disk minor number is stored on disk the same way as LVM1 does (but major number stored is 0; any LVM1 major/minor setting gets lost) lvchange -ay --minor 12 (to activate using minor 12, regardless of the on-disk setting, which doesn't get changed) --minor == -m --persistent == -M
Diffstat (limited to 'tools/lvm.c')
-rw-r--r--tools/lvm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/lvm.c b/tools/lvm.c
index 9adc26c2..3d84cab3 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -294,6 +294,21 @@ int int_arg_with_sign(struct arg *a)
return 1;
}
+int minor_arg(struct arg *a)
+{
+ char *ptr;
+
+ if (!_get_int_arg(a, &ptr) || (*ptr) || (a->sign == SIGN_MINUS))
+ return 0;
+
+ if (a->i_value > 255) {
+ log_error("Minor number outside range 0-255");
+ return 0;
+ }
+
+ return 1;
+}
+
int string_arg(struct arg *a)
{
return 1;