make cmonctl and cfuse use MonClient too

This commit is contained in:
Sage Weil 2008-03-10 08:54:57 -07:00
parent 8b795e1e07
commit 1076d73814
2 changed files with 11 additions and 6 deletions

View File

@ -25,6 +25,8 @@ using namespace std;
#include "msg/SimpleMessenger.h"
#include "mon/MonClient.h"
#include "common/Timer.h"
#ifndef DARWIN
@ -50,10 +52,11 @@ int main(int argc, const char **argv, const char *envp[]) {
if (g_conf.clock_tare) g_clock.tare();
// load monmap
// get monmap
MonMap monmap;
int r = monmap.read(".ceph_monmap");
assert(r >= 0);
MonClient mc;
if (mc.get_monmap(&monmap) < 0)
return -1;
// start up network
rank.bind();

View File

@ -20,6 +20,7 @@ using namespace std;
#include "config.h"
#include "mon/MonMap.h"
#include "mon/MonClient.h"
#include "msg/SimpleMessenger.h"
#include "messages/MMonCommand.h"
#include "messages/MMonCommandAck.h"
@ -98,10 +99,11 @@ int main(int argc, const char **argv, const char *envp[]) {
nargs.push_back(args[i]);
}
// load monmap
// get monmap
MonMap monmap;
int r = monmap.read(".ceph_monmap");
assert(r >= 0);
MonClient mc;
if (mc.get_monmap(&monmap) < 0)
return -1;
// start up network
rank.bind();