goto done;
dout(2) << " from snap " << from << dendl;
- if (!image.snap_exists(from.c_str())) {
+ bool exists;
+ r = image.snap_exists2(from.c_str(), &exists);
+ if (r < 0)
+ goto done;
+
+ if (!exists) {
std::cerr << "start snapshot '" << from
<< "' does not exist in the image, aborting" << std::endl;
r = -EINVAL;
dout(2) << " to snap " << to << dendl;
// verify this snap isn't already present
- if (image.snap_exists(to.c_str())) {
+ bool exists;
+ r = image.snap_exists2(to.c_str(), &exists);
+ if (r < 0)
+ goto done;
+
+ if (exists) {
std::cerr << "end snapshot '" << to
<< "' already exists, aborting" << std::endl;
r = -EEXIST;