Signed-off-by: s09816 <shi.lu@h3c.com>
return r;
} else if (is_protected == true) {
pc.fail();
- cerr << "\r" <<snaps[i].name.c_str()<< " is a protected snap."<< std::endl;
+ cerr << "\r" << "rbd: snapshot '" <<snaps[i].name.c_str()<< "' is protected from removal." << std::endl;
return -EBUSY;
}
}
case OPT_SNAP_PURGE:
r = do_purge_snaps(image);
if (r < 0) {
- cerr << "rbd: removing snaps failed: " << cpp_strerror(-r) << std::endl;
+ if (r != -EBUSY) {
+ cerr << "rbd: removing snaps failed: " << cpp_strerror(-r) << std::endl;
+ }
return -r;
}
break;