mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-10 02:54:58 -06:00
vdi: Avoid bitrot of debugging code
Rework the debug define so that we always get -Wformat checking, even when debugging is disabled. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
47943e9865
commit
b80666bf84
1 changed files with 9 additions and 3 deletions
12
block/vdi.c
12
block/vdi.c
|
@ -87,12 +87,18 @@
|
||||||
#define DEFAULT_CLUSTER_SIZE (1 * MiB)
|
#define DEFAULT_CLUSTER_SIZE (1 * MiB)
|
||||||
|
|
||||||
#if defined(CONFIG_VDI_DEBUG)
|
#if defined(CONFIG_VDI_DEBUG)
|
||||||
#define logout(fmt, ...) \
|
#define VDI_DEBUG 1
|
||||||
fprintf(stderr, "vdi\t%-24s" fmt, __func__, ##__VA_ARGS__)
|
|
||||||
#else
|
#else
|
||||||
#define logout(fmt, ...) ((void)0)
|
#define VDI_DEBUG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define logout(fmt, ...) \
|
||||||
|
do { \
|
||||||
|
if (VDI_DEBUG) { \
|
||||||
|
fprintf(stderr, "vdi\t%-24s" fmt, __func__, ##__VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/* Image signature. */
|
/* Image signature. */
|
||||||
#define VDI_SIGNATURE 0xbeda107f
|
#define VDI_SIGNATURE 0xbeda107f
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue