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
rbd: output notifyOp request name when watching #20551
Conversation
src/librbd/WatchNotifyTypes.h
Outdated
@@ -339,6 +339,7 @@ struct NotifyMessage { | |||
void encode(bufferlist& bl) const; | |||
void decode(bufferlist::iterator& it); | |||
void dump(Formatter *f) const; | |||
NotifyOp getOp() const; |
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.
get_notify_op
src/librbd/WatchNotifyTypes.cc
Outdated
@@ -21,6 +21,14 @@ class CheckForRefreshVisitor : public boost::static_visitor<bool> { | |||
} | |||
}; | |||
|
|||
class GetNotifyOPVisitor : public boost::static_visitor<int> { |
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.
Nit: GetNotifyOpVisitor
src/librbd/WatchNotifyTypes.cc
Outdated
@@ -21,6 +21,14 @@ class CheckForRefreshVisitor : public boost::static_visitor<bool> { | |||
} | |||
}; | |||
|
|||
class GetNotifyOPVisitor : public boost::static_visitor<int> { |
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.
Nit: boost::static_visitor<NotifyOp>
src/librbd/WatchNotifyTypes.cc
Outdated
apply_visitor(GetNotifyOPVisitor(), payload); | ||
} | ||
|
||
|
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.
Nit: remove extra blank line
src/tools/rbd/action/Watch.cc
Outdated
bufferlist::iterator iter = bl.begin(); | ||
notify_message.decode(iter); | ||
} catch (const buffer::error &err) { | ||
std::cout << __func__ << " error decoding image notification: " |
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.
Nit: std::cerr << "rbd: failed to decode image notification" << std::endl;
src/tools/rbd/action/Watch.cc
Outdated
} catch (const buffer::error &err) { | ||
std::cout << __func__ << " error decoding image notification: " | ||
<< err.what() << std::endl; | ||
return; |
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.
... no need to return since it will default to unknown payload.
output notifyOp request name when watching, which is more easier to dentify what happend. Signed-off-by: shun-s <song.shun3@zte.com.cn>
911a22e
to
db58878
Compare
@dillaman all your requirements are done, please take a look again. |
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.
lgtm
output notifyOp request name when watching,
which is more easier to dentify what happend.
Signed-off-by: shun-s song.shun3@zte.com.cn