Skip to contentSkip to conversation

Fix QCOW2 debugging code to compile again

PATCH Superseded Filip Navara 4 participants 4 messages Jun 23, 2009 – Jun 24, 2009 Block layer

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix QCOW2 debugging code to compile again

---
 block/qcow2-snapshot.c |    6 +++---
 block/qcow2.c          |    6 +-----
 block/qcow2.h          |    4 ++++
 3 files changed, 8 insertions(+), 8 deletions(-)
block/qcow2-snapshot.c +3 -3
index e1e4d89..94cb838 100644
@@ -288,7 +288,7 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
     if (qcow_write_snapshots(bs) < 0)
         goto fail;
 #ifdef DEBUG_ALLOC
-    check_refcounts(bs);
+    qcow2_check_refcounts(bs);
 #endif
     return 0;
  fail:
@@ -332,7 +332,7 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
         goto fail;
 
 #ifdef DEBUG_ALLOC
-    check_refcounts(bs);
+    qcow2_check_refcounts(bs);
 #endif
     return 0;
  fail:
@@ -369,7 +369,7 @@ int qcow2_snapshot_delete(BlockDriverState *bs, const char *snapshot_id)
         return ret;
     }
 #ifdef DEBUG_ALLOC
-    check_refcounts(bs);
+    qcow2_check_refcounts(bs);
 #endif
     return 0;
 }
block/qcow2.c +1 -5
index 9acbddf..20c114b 100644
@@ -44,10 +44,6 @@
   - L2 tables have always a size of one cluster.
 */
 
-//#define DEBUG_ALLOC
-//#define DEBUG_ALLOC2
-//#define DEBUG_EXT
-
 
 typedef struct {
     uint32_t magic;
@@ -251,7 +247,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;
 
block/qcow2.h +4 -0
index d734003..8624e0c 100644
@@ -27,6 +27,10 @@
 
 #include "aes.h"
 
+/* #define DEBUG_ALLOC */
+/* #define DEBUG_ALLOC2 */
+/* #define DEBUG_EXT */
+
 #define QCOW_MAGIC (('Q' << 24) | ('F' << 16) | ('I' << 8) | 0xfb)
 #define QCOW_VERSION 2
 
Signature · 1 line
1.6.3.msysgit.0
#1 lore raw
Quoted 9 lines · Filip Navara

-//#define DEBUG_ALLOC
-//#define DEBUG_ALLOC2
-//#define DEBUG_EXT

+/* #define DEBUG_ALLOC */
+/* #define DEBUG_ALLOC2 */
+/* #define DEBUG_EXT */

The C99 comment version is much more convenient than K&R comment version in cases like this, where the intention is to be able to enable the define quickly.

#2 lore raw
Quoted 7 lines · Blue Swirl
Quoted 5 lines · Filip Navara

-//#define DEBUG_ALLOC
-//#define DEBUG_ALLOC2
-//#define DEBUG_EXT

Quoted 7 lines
Quoted 3 lines

+/* #define DEBUG_ALLOC */
+/* #define DEBUG_ALLOC2 */
+/* #define DEBUG_EXT */

The C99 comment version is much more convenient than K&R comment version in cases like this, where the intention is to be able to enable the define quickly.

It's all the same for me: C-u A-;

(defun caml-comment-till-end-of-line (&optional arg)
(interactive "P")
(save-excursion
(if (looking-at search-whitespace-regexp)
(re-search-forward search-whitespace-regexp))
(comment-region (point) (progn (end-of-line) (point)) arg)))

(global-set-key [(alt ?\;)] 'caml-comment-till-end-of-line)

Signature · 1 line
mailto:[email protected]
#3 lore raw
Quoted 10 lines · malc
Quoted 8 lines · Blue Swirl
Quoted 7 lines · Filip Navara

-//#define DEBUG_ALLOC
-//#define DEBUG_ALLOC2
-//#define DEBUG_EXT
+/* #define DEBUG_ALLOC */
+/* #define DEBUG_ALLOC2 */
+/* #define DEBUG_EXT */

Quoted 3 lines
Quoted 3 lines

The C99 comment version is much more convenient than K&R comment version in cases like this, where the intention is to be able to enable the define quickly.

I agree.

Quoted 1 line

It's all the same for me: C-u A-;

You're not alone in the world.

Kevin