]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: add device_id to list_devices to help get smart info easily
authorSong Shun <song.shun3@zte.com.cn>
Thu, 8 Aug 2019 22:55:01 +0000 (18:55 -0400)
committer宋顺10180185 <song.shun3@zte.com.cn>
Thu, 8 Aug 2019 22:57:38 +0000 (18:57 -0400)
Signed-off-by: Song Shun <song.shun3@zte.com.cn>
src/osd/OSD.cc

index d67002909e9ef25188a8be1e0e16bc0f34f334c6..db06bff1156b145963c993e38fb70b721bd0e468 100644 (file)
@@ -2515,12 +2515,16 @@ will start to track new ops received afterwards.";
   } else if (admin_command == "list_devices") {
     set<string> devnames;
     store->get_devices(&devnames);
-    f->open_object_section("list_devices");
+    f->open_array_section("list_devices");
     for (auto dev : devnames) {
       if (dev.find("dm-") == 0) {
        continue;
       }
+      string err;
+      f->open_object_section("device");
       f->dump_string("device", "/dev/" + dev);
+      f->dump_string("device_id", get_device_id(dev, &err));
+      f->close_section();
     }
     f->close_section();
   } else if (admin_command == "send_beacon") {