Skip to contentSkip to conversation

Fix DEBUG_* compilation of qcow2.

PATCH Applied Philipp Hahn 2 participants 2 messages Aug 4, 2011 – Aug 5, 2011 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix DEBUG_* compilation of qcow2.

By introducing BlockDriverState compiling qcow2 with DEBUG_ALLOC and DEBUG_EXT defined got broken.
Define a BdrvCheckResult structure locally which is now needed as the second argument.

Also fix qcow2_read_extensions() needing BDRVQcowState.

---
 block/qcow2-snapshot.c |   15 ++++++++++++---
 block/qcow2.c          |    6 +++++-
 2 files changed, 17 insertions(+), 4 deletions(-)
block/qcow2-snapshot.c +12 -3
index 74823a5..a6c0861 100644
@@ -303,7 +303,10 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info)
     if (qcow2_write_snapshots(bs) < 0)
         goto fail;
 #ifdef DEBUG_ALLOC
-    qcow2_check_refcounts(bs);
+    {
+      BdrvCheckResult result = {0};
+      qcow2_check_refcounts(bs, &result);
+    }
 #endif
     return 0;
  fail:
@@ -347,7 +350,10 @@ int qcow2_snapshot_goto(BlockDriverState *bs, const char *snapshot_id)
         goto fail;
 
 #ifdef DEBUG_ALLOC
-    qcow2_check_refcounts(bs);
+    {
+        BdrvCheckResult result = {0};
+        qcow2_check_refcounts(bs, &result);
+    }
 #endif
     return 0;
  fail:
@@ -384,7 +390,10 @@ int qcow2_snapshot_delete(BlockDriverState *bs, const char *snapshot_id)
         return ret;
     }
 #ifdef DEBUG_ALLOC
-    qcow2_check_refcounts(bs);
+    {
+        BdrvCheckResult result = {0};
+        qcow2_check_refcounts(bs, &result);
+    }
 #endif
     return 0;
 }
block/qcow2.c +5 -1
index 48e1b95..a42ece9 100644
@@ -87,6 +87,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset,
     while (offset < end_offset) {
 
 #ifdef DEBUG_EXT
+        BDRVQcowState *s = bs->opaque;
         /* Sanity check */
         if (offset > s->cluster_size)
             printf("qcow2_read_extension: suspicious offset %lu\n", offset);
@@ -277,7 +278,10 @@ static int qcow2_open(BlockDriverState *bs, int flags)
     }
 
 #ifdef DEBUG_ALLOC
-    qcow2_check_refcounts(bs);
+    {
+        BdrvCheckResult result = {0};
+        qcow2_check_refcounts(bs, &result);
+    }
 #endif
     return ret;
 
Applied
#1 lore raw

Am 04.08.2011 19:22, schrieb Philipp Hahn:

Quoted 5 lines

By introducing BlockDriverState compiling qcow2 with DEBUG_ALLOC and DEBUG_EXT defined got broken.
Define a BdrvCheckResult structure locally which is now needed as the second argument.

Quoted 8 lines

Also fix qcow2_read_extensions() needing BDRVQcowState.

---
 block/qcow2-snapshot.c |   15 ++++++++++++---
 block/qcow2.c          |    6 +++++-
 2 files changed, 17 insertions(+), 4 deletions(-)

Thanks, applied to the block branch.

Kevin