summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2002-07-10 20:43:32 +0000
committerAlasdair Kergon <agk@redhat.com>2002-07-10 20:43:32 +0000
commit48ad31920d29482d66afbfb4a3cc8761fe06abd4 (patch)
tree60d671a14eae4a6c6facd2ec31b98cdf5a433851 /tools
parent0dbd22124b0a8c3f48aa0a0a9e1bf43281f4ead0 (diff)
downloadlvm2-48ad31920d29482d66afbfb4a3cc8761fe06abd4.tar.gz
lvm2-48ad31920d29482d66afbfb4a3cc8761fe06abd4.tar.xz
lvm2-48ad31920d29482d66afbfb4a3cc8761fe06abd4.zip
Add --ignorelockingfailure
Diffstat (limited to 'tools')
-rw-r--r--tools/args.h1
-rw-r--r--tools/commands.h21
-rw-r--r--tools/lvchange.c7
-rw-r--r--tools/lvm.c5
-rw-r--r--tools/vgchange.c6
5 files changed, 31 insertions, 9 deletions
diff --git a/tools/args.h b/tools/args.h
index b2eda99c..ecfb1d12 100644
--- a/tools/args.h
+++ b/tools/args.h
@@ -11,6 +11,7 @@
arg(version_ARG, '\0', "version", NULL)
arg(quiet_ARG, '\0', "quiet", NULL)
arg(physicalvolumesize_ARG, '\0', "setphysicalvolumesize", size_arg)
+arg(ignorelockingfailure_ARG, '\0', "ignorelockingfailure", NULL)
/* Allow some variations */
arg(resizable_ARG, '\0', "resizable", yes_no_arg)
diff --git a/tools/commands.h b/tools/commands.h
index 036acd16..bac06929 100644
--- a/tools/commands.h
+++ b/tools/commands.h
@@ -63,7 +63,8 @@ xx(lvchange,
autobackup_ARG, available_ARG, contiguous_ARG,
minor_ARG, persistent_ARG, partial_ARG,
- permission_ARG, readahead_ARG, test_ARG)
+ permission_ARG, readahead_ARG, test_ARG,
+ ignorelockingfailure_ARG)
xx(lvcreate,
"Create a logical volume",
@@ -103,7 +104,7 @@ xx(lvdisplay,
"\t[-v/--verbose]\n"
"\tLogicalVolume[Path] [LogicalVolume[Path]...]\n",
- colon_ARG, disk_ARG, maps_ARG, partial_ARG)
+ colon_ARG, disk_ARG, maps_ARG, partial_ARG, ignorelockingfailure_ARG)
xx(lvextend,
"Add space to a logical volume",
@@ -230,7 +231,7 @@ xx(lvscan,
"\t[-v|--verbose] " "\n"
"\t[--version]\n",
- blockdevice_ARG, disk_ARG, partial_ARG)
+ blockdevice_ARG, disk_ARG, partial_ARG, ignorelockingfailure_ARG);
xx(pvchange,
"Change attributes of physical volume(s)",
@@ -291,7 +292,7 @@ xx(pvdisplay,
"\t[-v/--verbose]\n"
"\tPhysicalVolumePath [PhysicalVolumePath...]\n",
- colon_ARG, maps_ARG, short_ARG)
+ colon_ARG, maps_ARG, short_ARG, ignorelockingfailure_ARG)
xx(pvmove,
"Move extents from one physical volume to another",
@@ -334,7 +335,8 @@ xx(pvscan,
"\t[-v|--verbose] " "\n"
"\t[--version]\n",
- exported_ARG, novolumegroup_ARG, partial_ARG, short_ARG, uuid_ARG)
+ exported_ARG, novolumegroup_ARG, partial_ARG, short_ARG, uuid_ARG,
+ ignorelockingfailure_ARG)
xx(vgcfgbackup,
"Backup volume group configuration(s)",
@@ -345,7 +347,7 @@ xx(vgcfgbackup,
"\t[-v|--verbose]" "\n"
"\t[-V|--version] " "\n"
"\t[VolumeGroupName...]\n",
- file_ARG)
+ file_ARG, partial_ARG, ignorelockingfailure_ARG)
xx(vgcfgrestore,
"Restore volume group configuration",
@@ -379,7 +381,7 @@ xx(vgchange,
autobackup_ARG, available_ARG, logicalvolume_ARG, partial_ARG,
resizeable_ARG, resizable_ARG, allocation_ARG,
- test_ARG)
+ test_ARG, ignorelockingfailure_ARG)
xx(vgck,
"Check the consistency of volume group(s)",
@@ -418,7 +420,8 @@ xx(vgdisplay,
"\t[--version]" "\n"
"\t[VolumeGroupName...] ]\n",
- activevolumegroups_ARG, colon_ARG, disk_ARG, short_ARG, partial_ARG)
+ activevolumegroups_ARG, colon_ARG, disk_ARG, short_ARG, partial_ARG,
+ ignorelockingfailure_ARG)
xx(vgexport,
"Unregister volume group(s) from the system",
@@ -524,7 +527,7 @@ xx(vgscan,
"\t[-h/-?/--help]\n"
"\t[-P/--partial] " "\n"
"\t[-v/--verbose]\n" ,
- partial_ARG)
+ partial_ARG, ignorelockingfailure_ARG)
xx(vgsplit,
"Move physical volumes into a new volume group",
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 6e6942e5..8f9b50ca 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -41,6 +41,13 @@ int lvchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if (arg_count(cmd, ignorelockingfailure_ARG) &&
+ (arg_count(cmd, contiguous_ARG) || arg_count(cmd, permission_ARG) ||
+ arg_count(cmd, readahead_ARG) || arg_count(cmd, persistent_ARG))) {
+ log_error("Only -a permitted with --ignorelockingfailure");
+ return EINVALID_CMD_LINE;
+ }
+
if (!argc) {
log_error("Please give logical volume path(s)");
return EINVALID_CMD_LINE;
diff --git a/tools/lvm.c b/tools/lvm.c
index f6434a1a..366b906b 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -640,6 +640,11 @@ static int process_common_commands(struct command *com)
} else
init_partial(0);
+ if (arg_count(cmd, ignorelockingfailure_ARG))
+ init_ignorelockingfailure(1);
+ else
+ init_ignorelockingfailure(0);
+
/* Handle synonyms */
if (!merge_synonym(resizable_ARG, resizeable_ARG) ||
!merge_synonym(allocation_ARG, allocatable_ARG) ||
diff --git a/tools/vgchange.c b/tools/vgchange.c
index 87424f06..9deeb453 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -63,6 +63,12 @@ int vgchange(struct cmd_context *cmd, int argc, char **argv)
return EINVALID_CMD_LINE;
}
+ if (arg_count(cmd, ignorelockingfailure_ARG) &&
+ !arg_count(cmd, available_ARG)) {
+ log_error("--ignorelockingfailure only available with -a");
+ return EINVALID_CMD_LINE;
+ }
+
if (arg_count(cmd, available_ARG) == 1
&& arg_count(cmd, autobackup_ARG)) {
log_error("-A option not necessary with -a option");