Skip to content

Commit 789df2c

Browse files
committed
librbd/migration: massage some error messages
Add missing spaces, don't use the word stream when reporting errors on POSIX file operations (open() and lseek64()) and fix a cut-and-paste typo in RawSnapshot. Signed-off-by: Ilya Dryomov <[email protected]>
1 parent b92ad49 commit 789df2c

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/librbd/migration/FileStream.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct FileStream<I>::ReadRequest {
7474
auto offset = lseek64(file_stream->m_file_no, byte_extent.first, SEEK_SET);
7575
if (offset == -1) {
7676
r = -errno;
77-
lderr(cct) << "failed to seek file stream: " << cpp_strerror(r) << dendl;
77+
lderr(cct) << "failed to seek file: " << cpp_strerror(r) << dendl;
7878
finish(r);
7979
return;
8080
}
@@ -149,7 +149,7 @@ void FileStream<I>::open(Context* on_finish) {
149149
m_file_no = ::open(file_path.c_str(), O_RDONLY);
150150
if (m_file_no < 0) {
151151
int r = -errno;
152-
lderr(m_cct) << "failed to open file stream '" << file_path << "': "
152+
lderr(m_cct) << "failed to open file '" << file_path << "': "
153153
<< cpp_strerror(r) << dendl;
154154
on_finish->complete(r);
155155
return;

src/librbd/migration/HttpClient.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ class HttpClient<I>::HttpSession : public HttpSessionInterface {
283283
ldout(cct, 15) << "r=" << r << dendl;
284284

285285
if (r < 0) {
286-
lderr(cct) << "failed to disconnect stream: '" << cpp_strerror(r)
286+
lderr(cct) << "failed to disconnect stream: " << cpp_strerror(r)
287287
<< dendl;
288288
}
289289

@@ -350,7 +350,7 @@ class HttpClient<I>::HttpSession : public HttpSessionInterface {
350350
ldout(cct, 15) << "r=" << r << dendl;
351351

352352
if (r < 0) {
353-
lderr(cct) << "failed to disconnect stream: '" << cpp_strerror(r)
353+
lderr(cct) << "failed to disconnect stream: " << cpp_strerror(r)
354354
<< dendl;
355355
}
356356

src/librbd/migration/OpenSourceImageRequest.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ void OpenSourceImageRequest<I>::open_source() {
7272
int r = source_spec_builder.parse_source_spec(source_spec,
7373
&source_spec_object);
7474
if (r < 0) {
75-
lderr(m_cct) << "failed to parse migration source-spec:" << cpp_strerror(r)
76-
<< dendl;
75+
lderr(m_cct) << "failed to parse migration source-spec: "
76+
<< cpp_strerror(r) << dendl;
7777
(*m_src_image_ctx)->state->close();
7878
finish(r);
7979
return;

src/librbd/migration/QCOWFormat.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -844,8 +844,8 @@ void QCOWFormat<I>::open(Context* on_finish) {
844844

845845
int r = m_source_spec_builder->build_stream(m_json_object, &m_stream);
846846
if (r < 0) {
847-
lderr(cct) << "failed to build migration stream handler" << cpp_strerror(r)
848-
<< dendl;
847+
lderr(cct) << "failed to build migration stream handler: "
848+
<< cpp_strerror(r) << dendl;
849849
on_finish->complete(r);
850850
return;
851851
}

src/librbd/migration/RawSnapshot.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ void RawSnapshot<I>::open(SnapshotInterface* previous_snapshot,
153153

154154
int r = m_source_spec_builder->build_stream(m_json_object, &m_stream);
155155
if (r < 0) {
156-
lderr(cct) << "failed to build migration stream handler" << cpp_strerror(r)
157-
<< dendl;
156+
lderr(cct) << "failed to build migration stream handler: "
157+
<< cpp_strerror(r) << dendl;
158158
on_finish->complete(r);
159159
return;
160160
}

src/librbd/migration/SourceSpecBuilder.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ int SourceSpecBuilder<I>::build_snapshot(
9696
snapshot->reset(RawSnapshot<I>::create(m_image_ctx, source_spec_object,
9797
this, index));
9898
} else {
99-
lderr(cct) << "unknown or unsupported format type '" << type << "'"
99+
lderr(cct) << "unknown or unsupported snapshot type '" << type << "'"
100100
<< dendl;
101101
return -ENOSYS;
102102
}

0 commit comments

Comments
 (0)