qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 16/16] common: Convert conditional compilatio


From: Cornelia Huck
Subject: Re: [Qemu-devel] [PATCH v2 16/16] common: Convert conditional compilation of debug printfs to regular ifs
Date: Tue, 13 May 2014 11:05:59 +0200

On Tue, 13 May 2014 09:02:52 +0200
Marc Marí <address@hidden> wrote:

> Modify debug macros to have the same format through the codebase and use 
> regular
> ifs instead of ifdef.
> 
> As the debug printf is always put in code, some casting had to be added to 
> avoid
> warnings treated as errors at compile time.
> 
> Signed-off-by: Marc Marí <address@hidden>
> ---
>  include/qemu-common.h |    7 +++++++
>  migration-rdma.c      |   32 ++++++++++++++------------------
>  page_cache.c          |   10 ++++++----
>  3 files changed, 27 insertions(+), 22 deletions(-)
> 
> diff --git a/include/qemu-common.h b/include/qemu-common.h
> index 3f3fd60..3593bdc 100644
> --- a/include/qemu-common.h
> +++ b/include/qemu-common.h
> @@ -463,3 +463,10 @@ int parse_debug_env(const char *name, int max, int 
> initial);
>  const char *qemu_ether_ntoa(const MACAddr *mac);
> 
>  #endif
> +
> +#define QEMU_DPRINTF(cond,pfx,fmt,...) \
> +  do { \
> +    if (cond) { \
> +      fprintf(stderr, pfx": %s:"fmt, __func__, ## __VA_ARGS__); \
> +    } \
> +  } while (0)

I'd split that hunk into a seperate patch and make it the first one in
the series. That way, you'd preserve bisectability.




reply via email to

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