From 9dc7c653993c6cc7758f92d0f200fda44264acd8 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 2 Mar 2012 16:08:15 -0800 Subject: [PATCH] msgr: remove SimpleMessenger::get_ms_addr() in favor of Messenger::get_myaddr And fix the comments on set_ip. Signed-off-by: Greg Farnum Reviewed-by: Sage Weil --- src/ceph_mds.cc | 2 +- src/ceph_osd.cc | 2 +- src/librados.cc | 2 +- src/msg/SimpleMessenger.h | 16 +++++++--------- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/ceph_mds.cc b/src/ceph_mds.cc index bfa3698e6c982..61e790183fb66 100644 --- a/src/ceph_mds.cc +++ b/src/ceph_mds.cc @@ -236,7 +236,7 @@ int main(int argc, const char **argv) getpid()); messenger->set_cluster_protocol(CEPH_MDS_PROTOCOL); - cout << "starting " << g_conf->name << " at " << messenger->get_ms_addr() + cout << "starting " << g_conf->name << " at " << messenger->get_myaddr() << std::endl; uint64_t supported = CEPH_FEATURE_UID | diff --git a/src/ceph_osd.cc b/src/ceph_osd.cc index 61aefde864101..e883e6016deb3 100644 --- a/src/ceph_osd.cc +++ b/src/ceph_osd.cc @@ -319,7 +319,7 @@ int main(int argc, const char **argv) global_print_banner(); cout << "starting osd." << whoami - << " at " << client_messenger->get_ms_addr() + << " at " << client_messenger->get_myaddr() << " osd_data " << g_conf->osd_data << " " << ((g_conf->osd_journal.empty()) ? "(no journal)" : g_conf->osd_journal) diff --git a/src/librados.cc b/src/librados.cc index 3e8084b8b87c8..b8fc434f02c8f 100644 --- a/src/librados.cc +++ b/src/librados.cc @@ -1016,7 +1016,7 @@ int librados::RadosClient::connect() // how to decompose the reply data into its consituent pieces. messenger->set_default_policy(Messenger::Policy::client(0, CEPH_FEATURE_OSDREPLYMUX)); - ldout(cct, 1) << "starting msgr at " << messenger->get_ms_addr() << dendl; + ldout(cct, 1) << "starting msgr at " << messenger->get_myaddr() << dendl; ldout(cct, 1) << "starting objecter" << dendl; diff --git a/src/msg/SimpleMessenger.h b/src/msg/SimpleMessenger.h index 3831dad39ae92..55f93081148a5 100644 --- a/src/msg/SimpleMessenger.h +++ b/src/msg/SimpleMessenger.h @@ -57,17 +57,15 @@ public: * @{ */ /** - * Set the IP this Messenger should currently be using. - * This function should probably be removed in favor of making bind() - * more intelligent in the case where it actually does set an address - * to bind to. + * Set the IP this SimpleMessenger is using. This is useful if it's unset + * but another SimpleMessenger on the same interface has already learned its + * IP. Of course, this function does not change the port, since the + * SimpleMessenger always knows the correct setting for that. + * If the SimpleMesssenger's IP is already set, this function is a no-op. + * + * @param addr The IP address to set internally. */ void set_ip(entity_addr_t& addr); - /** - * Retrieve the address as a reference. This function should be removed - * in favor of Messenger::get_myaddr(). - */ - const entity_addr_t &get_ms_addr() { return ms_addr; } /** * Retrieve the Messenger's address. * -- 2.39.5