From c618b293a64d1690105505d7cb28ba1ca8dd33c7 Mon Sep 17 00:00:00 2001
From: Uri Lublin <uril@redhat.com>
Date: Wed, 11 Mar 2009 20:18:23 +0200
Subject: [PATCH] block-qcow2: do not scan refcounts when opening a backing file
It takes too long and is not needed.
Signed-off-by: Uri Lublin <uril@redhat.com>
---
qemu/block-qcow2.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
@@ -276,7 +276,8 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags)
if (refcount_init(bs) < 0)
goto fail;
- scan_refcount(bs, &s->highest_alloc, &s->nc_free);
+ if ((flags & BDRV_O_BACKING) == 0)
+ scan_refcount(bs, &s->highest_alloc, &s->nc_free);
/* read the backing file name */
if (header.backing_file_offset != 0) {
--
1.6.0.6