From 7e6be86785465aecbbeb155548d3aa07c7271b76 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 16 May 2012 21:09:58 -0700 Subject: mon: discover peer names during probe Fill in noname- entires in initial generate monmap (e.g., from mon_host) with real peer names as we discover them. This will make the upcoming initial quorum config check work by letting us identify peers by name. Signed-off-by: Sage Weil --- src/mon/MonMap.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mon/MonMap.h') diff --git a/src/mon/MonMap.h b/src/mon/MonMap.h index f294b497145..f9706fd665b 100644 --- a/src/mon/MonMap.h +++ b/src/mon/MonMap.h @@ -120,6 +120,13 @@ class MonMap { assert(n < rank_name.size()); return rank_name[n]; } + string get_name(entity_addr_t a) const { + map::const_iterator p = addr_name.find(a); + if (p == addr_name.end()) + return string(); + else + return p->second; + } int get_rank(const string& n) { for (unsigned i=0; i