[thin_ll_restore] check preallocation of output file
This commit is contained in:
parent
6863db6f86
commit
45dbc2593a
@ -14,6 +14,7 @@
|
|||||||
// with thin-provisioning-tools. If not, see
|
// with thin-provisioning-tools. If not, see
|
||||||
// <http://www.gnu.org/licenses/>.
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#include "base/output_file_requirements.h"
|
||||||
#include "base/xml_utils.h"
|
#include "base/xml_utils.h"
|
||||||
#include "metadata_dumper.h"
|
#include "metadata_dumper.h"
|
||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
@ -261,12 +262,25 @@ thin_ll_restore_cmd::run(int argc, char **argv) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!input_metadata.length() || !input.length() || !output.length()) {
|
if (!input.length()) {
|
||||||
cerr << "No input/output file provided." << endl;
|
cerr << "No input file provided." << endl;
|
||||||
usage(cerr);
|
usage(cerr);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!input_metadata.length()) {
|
||||||
|
cerr << "No input metadata provided." << endl;
|
||||||
|
usage(cerr);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!output.length()) {
|
||||||
|
cerr << "No output file provided." << endl;
|
||||||
|
usage(cerr);
|
||||||
|
return 1;
|
||||||
|
} else
|
||||||
|
check_output_file_requirements(output);
|
||||||
|
|
||||||
return low_level_restore(input_metadata, input, output, f);
|
return low_level_restore(input_metadata, input, output, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user