summaryrefslogtreecommitdiffstats
path: root/src/test/librbd/image
diff options
context:
space:
mode:
authorJason Dillaman <dillaman@redhat.com>2020-04-22 17:57:45 +0200
committerJason Dillaman <dillaman@redhat.com>2020-04-23 19:19:49 +0200
commitea64ba5a6f2a73e3440244c0b358b948647670c5 (patch)
tree94bc3115291ea9eb942a9df8b91e5ae69c2a217b /src/test/librbd/image
parentlibrbd: pass clean_since_snap_id to CreatePrimaryRequest (diff)
downloadceph-ea64ba5a6f2a73e3440244c0b358b948647670c5.tar.xz
ceph-ea64ba5a6f2a73e3440244c0b358b948647670c5.zip
librbd: EnableRequest now accepts a boolean to indicate a clean image
If the image is clean, it's treated as if it was newly created and therefore clean since snapshot id 0. The CreateRequest and CloneRequest state machines pass true for this bool if mirroring is being enabled during creation. Signed-off-by: Jason Dillaman <dillaman@redhat.com>
Diffstat (limited to 'src/test/librbd/image')
-rw-r--r--src/test/librbd/image/test_mock_CloneRequest.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/librbd/image/test_mock_CloneRequest.cc b/src/test/librbd/image/test_mock_CloneRequest.cc
index 1d22702d0e9..4c118ec3544 100644
--- a/src/test/librbd/image/test_mock_CloneRequest.cc
+++ b/src/test/librbd/image/test_mock_CloneRequest.cc
@@ -189,8 +189,9 @@ struct EnableRequest<MockTestImageCtx> {
static EnableRequest* create(MockTestImageCtx* image_ctx,
cls::rbd::MirrorImageMode mode,
const std::string &non_primary_global_image_id,
- Context *on_finish) {
+ bool image_clean, Context *on_finish) {
ceph_assert(s_instance != nullptr);
+ EXPECT_TRUE(image_clean);
s_instance->on_finish = on_finish;
return s_instance;
}