Skip to content

Commit

Permalink
Merge pull request #13957 from wangzhengyong/import
Browse files Browse the repository at this point in the history
rbd: error out if import image format failed

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
  • Loading branch information
Jason Dillaman committed Apr 6, 2017
2 parents d271e8c + cc0f1d0 commit 184df4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/tools/rbd/action/Import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,11 @@ static int do_import(librbd::RBD &rbd, librados::IoCtx& io_ctx,
} else {
r = do_import_v2(fd, image, size, imgblklen, pc, sparse_size);
}
if (r < 0) {
std::cerr << "rbd: failed to import image" << std::endl;
image.close();
goto err;
}

r = image.close();
err:
Expand Down

0 comments on commit 184df4a

Please sign in to comment.