]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crushtool: set type 0 name "osd" for --build option
authorSangdi Xu <xu.sangdi@h3c.com>
Thu, 17 Dec 2015 09:24:02 +0000 (17:24 +0800)
committerSangdi Xu <xu.sangdi@h3c.com>
Thu, 17 Dec 2015 09:28:55 +0000 (17:28 +0800)
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 <xu.sangdi@h3c.com>
src/test/cli/crushtool/arg-order-checks.t
src/test/cli/crushtool/build.t
src/tools/crushtool.cc

index 787bb53bc513493fafc784c9e65b86f87a567332..4d2ccae3a1ffe883f586d59680fdbb5f9076f1a0 100644 (file)
@@ -79,7 +79,7 @@
   device 24 osd.24
   
   # types
-  type 0 device
+  type 0 osd
   type 1 node
   type 2 rack
   type 3 root
index 57fb2b275f28d750c394bb57b01bc481fa5536f1..0bf13e0e3f7fe7863f1de4c2005de7b0a68f4a0d 100644 (file)
@@ -36,7 +36,7 @@
   device 0 osd.0
   
   # types
-  type 0 device
+  type 0 osd
   type 1 root
   
   # buckets
index 532ffe1aa24b6368308a053d7de269bb265910ab..8cd13f4f325fd09587ea06179e4c5c2f4d2d6563 100644 (file)
@@ -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<layer_t>::iterator p = layers.begin(); p != layers.end(); ++p, type++) {
       layer_t &l = *p;