Signed-off-by: Sage Weil <sage@inktank.com>
rbd rm foo || :
rbd snap purge foo.copy || :
rbd rm foo.copy || :
+ rbd snap purge foo.copy2 || :
+ rbd rm foo.copy2 || :
rm -f foo.diff foo.out
}
rbd import-diff foo.diff foo.copy && exit 1 || true # this should fail with EEXIST on the end snap
rbd snap ls foo.copy | grep three
+rbd create foo.copy2 --size 1000
+rbd import-diff foo.diff foo.copy2 && exit 1 || true # this should fail bc the start snap dne
+
rbd export foo foo.out
orig=`md5sum foo.out | awk '{print $1}'`
rm foo.out
if (r < 0)
goto done;
dout(2) << " from snap " << from << dendl;
+
+ if (!image.snap_exists(from.c_str())) {
+ cerr << "start snapshot '" << from << "' does not exist in the image, aborting" << std::endl;
+ r = -EINVAL;
+ goto done;
+ }
}
else if (tag == 't') {
r = read_string(fd, 4096, &to); // 4k limit to make sure we don't get a garbage string