]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: send import debug noise to dout, not stdout
authorSage Weil <sage@inktank.com>
Wed, 27 Mar 2013 18:07:53 +0000 (11:07 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Mon, 1 Apr 2013 06:32:41 +0000 (23:32 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
src/rbd.cc

index 2ddbacb60398bab3f24b7a1fdc420a079680819d..a338863a5d5d30e20b0e0d25e7fc17d336ced5e0 100644 (file)
@@ -72,6 +72,8 @@ static string dir_info_oid = RBD_INFO;
 
 bool udevadm_settle = true;
 
+#define dout_subsys ceph_subsys_rbd
+
 void usage()
 {
   cout << 
@@ -1386,20 +1388,20 @@ static int do_import_diff(librbd::Image &image, const char *path)
       goto done;
 
     if (tag == 'e') {
-      cout << " end diff" << std::endl;
+      dout(2) << " end diff" << dendl;
       break;
     }
     else if (tag == 'f') {
       r = read_string(fd, 4096, &from);   // 4k limit to make sure we don't get a garbage string
       if (r < 0)
        goto done;
-      cout << " from snap " << from << std::endl;
+      dout(2) << " from snap " << from << dendl;
     }
     else if (tag == 't') {
       r = read_string(fd, 4096, &to);   // 4k limit to make sure we don't get a garbage string
       if (r < 0)
        goto done;
-      cout << "   to snap " << to << std::endl;
+      dout(2) << "   to snap " << to << dendl;
     }
     else if (tag == 's') {
       uint64_t end_size;
@@ -1414,10 +1416,10 @@ static int do_import_diff(librbd::Image &image, const char *path)
       uint64_t cur_size;
       image.size(&cur_size);
       if (cur_size != end_size) {
-       cout << "resize " << end_size << " -> " << size << std::endl;
+       dout(2) << "resize " << end_size << " -> " << size << dendl;
        image.resize(end_size);
       } else {
-       cout << "size " << end_size << " (no change)" << std::endl;
+       dout(2) << "size " << end_size << " (no change)" << dendl;
       }
       if (from_stdin)
        size = end_size;
@@ -1441,10 +1443,10 @@ static int do_import_diff(librbd::Image &image, const char *path)
          goto done;
        bufferlist data;
        data.append(bp);
-       cout << " write " << off << "~" << len << std::endl;
+       dout(2) << " write " << off << "~" << len << dendl;
        image.write(off, len, data);
       } else if (tag == 'z') {
-       cout << " zero " << off << "~" << len << std::endl;
+       dout(2) << " zero " << off << "~" << len << dendl;
        image.discard(off, len);
       }
     }
@@ -1466,7 +1468,7 @@ static int do_import_diff(librbd::Image &image, const char *path)
 
   // take final snap
   if (to.length()) {
-    cout << " create end snap " << to << std::endl;
+    dout(2) << " create end snap " << to << dendl;
     r = image.snap_create(to.c_str());
   }