From d33f2e9f5a47ba6c5783a5b81c12e2621cd6e29a Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Tue, 15 Jan 2002 18:17:57 +0000 Subject: [PATCH] o Actually check in vgcfgrestore. --- tools/lvm.c | 3 ++- tools/vgcfgrestore.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tools/vgcfgrestore.c diff --git a/tools/lvm.c b/tools/lvm.c index d2364cbe5..8cebf2df9 100644 --- a/tools/lvm.c +++ b/tools/lvm.c @@ -1051,10 +1051,11 @@ static void fin(void) dbg_free(cmd); archive_exit(); backup_exit(); + _exit_uuid_map(); __fin_commands(); + dump_memory(); fin_log(); - _exit_uuid_map(); if (_log) fclose(_log); diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c new file mode 100644 index 000000000..0d8e2d5c6 --- /dev/null +++ b/tools/vgcfgrestore.c @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2001 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include "tools.h" + +#include + +int vgcfgrestore(int argc, char **argv) +{ + if (argc != 1) { + log_err("Please specify a *single* volume group to restore."); + return ECMD_FAILED; + } + + if (!(arg_count(file_ARG) ? + backup_restore_from_file(argv[0], arg_str_value(file_ARG, "")) : + backup_restore(argv[0]))) { + log_err("Restore failed."); + return ECMD_FAILED; + } + + return 0; +}