Create this macro to let debug macros to have the same format through the codebase and use regular ifs instead of ifdef.
Signed-off-by: Marc Marí <marc.mari.barc...@gmail.com> --- include/qemu-common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/qemu-common.h b/include/qemu-common.h index 3f3fd60..acdcf08 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) -- 1.7.10.4