From: Sangdi Xu Date: Thu, 17 Dec 2015 09:24:02 +0000 (+0800) Subject: crushtool: set type 0 name "osd" for --build option X-Git-Tag: v10.0.3~162^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=895bf8b8e9855449f989263643036dae426dbfde;p=ceph.git crushtool: set type 0 name "osd" for --build option The crushmap built by crushtool cannot be used directly as the name of type 0 is not specified. We may decompile the crushmap(it will automatically add type 0) and then recompile it to make it usable, but that's extra effort. Signed-off-by: Sangdi Xu --- diff --git a/src/test/cli/crushtool/arg-order-checks.t b/src/test/cli/crushtool/arg-order-checks.t index 787bb53bc513..4d2ccae3a1ff 100644 --- a/src/test/cli/crushtool/arg-order-checks.t +++ b/src/test/cli/crushtool/arg-order-checks.t @@ -79,7 +79,7 @@ device 24 osd.24 # types - type 0 device + type 0 osd type 1 node type 2 rack type 3 root diff --git a/src/test/cli/crushtool/build.t b/src/test/cli/crushtool/build.t index 57fb2b275f28..0bf13e0e3f7f 100644 --- a/src/test/cli/crushtool/build.t +++ b/src/test/cli/crushtool/build.t @@ -36,7 +36,7 @@ device 0 osd.0 # types - type 0 device + type 0 osd type 1 root # buckets diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index 532ffe1aa24b..8cd13f4f325f 100644 --- a/src/tools/crushtool.cc +++ b/src/tools/crushtool.cc @@ -617,6 +617,7 @@ int main(int argc, const char **argv) crush.set_item_name(i, "osd." + stringify(i)); } + crush.set_type_name(0, "osd"); int type = 1; for (vector::iterator p = layers.begin(); p != layers.end(); ++p, type++) { layer_t &l = *p;