Skip to contentSkip to conversation

Fix QCOW2 debugging code to compile with DEBUG_ALLOC defined.

PATCH In review Filip Navara 2 participants 3 messages Jun 23, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

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
index 9acbddf..fdcd20b 100644
@@ -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
#1 lore raw
Quoted 10 lines · Filip Navara
---
 block/qcow2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/qcow2.c +0 -0
index 9acbddf..fdcd20b 100644

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

#2 lore raw
Quoted 27 lines · Kevin Wolf
Quoted 10 lines · Filip Navara

---
 block/qcow2.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
block/qcow2.c +0 -0
index 9acbddf..fdcd20b 100644

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.

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