summaryrefslogtreecommitdiff
path: root/tools/vgcfgrestore.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-11-26 23:45:35 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2012-11-27 14:08:24 +0100
commit09b7ceea95edb2b54074cbd5d3b2009b5bf1dd4e (patch)
tree1c5885fe13af87c3080981a011830714faeade8b /tools/vgcfgrestore.c
parentc7a7fd0a12d0daef70e3c4517ccdef6830c7a34e (diff)
downloadlvm2-09b7ceea95edb2b54074cbd5d3b2009b5bf1dd4e.tar.gz
thin: allow restore with --force
Allow restoring metadata with thin pool volumes. No validation is done for this case within vgcfgrestore tool - thus incorrect metadata may lead to destruction of pool content.
Diffstat (limited to 'tools/vgcfgrestore.c')
-rw-r--r--tools/vgcfgrestore.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index d62df99f7..20ca16b35 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -62,8 +62,9 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv)
if (!(arg_count(cmd, file_ARG) ?
backup_restore_from_file(cmd, vg_name,
- arg_str_value(cmd, file_ARG, "")) :
- backup_restore(cmd, vg_name))) {
+ arg_str_value(cmd, file_ARG, ""),
+ arg_count(cmd, force_long_ARG)) :
+ backup_restore(cmd, vg_name, arg_count(cmd, force_long_ARG)))) {
unlock_vg(cmd, VG_ORPHANS);
unlock_vg(cmd, vg_name);
log_error("Restore failed.");