]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: make messenger type configurable
authorSage Weil <sage@redhat.com>
Sat, 4 Oct 2014 00:59:40 +0000 (17:59 -0700)
committerSage Weil <sage@redhat.com>
Mon, 6 Oct 2014 15:51:20 +0000 (08:51 -0700)
Eventaully we may want to override this by passing the type in as an
arg, but let's do that later.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/msg/Messenger.cc

index d2131d005fef96b9c1369408a35d048c1a1fd7e0..38c25a2bef7bd31472988b05c7fd6bfc16d5a9f3 100644 (file)
@@ -113,6 +113,7 @@ OPTION(heartbeat_file, OPT_STR, "")
 OPTION(heartbeat_inject_failure, OPT_INT, 0)    // force an unhealthy heartbeat for N seconds
 OPTION(perf, OPT_BOOL, true)       // enable internal perf counters
 
+OPTION(ms_type, OPT_STR, "simple")   // messenger backend
 OPTION(ms_tcp_nodelay, OPT_BOOL, true)
 OPTION(ms_tcp_rcvbuf, OPT_INT, 0)
 OPTION(ms_tcp_prefetch_max_size, OPT_INT, 4096) // max prefetch size, we limit this to avoid extra memcpy
index b80782de518dbbb33991170cf5b4252ced5d4ef2..1b6872054123626e718481817654ba2e1650741d 100644 (file)
@@ -9,5 +9,8 @@ Messenger *Messenger::create(CephContext *cct,
                             string lname,
                             uint64_t nonce)
 {
-  return new SimpleMessenger(cct, name, lname, nonce);
+  if (cct->_conf->ms_type == "simple")
+    return new SimpleMessenger(cct, name, lname, nonce);
+  derr << "unrecognized ms_type '" << cct->_conf->ms_type << "'" << dendl;
+  return NULL;
 }