qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, blauwirbel@gmail.com
Subject: [Qemu-devel] [PATCH 2/2] qcow2: Remove static forward declaration
Date: Fri,  7 May 2010 12:43:46 +0200	[thread overview]
Message-ID: <1273229026-12691-3-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1273229026-12691-1-git-send-email-kwolf@redhat.com>

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 <kwolf@redhat.com>
---
 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);
     }
-- 
1.6.6.1

  parent reply	other threads:[~2010-05-07 13:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-07 10:43 [Qemu-devel] [PATCH 0/2] qcow2: Move BlockDriver definiton to the end of the file Kevin Wolf
2010-05-07 10:43 ` [Qemu-devel] [PATCH 1/2] Revert "Fix OpenBSD build" Kevin Wolf
2010-05-07 10:43 ` Kevin Wolf [this message]
2010-05-07 15:45 ` [Qemu-devel] Re: [PATCH 0/2] qcow2: Move BlockDriver definiton to the end of the file Blue Swirl
2010-05-07 16:41   ` Kevin Wolf
2010-05-07 17:15     ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1273229026-12691-3-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).