MockBootstrapRequest *create_request(MockThreads* mock_threads,
MockInstanceWatcher *mock_instance_watcher,
- const std::string &remote_image_id,
const std::string &global_image_id,
const std::string &local_mirror_uuid,
Context *on_finish) {
m_local_io_ctx,
m_remote_io_ctx,
mock_instance_watcher,
- remote_image_id,
global_image_id,
local_mirror_uuid,
nullptr, nullptr,
&m_local_test_image_ctx,
&m_local_image_id,
+ &m_remote_image_id,
&m_remote_mirror_uuid,
&m_mock_remote_journaler,
&m_do_resync, on_finish);
librbd::MockTestImageCtx *m_local_test_image_ctx = nullptr;
std::string m_local_image_id;
+ std::string m_remote_image_id;
std::string m_remote_mirror_uuid;
::journal::MockJournaler *m_mock_remote_journaler = nullptr;
bool m_do_resync = false;
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(0, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(0, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(-EREMOTEIO, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(0, ctx.wait());
ASSERT_TRUE(m_do_resync);
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(0, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(0, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(-EINVAL, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->cancel();
request->send();
ASSERT_EQ(-ECANCELED, ctx.wait());
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(-EREMOTEIO, ctx.wait());
}
MockThreads mock_threads(m_threads);
MockInstanceWatcher mock_instance_watcher;
MockBootstrapRequest *request = create_request(
- &mock_threads, &mock_instance_watcher, mock_remote_image_ctx.id,
- "global image id", "local mirror uuid", &ctx);
+ &mock_threads, &mock_instance_watcher, "global image id",
+ "local mirror uuid", &ctx);
request->send();
ASSERT_EQ(0, ctx.wait());
}
librados::IoCtx& local_io_ctx,
librados::IoCtx& remote_io_ctx,
InstanceWatcher<I>* instance_watcher,
- const std::string& remote_image_id,
const std::string& global_image_id,
const std::string& local_mirror_uuid,
::journal::CacheManagerHandler* cache_manager_handler,
ProgressContext* progress_ctx,
I** local_image_ctx,
std::string* local_image_id,
+ std::string* remote_image_id,
std::string* remote_mirror_uuid,
Journaler** remote_journaler,
bool* do_resync,
m_local_io_ctx(local_io_ctx),
m_remote_io_ctx(remote_io_ctx),
m_instance_watcher(instance_watcher),
- m_remote_image_id(remote_image_id),
m_global_image_id(global_image_id),
m_local_mirror_uuid(local_mirror_uuid),
m_cache_manager_handler(cache_manager_handler),
m_progress_ctx(progress_ctx),
m_local_image_ctx(local_image_ctx),
m_local_image_id(local_image_id),
+ m_remote_image_id(remote_image_id),
m_remote_mirror_uuid(remote_mirror_uuid),
m_remote_journaler(remote_journaler),
m_do_resync(do_resync),
auto req = image_replayer::PrepareRemoteImageRequest<I>::create(
m_threads, m_remote_io_ctx, m_global_image_id, m_local_mirror_uuid,
*m_local_image_id, journal_settings, m_cache_manager_handler,
- m_remote_mirror_uuid, &m_remote_image_id, m_remote_journaler,
+ m_remote_mirror_uuid, m_remote_image_id, m_remote_journaler,
&m_client_state, &m_client_meta, ctx);
req->send();
}
dout(10) << "remote image does not exist" << dendl;
// TODO need to support multiple remote images
- if (m_remote_image_id.empty() && !m_local_image_id->empty() &&
+ if (m_remote_image_id->empty() && !m_local_image_id->empty() &&
m_local_image_tag_owner == *m_remote_mirror_uuid) {
// local image exists and is non-primary and linked to the missing
// remote image
template <typename I>
void BootstrapRequest<I>::open_remote_image() {
- dout(15) << "remote_image_id=" << m_remote_image_id << dendl;
+ dout(15) << "remote_image_id=" << *m_remote_image_id << dendl;
update_progress("OPEN_REMOTE_IMAGE");
BootstrapRequest<I>, &BootstrapRequest<I>::handle_open_remote_image>(
this);
OpenImageRequest<I> *request = OpenImageRequest<I>::create(
- m_remote_io_ctx, &m_remote_image_ctx, m_remote_image_id, false,
+ m_remote_io_ctx, &m_remote_image_ctx, *m_remote_image_id, false,
ctx);
request->send();
}
librados::IoCtx& local_io_ctx,
librados::IoCtx& remote_io_ctx,
InstanceWatcher<ImageCtxT>* instance_watcher,
- const std::string& remote_image_id,
const std::string& global_image_id,
const std::string& local_mirror_uuid,
::journal::CacheManagerHandler* cache_manager_handler,
ProgressContext* progress_ctx,
ImageCtxT** local_image_ctx,
std::string* local_image_id,
+ std::string* remote_image_id,
std::string* remote_mirror_uuid,
Journaler** remote_journaler,
bool* do_resync,
Context* on_finish) {
return new BootstrapRequest(
- threads, local_io_ctx, remote_io_ctx, instance_watcher, remote_image_id,
- global_image_id, local_mirror_uuid, cache_manager_handler, progress_ctx,
- local_image_ctx, local_image_id, remote_mirror_uuid, remote_journaler,
+ threads, local_io_ctx, remote_io_ctx, instance_watcher, global_image_id,
+ local_mirror_uuid, cache_manager_handler, progress_ctx, local_image_ctx,
+ local_image_id, remote_image_id, remote_mirror_uuid, remote_journaler,
do_resync, on_finish);
}
librados::IoCtx& local_io_ctx,
librados::IoCtx& remote_io_ctx,
InstanceWatcher<ImageCtxT>* instance_watcher,
- const std::string& remote_image_id,
const std::string& global_image_id,
const std::string& local_mirror_uuid,
::journal::CacheManagerHandler* cache_manager_handler,
ProgressContext* progress_ctx,
ImageCtxT** local_image_ctx,
std::string* local_image_id,
+ std::string* remote_image_id,
std::string* remote_mirror_uuid,
Journaler** remote_journaler,
bool* do_resync,
librados::IoCtx &m_local_io_ctx;
librados::IoCtx &m_remote_io_ctx;
InstanceWatcher<ImageCtxT> *m_instance_watcher;
- std::string m_remote_image_id;
std::string m_global_image_id;
std::string m_local_mirror_uuid;
::journal::CacheManagerHandler *m_cache_manager_handler;
ProgressContext *m_progress_ctx;
ImageCtxT **m_local_image_ctx;
std::string* m_local_image_id;
+ std::string* m_remote_image_id;
std::string* m_remote_mirror_uuid;
Journaler** m_remote_journaler;
bool *m_do_resync;