From 9a2e5badb67b42c95eb61374f2ac1ad2e50bf7bb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 11 Feb 2010 09:25:59 -0800 Subject: [PATCH] mon: print caps to debug log --- src/mon/MonCaps.cc | 1 + src/mon/MonCaps.h | 2 ++ src/mon/Monitor.cc | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/mon/MonCaps.cc b/src/mon/MonCaps.cc index ae677a5be3217..3a4a6d3af02aa 100644 --- a/src/mon/MonCaps.cc +++ b/src/mon/MonCaps.cc @@ -87,6 +87,7 @@ bool MonCaps::parse(bufferlist::iterator& iter) try { ::decode(s, iter); + text = s; generic_dout(0) << "decoded caps: " << s << dendl; diff --git a/src/mon/MonCaps.h b/src/mon/MonCaps.h index 8fbc6a9fe6c49..7d8d18ae872af 100644 --- a/src/mon/MonCaps.h +++ b/src/mon/MonCaps.h @@ -34,6 +34,7 @@ struct MonServiceCap { }; class MonCaps { + string text; rwx_t default_action; map services_map; bool get_next_token(string s, size_t& pos, string& token); @@ -42,6 +43,7 @@ class MonCaps { bool allow_all; public: MonCaps() : default_action(0), allow_all(false) {} + const string& get_str() { return text; } bool parse(bufferlist::iterator& iter); rwx_t get_caps(int service); void set_allow_all(bool allow) { allow_all = allow; } diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 7d62d4b87384b..79009a591e4e6 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -537,6 +537,10 @@ bool Monitor::ms_dispatch(Message *m) } } src_is_mon = !connection || (connection->get_peer_type() & CEPH_ENTITY_TYPE_MON); + + if (s) + dout(20) << " caps " << s->caps.get_str() << dendl; + #define ALLOW_CAPS(service_id, allow_caps) \ do { \ if (src_is_mon) \ -- 2.39.5