#include <cstring>
#include <map>
+#include "common/async/context_pool.h"
#include "common/ceph_context.h"
#include "common/ceph_argparse.h"
-#include "global/global_init.h"
#include "common/config.h"
+#include "global/global_init.h"
+
#include "auth/KeyRing.h"
-#include "mount.ceph.h"
#include "mon/MonClient.h"
+#include "mount.ceph.h"
+
+
extern "C" void mount_ceph_get_config_info(const char *config_file,
const char *name,
+ bool v2_addrs,
struct ceph_config_info *cci)
{
int err;
conf.parse_env(cct->get_module_type()); // environment variables override
conf.apply_changes(nullptr);
- MonClient monc = MonClient(cct.get());
+ ceph::async::io_context_pool ioc(1);
+ MonClient monc = MonClient(cct.get(), ioc);
err = monc.build_initial_monmap();
if (err)
goto scrape_keyring;
for (const auto& mon : monc.monmap.addr_mons) {
auto& eaddr = mon.first;
- // For now, kernel client only accepts legacy addrs
- if (!eaddr.is_legacy())
- continue;
+ /*
+ * Filter v1 addrs if we're running in ms_mode=legacy. Filter
+ * v2 addrs for any other ms_mode.
+ */
+ if (v2_addrs) {
+ if (!eaddr.is_msgr2())
+ continue;
+ } else {
+ if (!eaddr.is_legacy())
+ continue;
+ }
std::string addr;
addr += eaddr.ip_only_to_str();