From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQVLd-0006yF-D4 for qemu-devel@nongnu.org; Wed, 25 Feb 2015 01:21:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQVLZ-0002iZ-6J for qemu-devel@nongnu.org; Wed, 25 Feb 2015 01:21:29 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:6668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQVLY-0002ha-C1 for qemu-devel@nongnu.org; Wed, 25 Feb 2015 01:21:25 -0500 Message-ID: <54ED69CE.50400@huawei.com> Date: Wed, 25 Feb 2015 14:21:02 +0800 From: zhanghailiang MIME-Version: 1.0 References: <1423711034-5340-1-git-send-email-zhang.zhanghailiang@huawei.com> <1423711034-5340-4-git-send-email-zhang.zhanghailiang@huawei.com> <54E27B59.5040702@redhat.com> In-Reply-To: <54E27B59.5040702@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC v3 03/27] COLO: migrate colo related info to slave List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: hangaohuai@huawei.com, Lai Jiangshan , yunhong.jiang@intel.com, eddie.dong@intel.com, peter.huangpeng@huawei.com, dgilbert@redhat.com, Gonglei , stefanha@redhat.com, pbonzini@redhat.com, Yang Hongyang 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 >> Signed-off-by: Yang Hongyang >> Signed-off-by: Lai Jiangshan >> Signed-off-by: Gonglei >> --- >> 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.