From: Bassam Tabbara Date: Fri, 18 Nov 2016 22:40:30 +0000 (-0800) Subject: embedded: add MDS to libcephd X-Git-Tag: v12.0.0~179^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3721790fcfed6636d0956e401264f6482277c376;p=ceph.git embedded: add MDS to libcephd Added MDS to libcephd Signed-off-by: Bassam Tabbara --- diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index a444d573975a..4cd951918ad2 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -49,7 +49,7 @@ using namespace std; #define dout_context g_ceph_context #define dout_subsys ceph_subsys_mds -void usage() +static void usage() { cout << "usage: ceph-mds -i name [flags] [[--hot-standby][rank]]\n" << " -m monitorip:port\n" @@ -86,7 +86,11 @@ static void handle_mds_signal(int signum) mds->handle_signal(signum); } -int main(int argc, const char **argv) +#ifdef BUILDING_FOR_EMBEDDED +extern "C" int cephd_mds(int argc, const char **argv) +#else +int main(int argc, const char **argv) +#endif { vector args; argv_to_vec(argc, argv, args); diff --git a/src/include/cephd/libcephd.h b/src/include/cephd/libcephd.h index d8f90c6ddd3d..5538c058ad15 100644 --- a/src/include/cephd/libcephd.h +++ b/src/include/cephd/libcephd.h @@ -76,6 +76,15 @@ CEPH_LIBCEPHD_API int cephd_run_mon(int argc, const char **argv); */ CEPH_LIBCEPHD_API int cephd_run_osd(int argc, const char **argv); +/** + * Runs ceph-mds passing in command line args + * + * @param argc number of parameters + * @param argv array of string arguments + * @returns 0 on success, negative error code on failure + */ +CEPH_LIBCEPHD_API int cephd_run_mds(int argc, const char **argv); + #ifdef __cplusplus } #endif diff --git a/src/libcephd/CMakeLists.txt b/src/libcephd/CMakeLists.txt index b5e398f0fb93..0eb06371f2a0 100644 --- a/src/libcephd/CMakeLists.txt +++ b/src/libcephd/CMakeLists.txt @@ -3,7 +3,8 @@ include(MergeStaticLibraries) add_library(cephd_base STATIC libcephd.cc ../ceph_mon.cc - ../ceph_osd.cc) + ../ceph_osd.cc + ../ceph_mds.cc) set_target_properties(cephd_base PROPERTIES COMPILE_DEFINITIONS BUILDING_FOR_EMBEDDED) @@ -21,6 +22,7 @@ set(merge_libs global json_spirit kv + mds mon os osd diff --git a/src/libcephd/libcephd.cc b/src/libcephd/libcephd.cc index 6adf4d3fa8e6..1139b5eb5db1 100644 --- a/src/libcephd/libcephd.cc +++ b/src/libcephd/libcephd.cc @@ -223,6 +223,7 @@ void cephd_preload_rados_classes(OSD *osd) extern "C" int cephd_mon(int argc, const char **argv); extern "C" int cephd_osd(int argc, const char **argv); +extern "C" int cephd_mds(int argc, const char **argv); int cephd_run_mon(int argc, const char **argv) { @@ -233,3 +234,8 @@ int cephd_run_osd(int argc, const char **argv) { return cephd_osd(argc, argv); } + +int cephd_run_mds(int argc, const char **argv) +{ + return cephd_mds(argc, argv); +}