qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v3 03/27] COLO: migrate colo related info to


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v3 03/27] COLO: migrate colo related info to slave
Date: Mon, 16 Feb 2015 16:20:57 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

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 <address@hidden>
> Signed-off-by: Yang Hongyang <address@hidden>
> Signed-off-by: Lai Jiangshan <address@hidden>
> Signed-off-by: Gonglei <address@hidden>
> ---
>  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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]