From patchwork Thu Aug 4 17:22:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Hahn X-Patchwork-Id: 108547 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A4DB2B6F70 for ; Fri, 5 Aug 2011 03:22:24 +1000 (EST) Received: from localhost ([::1]:39905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qp1ck-00013a-32 for incoming@patchwork.ozlabs.org; Thu, 04 Aug 2011 13:22:22 -0400 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) X-Virus-Scanned: by amavisd-new-2.6.1 (20080629) (Debian) at knut.univention.de 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 Organization: Univention.de Date: Thu, 4 Aug 2011 19:22:10 +0200 To: qemu-devel@nongnu.org MIME-Version: 1.0 Message-Id: <201108041922.11014.hahn@univention.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 82.198.197.8 Subject: [Qemu-devel] [PATCH] Fix DEBUG_* compilation of qcow2. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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(-) 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, 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; } 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) { #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;