mirror of
https://github.com/ceph/ceph
synced 2025-01-10 21:20:46 +00:00
ceph-monstore-tool: implement getmonmap
Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
bcc8bfdb67
commit
5671fa9fe5
@ -204,6 +204,27 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
} else if (cmd == "compact") {
|
||||
st.compact();
|
||||
} else if (cmd == "getmonmap") {
|
||||
if (!store_path.size()) {
|
||||
std::cerr << "need mon store path" << std::endl;
|
||||
std::cerr << desc << std::endl;
|
||||
goto done;
|
||||
}
|
||||
version_t v;
|
||||
if (version <= 0) {
|
||||
v = st.get("monmap", "last_committed");
|
||||
} else {
|
||||
v = version;
|
||||
}
|
||||
|
||||
bufferlist bl;
|
||||
/// XXX: this is not ok, osdmap and full should be abstracted somewhere
|
||||
int r = st.get("monmap", v, bl);
|
||||
if (r < 0) {
|
||||
std::cerr << "Error getting map: " << cpp_strerror(r) << std::endl;
|
||||
goto done;
|
||||
}
|
||||
bl.write_fd(fd);
|
||||
} else if (cmd == "getosdmap") {
|
||||
if (!store_path.size()) {
|
||||
std::cerr << "need mon store path" << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user