]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_file: add service map registration 16251/head
authorMatt Benjamin <mbenjamin@redhat.com>
Mon, 10 Jul 2017 09:31:05 +0000 (05:31 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Thu, 13 Jul 2017 00:30:00 +0000 (20:30 -0400)
Add static service map registration for librgw/NFS.  In this
verision registration is unconditional (e.g., unit tests would
register) and, in addition, since there is no API change, we
don't know anything about the upper-layer client.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/librgw.cc

index b45adf651016b987aff252bc60f112dade80b04a..306dbf35f854bba959046164e2f0685423937278 100644 (file)
@@ -22,6 +22,7 @@
 #include "rgw_acl.h"
 
 #include "include/str_list.h"
+#include "include/stringify.h"
 #include "global/global_init.h"
 #include "common/config.h"
 #include "common/errno.h"
@@ -534,9 +535,15 @@ namespace rgw {
     int port = 80;
     RGWProcessEnv env = { store, &rest, olog, port };
 
+    string fe_count{"0"};
     fec = new RGWFrontendConfig("rgwlib");
     fe = new RGWLibFrontend(env, fec);
 
+    map<string, string> service_map_meta;
+    service_map_meta["pid"] = stringify(getpid());
+    service_map_meta["frontend_type#" + fe_count] = "rgw-nfs";
+    service_map_meta["frontend_config#" + fe_count] = fec->get_config();
+
     fe->init();
     if (r < 0) {
       derr << "ERROR: failed initializing frontend" << dendl;
@@ -545,6 +552,12 @@ namespace rgw {
 
     fe->run();
 
+    r = store->register_to_service_map("rgw-nfs", service_map_meta);
+    if (r < 0) {
+      derr << "ERROR: failed to register to service map: " << cpp_strerror(-r) << dendl;
+      /* ignore error */
+    }
+
     return 0;
   } /* RGWLib::init() */