From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp1ce-00013P-Bf for qemu-devel@nongnu.org; Thu, 04 Aug 2011 13:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qp1cd-0002uZ-Dn for qemu-devel@nongnu.org; Thu, 04 Aug 2011 13:22:16 -0400 Received: from mail.univention.de ([82.198.197.8]:2352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp1cd-0002u2-6g for qemu-devel@nongnu.org; Thu, 04 Aug 2011 13:22:15 -0400 Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id 97CBEE5B103 for ; Thu, 4 Aug 2011 19:22:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by slugis.knut.univention.de (Postfix) with ESMTP id 8F3ABE5B104 for ; Thu, 4 Aug 2011 19:22:13 +0200 (CEST) Received: from mail.univention.de ([127.0.0.1]) by localhost (slugis.knut.univention.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NfMvMy2vBnL5 for ; Thu, 4 Aug 2011 19:22:13 +0200 (CEST) Received: from stave.knut.univention.de (stave.knut.univention.de [192.168.0.191]) by slugis.knut.univention.de (Postfix) with ESMTPSA id 55672E5B103 for ; Thu, 4 Aug 2011 19:22:13 +0200 (CEST) From: Philipp Hahn Date: Thu, 4 Aug 2011 19:22:10 +0200 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_DVtOOIUg6X+OEaN" Message-Id: <201108041922.11014.hahn@univention.de> Subject: [Qemu-devel] [PATCH] Fix DEBUG_* compilation of qcow2. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --Boundary-00=_DVtOOIUg6X+OEaN Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. Signed-off-by: Philipp Hahn --- block/qcow2-snapshot.c | 15 ++++++++++++--- block/qcow2.c | 6 +++++- 2 files changed, 17 insertions(+), 4 deletions(-) --Boundary-00=_DVtOOIUg6X+OEaN Content-Type: text/x-patch; name="0001-Fix-DEBUG_-compilation-of-qcow2.patch" Content-Disposition: inline; filename="0001-Fix-DEBUG_-compilation-of-qcow2.patch" Content-Transfer-Encoding: quoted-printable diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c index 74823a5..a6c0861 100644 --- a/block/qcow2-snapshot.c +++ b/block/qcow2-snapshot.c @@ -303,7 +303,10 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMU= SnapshotInfo *sn_info) if (qcow2_write_snapshots(bs) < 0) goto fail; #ifdef DEBUG_ALLOC - qcow2_check_refcounts(bs); + { + BdrvCheckResult result =3D {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; =20 #ifdef DEBUG_ALLOC - qcow2_check_refcounts(bs); + { + BdrvCheckResult result =3D {0}; + qcow2_check_refcounts(bs, &result); + } #endif return 0; fail: @@ -384,7 +390,10 @@ int qcow2_snapshot_delete(BlockDriverState *bs, cons= t char *snapshot_id) return ret; } #ifdef DEBUG_ALLOC - qcow2_check_refcounts(bs); + { + BdrvCheckResult result =3D {0}; + qcow2_check_refcounts(bs, &result); + } #endif return 0; } diff --git a/block/qcow2.c b/block/qcow2.c index 48e1b95..a42ece9 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -87,6 +87,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, = uint64_t start_offset, while (offset < end_offset) { =20 #ifdef DEBUG_EXT + BDRVQcowState *s =3D bs->opaque; /* Sanity check */ if (offset > s->cluster_size) printf("qcow2_read_extension: suspicious offset %lu\n", offs= et); @@ -277,7 +278,10 @@ static int qcow2_open(BlockDriverState *bs, int flag= s) } =20 #ifdef DEBUG_ALLOC - qcow2_check_refcounts(bs); + { + BdrvCheckResult result =3D {0}; + qcow2_check_refcounts(bs, &result); + } #endif return ret; =20 --Boundary-00=_DVtOOIUg6X+OEaN--