From: Sage Weil Date: Thu, 23 Feb 2017 22:19:30 +0000 (-0500) Subject: mon: add a MGR flag to mon commands X-Git-Tag: v12.0.2~252^2~73 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7e3cfef4d7537e7222de7d5f7bc27b3dcea6bb45;p=ceph.git mon: add a MGR flag to mon commands The flag will indicate that a command should be sent to ceph-mgr instead of ceph-mon (rados_mgr_command instead of rados_mon_command). For legacy clients, we'll have to make the mon forward the message on behalf of the client. Signed-off-by: Sage Weil --- diff --git a/src/mon/MonCommands.h b/src/mon/MonCommands.h index af44384c900f..ec643d3374db 100644 --- a/src/mon/MonCommands.h +++ b/src/mon/MonCommands.h @@ -111,6 +111,7 @@ * NOFORWARD - command may not be forwarded * OBSOLETE - command is considered obsolete * DEPRECATED - command is considered deprecated + * MGR - command goes to ceph-mgr (for luminous+) * * A command should always be first considered DEPRECATED before being * considered OBSOLETE, giving due consideration to users and conforming diff --git a/src/mon/Monitor.h b/src/mon/Monitor.h index 96d8f2582f39..140117e10014 100644 --- a/src/mon/Monitor.h +++ b/src/mon/Monitor.h @@ -981,7 +981,8 @@ struct MonCommand { static const uint64_t FLAG_NOFORWARD = 1 << 0; static const uint64_t FLAG_OBSOLETE = 1 << 1; static const uint64_t FLAG_DEPRECATED = 1 << 2; - + static const uint64_t FLAG_MGR = 1 << 3; + bool has_flag(uint64_t flag) const { return (flags & flag) != 0; } void set_flag(uint64_t flag) { flags |= flag; } void unset_flag(uint64_t flag) { flags &= ~flag; } @@ -1023,6 +1024,10 @@ struct MonCommand { return has_flag(MonCommand::FLAG_DEPRECATED); } + bool is_mgr() const { + return has_flag(MonCommand::FLAG_MGR); + } + static void encode_array(const MonCommand *cmds, int size, bufferlist &bl) { ENCODE_START(2, 1, bl); uint16_t s = size;