1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00
lvm2/tools/vgcfgrestore.c
Joe Thornber 03888774a5 o Added functions to display what's in the archive.
o  For now vgcfgrestore -l <vg> displays this list.

A bit hacky, but it'll get better.
2002-02-11 11:43:17 +00:00

38 lines
711 B
C

/*
* Copyright (C) 2001 Sistina Software (UK) Limited.
*
* This file is released under the GPL.
*/
#include "tools.h"
#include <stdio.h>
int vgcfgrestore(int argc, char **argv)
{
if (argc != 1) {
log_err("Please specify a *single* volume group to restore.");
return ECMD_FAILED;
}
/*
* FIXME: overloading the -l arg for now to display a
* list of archive files for a particular vg
*/
if (arg_count(list_ARG)) {
if (!archive_display(argv[0]))
return ECMD_FAILED;
return 0;
}
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;
}