Merge pull request #5537 from s09816/master

rbd:modify the log of purging snaps so that it is more appropriate

Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Josh Durgin 2015-08-14 14:03:56 -07:00
commit ee909dcc7c

View File

@ -787,7 +787,7 @@ static int do_purge_snaps(librbd::Image& image)
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;
}
}
@ -3847,7 +3847,9 @@ if (!set_conf_param(v, p1, p2, p3)) { \
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;