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

Re: [Xen-devel] [PATCH v2 01/16] x86: Convert conditional compilation of debug printfs to regular ifs



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à <marc.mari.barcelo@xxxxxxxxx>
> ---
>  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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.