qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 01/16] x86: Convert conditional compilation o


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2 01/16] x86: Convert conditional compilation of debug printfs to regular ifs
Date: Tue, 13 May 2014 09:38:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Am 13.05.2014 09:02, schrieb Marc Marí:
> 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>
> ---
>  hw/i386/kvm/pci-assign.c |    9 ++++-----
>  hw/i386/multiboot.c      |    6 ++++--
>  target-i386/kvm.c        |    8 ++++----
>  xen-hvm.c                |   12 ++++++------
>  xen-mapcache.c           |    8 ++++----
>  5 files changed, 22 insertions(+), 21 deletions(-)
> 
> diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
> index e55421a..35757ae 100644
> --- a/hw/i386/kvm/pci-assign.c
> +++ b/hw/i386/kvm/pci-assign.c
> @@ -51,14 +51,13 @@
>  //#define DEVICE_ASSIGNMENT_DEBUG
>  
>  #ifdef DEVICE_ASSIGNMENT_DEBUG
> -#define DEBUG(fmt, ...)                                       \
> -    do {                                                      \
> -        fprintf(stderr, "%s: " fmt, __func__ , __VA_ARGS__);  \
> -    } while (0)
> +#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 1
>  #else
> -#define DEBUG(fmt, ...)
> +#define DEVICE_ASSIGNMENT_DEBUG_ENABLED 0
>  #endif
>  
> +#define DEBUG(fmt, ...) QEMU_DPRINTF(DEVICE_ASSIGNMENT_DEBUG_ENABLED, 
> "pci_assign", fmt, ## __VA_ARGS__)

This is broken, QEMU_DPRINTF() is not defined yet. Looks like an
ordering issue with 16/16.

Regards,
Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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