aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2010-05-07 12:43:46 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-05-07 17:11:37 +0000
commit92b30744d7da8facd8f2206731bae87eebb06164 (patch)
tree2980169beb4ea6190e6daa84714072528598ad08
parentde5f3f40afb6e6491cc650d803254adc79da60e7 (diff)
qcow2: Remove static forward declaration
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> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--block/qcow2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 3dbe4b8889..ebad4e10ae 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);
}