On 2015/2/17 7:20, Eric Blake wrote:
On 02/11/2015 08:16 PM, zhanghailiang wrote:
We can know if we should go into COLO mode by the info that
has been migrated from PVM.

Signed-off-by: zhanghailiang <zhang.zhanghaili...@huawei.com>
Signed-off-by: Yang Hongyang <yan...@cn.fujitsu.com>
Signed-off-by: Lai Jiangshan <la...@cn.fujitsu.com>
Signed-off-by: Gonglei <arei.gong...@huawei.com>
---
  include/migration/migration-colo.h | 21 ++++++++++++++
  migration/Makefile.objs            |  1 +
  migration/colo-comm.c              | 56 ++++++++++++++++++++++++++++++++++++++
  vl.c                               |  5 +++-
  4 files changed, 82 insertions(+), 1 deletion(-)
  create mode 100644 include/migration/migration-colo.h
  create mode 100644 migration/colo-comm.c

+
+/* #define DEBUG_COLO */
+
+#ifdef DEBUG_COLO
+#define DPRINTF(fmt, ...) \
+    do { fprintf(stdout, "COLO: " fmt, ## __VA_ARGS__); } while (0)
+#else
+#define DPRINTF(fmt, ...) \
+    do { } while (0)
+#endif

This is not very good (that is, it is a great way to write stale
debugging statements that tend to bit-rot, and later fail to compile
when you turn debug on).  Better is a usage pattern that enforces that
the debug compiles but has no impact.  For example, see how block/ssh.c
defines DPRINTF.


OK, will fix that in next version, thanks.


Reply via email to