]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: add a MGR flag to mon commands
authorSage Weil <sage@redhat.com>
Thu, 23 Feb 2017 22:19:30 +0000 (17:19 -0500)
committerSage Weil <sage@redhat.com>
Wed, 29 Mar 2017 15:38:31 +0000 (11:38 -0400)
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 <sage@redhat.com>
src/mon/MonCommands.h
src/mon/Monitor.h

index af44384c900fc101f0eeba29a11dcaacf1d2242b..ec643d3374dbcf5c3a2b6d024f968bfb27797bd5 100644 (file)
  *  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
index 96d8f2582f39030b937aad19a678020cbd9794c1..140117e100140be77de550b731ddaa5a567f9b6a 100644 (file)
@@ -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;