On 20/7/26 09:55, Marc-André Lureau wrote:
Those DEBUG_ALLOC-guarded are dead code incorrectly calling coroutine fn
from non-coroutine. Remove it.

Signed-off-by: Marc-André Lureau <[email protected]>
---
  block/qcow2-snapshot.c | 18 ------------------
  1 file changed, 18 deletions(-)

diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c
index 1e8dc48be1c..8453ad73d10 100644
--- a/block/qcow2-snapshot.c
+++ b/block/qcow2-snapshot.c
@@ -740,12 +740,6 @@ int qcow2_snapshot_create(BlockDriverState *bs, 
QEMUSnapshotInfo *sn_info)
                            ROUND_UP(sn->vm_state_size, s->cluster_size),
                            QCOW2_DISCARD_NEVER, false);
-#ifdef DEBUG_ALLOC
-    {
-      BdrvCheckResult result = {0};
-      qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
      return 0;

Fixes: 70bacc44532 ("qcow2: mark more functions as coroutine_fns and GRAPH_RDLOCK")
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

While here we could remove DEBUG_ALLOC:

-- >8 --
diff --git a/block/qcow2.h b/block/qcow2.h
index ce517040c47..5e1f916d58f 100644
--- a/block/qcow2.h
+++ b/block/qcow2.h
@@ -33,3 +33,2 @@

-//#define DEBUG_ALLOC
 //#define DEBUG_ALLOC2
diff --git a/block/qcow2.c b/block/qcow2.c
index 19271b10a49..6965b80af03 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1965,9 +1965,2 @@ qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,

-#ifdef DEBUG_ALLOC
-    {
-        BdrvCheckResult result = {0};
-        qcow2_check_refcounts(bs, &result, 0);
-    }
-#endif
-
     qemu_co_queue_init(&s->thread_task_queue);
---

Reply via email to