From: Sage Weil Date: Wed, 27 Mar 2013 18:07:53 +0000 (-0700) Subject: rbd: send import debug noise to dout, not stdout X-Git-Tag: v0.62~118^2~38 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=186ddda58ce3a0d19b554057ba6ea8f96ab6fa6c;p=ceph.git rbd: send import debug noise to dout, not stdout Signed-off-by: Sage Weil --- diff --git a/src/rbd.cc b/src/rbd.cc index 2ddbacb60398..a338863a5d5d 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -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()); }