From: Dan Mick Date: Tue, 23 Jul 2013 07:04:02 +0000 (-0700) Subject: mon: PGMap dump shouldn't use strings containing '+' as tags X-Git-Tag: v0.67-rc2~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2c87d9fc2cc3aaa7b722ca8b0a2759cc000a972d;p=ceph.git mon: PGMap dump shouldn't use strings containing '+' as tags XML has a problem with tags containing +, like the PG state names. Use an enclosing array, and name the state and count items explicitly. Fixes: #5721 Signed-off-by: Dan Mick Reviewed-by: Sage Weil --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 8b37376ba7ad..86ad87bd929e 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -788,12 +788,16 @@ void PGMap::print_summary(Formatter *f, ostream *out) const { std::stringstream ss; if (f) - f->open_object_section("pgs_by_state"); + f->open_array_section("pgs_by_state"); + for (hash_map::const_iterator p = num_pg_by_state.begin(); p != num_pg_by_state.end(); ++p) { if (f) { - f->dump_unsigned(pg_state_string(p->first).c_str(), p->second); + f->open_object_section("pgs_by_state_element"); + f->dump_string("state_name", pg_state_string(p->first)); + f->dump_unsigned("count", p->second); + f->close_section(); } else { if (p != num_pg_by_state.begin()) ss << ", ";