From patchwork Fri May 7 10:43:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 51911 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 52AD2B7D5E for ; Fri, 7 May 2010 23:55:10 +1000 (EST) Received: from localhost ([127.0.0.1]:53636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAO1C-000822-Bf for incoming@patchwork.ozlabs.org; Fri, 07 May 2010 09:55:06 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OANV6-0007wc-II for qemu-devel@nongnu.org; Fri, 07 May 2010 09:21:56 -0400 Received: from [140.186.70.92] (port=46810 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OANV0-0005km-4c for qemu-devel@nongnu.org; Fri, 07 May 2010 09:21:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAL2Z-0005Xx-VJ for qemu-devel@nongnu.org; Fri, 07 May 2010 06:44:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12566) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAL2Z-0005Xf-Lx for qemu-devel@nongnu.org; Fri, 07 May 2010 06:44:19 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o47AiG2p005934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 May 2010 06:44:17 -0400 Received: from localhost.localdomain (vpn2-10-112.ams2.redhat.com [10.36.10.112]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o47Ai8N3003167; Fri, 7 May 2010 06:44:15 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Fri, 7 May 2010 12:43:46 +0200 Message-Id: <1273229026-12691-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1273229026-12691-1-git-send-email-kwolf@redhat.com> References: <1273229026-12691-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com, blauwirbel@gmail.com Subject: [Qemu-devel] [PATCH 2/2] qcow2: Remove static forward declaration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org OpenBSDs gcc is said to generate warnings for this declaration, so don't reference bdrv_qcow2 directly, but look it up using bdrv_find_format. Signed-off-by: Kevin Wolf --- block/qcow2.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 15a6a2c..0ce7150 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -52,8 +52,6 @@ typedef struct { #define QCOW_EXT_MAGIC_END 0 #define QCOW_EXT_MAGIC_BACKING_FORMAT 0xE2792ACA -static BlockDriver bdrv_qcow2; - static int qcow_probe(const uint8_t *buf, int buf_size, const char *filename) { const QCowHeader *cow_header = (const void *)buf; @@ -1018,8 +1016,9 @@ exit: /* Preallocate metadata */ if (ret == 0 && prealloc) { BlockDriverState *bs; + BlockDriver *drv = bdrv_find_format("qcow2"); bs = bdrv_new(""); - bdrv_open(bs, filename, BDRV_O_CACHE_WB | BDRV_O_RDWR, &bdrv_qcow2); + bdrv_open(bs, filename, BDRV_O_CACHE_WB | BDRV_O_RDWR, drv); preallocate(bs); bdrv_close(bs); }