[thin tools] Change the metadata contructors to take a block_manager<>::ptr

Also check any metadata snap passed in matches what's in the superblock.
This commit is contained in:
Joe Thornber
2015-12-14 15:29:57 +00:00
parent 2b12854ecd
commit 30a3bf67d1
6 changed files with 46 additions and 93 deletions

View File

@@ -45,7 +45,8 @@ namespace {
int restore(string const &backup_file, string const &dev, bool quiet) {
try {
// The block size gets updated by the restorer.
metadata::ptr md(new metadata(dev, metadata::CREATE, 128, 0));
block_manager<>::ptr bm(open_bm(dev, block_manager<>::READ_WRITE));
metadata::ptr md(new metadata(bm, metadata::CREATE, 128, 0));
emitter::ptr restorer = create_restore_emitter(md);
parse_xml(backup_file, restorer, quiet);