]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #30821 from dillaman/wip-41972-nautilus
authorJason Dillaman <dillaman@redhat.com>
Thu, 7 Nov 2019 19:51:50 +0000 (14:51 -0500)
committerGitHub <noreply@github.com>
Thu, 7 Nov 2019 19:51:50 +0000 (14:51 -0500)
nautilus: rbd-mirror: simplify peer bootstrapping

Reviewed-by: Mykola Golub <mgolub@suse.com>
1  2 
src/include/rbd_types.h
src/librbd/librbd.cc
src/mon/MonCap.cc
src/pybind/rbd/rbd.pyx

index 4401a36c8ba9c6fcf53b1769834cb94ca72d6b64,7f5e32688afe126ecaa3abd6eb52cea7d6778683..35a1a8bc3c3bd5c1109eae3b8c20ff2c1994ee78
   * MON config-key prefix for storing optional remote cluster connectivity
   * parameters
   */
- #define RBD_MIRROR_PEER_CONFIG_KEY_PREFIX "rbd/mirror/peer/"
+ #define RBD_MIRROR_CONFIG_KEY_PREFIX          "rbd/mirror/"
+ #define RBD_MIRROR_SITE_NAME_CONFIG_KEY       RBD_MIRROR_CONFIG_KEY_PREFIX "site_name"
+ #define RBD_MIRROR_PEER_CLIENT_ID_CONFIG_KEY  RBD_MIRROR_CONFIG_KEY_PREFIX "peer_client_id"
+ #define RBD_MIRROR_PEER_CONFIG_KEY_PREFIX     RBD_MIRROR_CONFIG_KEY_PREFIX "peer/"
  
  struct rbd_info {
 -      __le64 max_id;
 +      ceph_le64 max_id;
  } __attribute__ ((packed));
  
  struct rbd_obj_snap_ondisk {
Simple merge
index 8e83823374008bb2d78e720bbfd4a75555993f7f,e011d5514135828812a4135b1693fcb7967c393b..a0e91c3614b9bad580d1793a8ae0a35a239a218a
@@@ -310,11 -308,16 +311,19 @@@ void MonCapGrant::expand_profile_mon(co
      StringConstraint constraint(StringConstraint::MATCH_TYPE_PREFIX,
                                  "rbd/mirror/");
      profile_grants.push_back(MonCapGrant("config-key get", "key", constraint));
+   } else if (profile == "rbd-mirror-peer") {
+     StringConstraint constraint(StringConstraint::MATCH_TYPE_REGEX,
+                                 "rbd/mirror/[^/]+");
+     profile_grants.push_back(MonCapGrant("config-key get", "key", constraint));
+     constraint = StringConstraint(StringConstraint::MATCH_TYPE_PREFIX,
+                                   "rbd/mirror/peer/");
+     profile_grants.push_back(MonCapGrant("config-key set", "key", constraint));
    }
 -
 +  else if (profile == "crash") {
 +    // TODO: we could limit this to getting the monmap and mgrmap...
 +    profile_grants.push_back(MonCapGrant("mon", MON_CAP_R));
 +  }
    if (profile == "role-definer") {
      // grants ALL caps to the auth subsystem, read-only on the
      // monitor subsystem and nothing else.
Simple merge