From: Matt Benjamin Date: Mon, 10 Jul 2017 09:31:05 +0000 (-0400) Subject: rgw_file: add service map registration X-Git-Tag: v12.1.1~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16251%2Fhead;p=ceph.git rgw_file: add service map registration 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 --- diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index b45adf65101..306dbf35f85 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -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 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() */