Fix QCOW2 debugging code to compile with DEBUG_ALLOC defined.
PATCH 1/2 Fix QCOW2 debugging code to compile with DEBUG_ALLOC defined.
--- block/qcow2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
block/qcow2.c +1 -1
@@ -251,7 +251,7 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags) goto fail;#ifdef DEBUG_ALLOC -check_refcounts (bs); +qcow2_check_refcounts (bs);#endif return 0 ;
Signature · 1 line
1.6.3.msysgit.0
Quoted 10 lines · Filip Navara
Signed-off-by Filip Navara <[email protected]>--- block/qcow2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)block/qcow2.c +0
-0
block/qcow2.c static int qcow_open(BlockDriverState *bs, const char *filename, int flags) · line 257
Quoted 8 lines
block/qcow2.c +1
-1@@ -251,7 +251,7 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags) goto fail;#ifdef DEBUG_ALLOC -check_refcounts (bs); +qcow2_check_refcounts (bs);#endif return 0 ;
Good point. However, this is not complete. During the qcow2 source split the #ifdefs have been spread over the files, but the #define hasn't moved to qcow2.h. To fix debugging you should move it there and fix the additional compile errors in the other files, too. Also, defining DEBUG_ALLOC2 gives even more errors, so maybe they should handled here as well.
Kevin
Quoted 27 lines · Kevin Wolf
Quoted 10 lines · Filip Navara
Signed-off-by Filip Navara <[email protected]>---
block/qcow2.c | 2 +-1 files changed, 1 insertions(+), 1 deletions(-)block/qcow2.c +0
-0block/qcow2.c static int qcow_open(BlockDriverState *bs, const char *filename, int flags) · line 257
Quoted 8 lines
block/qcow2.c +1
-1@@ -251,7 +251,7 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags) goto fail; #ifdef DEBUG_ALLOC - check_refcounts(bs); + qcow2_check_refcounts(bs); #endif return 0;Good point. However, this is not complete. During the qcow2 source split the #ifdefs have been spread over the files, but the #define hasn't moved to
qcow2.h. To fix debugging you should move it there and fix the additional compile errors in the other files, too. Also, definingDEBUG_ALLOC2gives even more errors, so maybe they should handled here as well.
Quoted 1 line
Kevin
I have sent a new patch that fixes all the QCOW2 debugging code in my environment and moves the definitions to qcow2.h. Thanks for comments.
Best regards,
Filip Navara