New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librbd: retrieve image name when opening by id #7736
Conversation
@trociny Should we just fix the issue that name isn't populated when opening by ID? We can add a new state to the image::RefreshRequest state machine to invoke the |
Ok, will try this way. Thanks. |
222b707
to
cb9cc45
Compare
@dillaman I have made the name to be populated when opening by ID. Unfortunately it does not help for the initial issue, because asok is created earlier, on ImageCtx creation, before open. Do you know any hook I could use to create/delete asok on image open/close, instead of on image context construction/deletion? |
@dillaman The same issue (empty name) is for perf name, which is initialized in ImageCtx::init(). |
Actually, image::OpenRequest is probably a better state machine since we only need to load the name once. ImageCtx::init should be invoked near the end of the refresh state machine, so as long as you load the name before you start the refresh, that should work. As for the ASOK, can't we just delay it until ImageCtx::init? |
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
cb9cc45
to
b0ca9bb
Compare
@dillaman rebased after applying your suggestions. |
|
||
if (*result == 0) { | ||
bufferlist::iterator it = m_out_bl.begin(); | ||
cls_client::dir_get_name_finish(&it, &m_image_ctx->name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*result = cls_client::dir_get_name_finish ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed.
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
b0ca9bb
to
5360d86
Compare
librbd: retrieve image name when opening by id Reviewed-by: Jason Dillaman <dillaman@redhat.com>
name is empty when the image is opened by its id.
Signed-off-by: Mykola Golub mgolub@mirantis.com