From d0e5153ae65911a60cd892983e540106efc3e36a Mon Sep 17 00:00:00 2001 From: Jeffrey Cody Date: Wed, 21 Mar 2012 21:54:40 +0100 Subject: [PATCH 13/55] block: use public bdrv_is_allocated() interface RH-Author: Jeffrey Cody Message-id: Patchwork-id: 38863 O-Subject: [RHEL6.3 qemu-kvm PATCH v8 13/54] block: use public bdrv_is_allocated() interface Bugzilla: 582475 RH-Acked-by: Paolo Bonzini RH-Acked-by: Marcelo Tosatti RH-Acked-by: Kevin Wolf From: Stefan Hajnoczi There is no need for bdrv_commit() to use the BlockDriver .bdrv_is_allocated() interface directly. Converting to the public interface gives us the freedom to drop .bdrv_is_allocated() entirely in favor of a new .bdrv_co_is_allocated() in the future. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf (cherry picked from commit 05c4af54c670f5143bd4ac5d79aa1ef53a9f31ca) Signed-off-by: Stefan Hajnoczi Signed-off-by: Anthony Liguori Signed-off-by: Jeff Cody --- block.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Signed-off-by: Michal Novotny --- block.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block.c b/block.c index db7ca8f..1db27aa 100644 --- a/block.c +++ b/block.c @@ -1027,7 +1027,7 @@ int bdrv_commit(BlockDriverState *bs) buf = g_malloc(COMMIT_BUF_SECTORS * BDRV_SECTOR_SIZE); for (sector = 0; sector < total_sectors; sector += n) { - if (drv->bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n)) { + if (bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n)) { if (bdrv_read(bs, sector, buf, n) != 0) { ret = -EIO; -- 1.7.7.6