cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
218e99
From 48a9eea657b6533556026d5eda813736ab36844b Mon Sep 17 00:00:00 2001
218e99
From: Paolo Bonzini <pbonzini@redhat.com>
218e99
Date: Fri, 18 Oct 2013 08:14:28 +0200
218e99
Subject: [PATCH 03/81] cow: do not call bdrv_co_is_allocated
218e99
218e99
RH-Author: Paolo Bonzini <pbonzini@redhat.com>
218e99
Message-id: <1382084091-16636-4-git-send-email-pbonzini@redhat.com>
218e99
Patchwork-id: 54987
218e99
O-Subject: [RHEL 7.0 qemu-kvm PATCH 03/26] cow: do not call bdrv_co_is_allocated
218e99
Bugzilla: 989646
218e99
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
218e99
RH-Acked-by: Max Reitz <mreitz@redhat.com>
218e99
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
218e99
218e99
As we change bdrv_is_allocated to gather more information from bs and
218e99
bs->file, it will become a bit slower.  It is still appropriate for online
218e99
jobs, but not for reads/writes.  Call the internal function instead.
218e99
218e99
Reviewed-by: Eric Blake <eblake@redhat.com>
218e99
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
(cherry picked from commit e641c1e81e54fc14908ff6785ef7d51e42c2e1bb)
218e99
---
218e99
 block/cow.c | 2 +-
218e99
 1 file changed, 1 insertion(+), 1 deletion(-)
218e99
218e99
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
218e99
---
218e99
 block/cow.c |    2 +-
218e99
 1 files changed, 1 insertions(+), 1 deletions(-)
218e99
218e99
diff --git a/block/cow.c b/block/cow.c
218e99
index 2f72334..21bceaa 100644
218e99
--- a/block/cow.c
218e99
+++ b/block/cow.c
218e99
@@ -212,7 +212,7 @@ static int coroutine_fn cow_read(BlockDriverState *bs, int64_t sector_num,
218e99
     int ret, n;
218e99
 
218e99
     while (nb_sectors > 0) {
218e99
-        if (bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n)) {
218e99
+        if (cow_co_is_allocated(bs, sector_num, nb_sectors, &n)) {
218e99
             ret = bdrv_pread(bs->file,
218e99
                         s->cow_sectors_offset + sector_num * 512,
218e99
                         buf, n * 512);
218e99
-- 
218e99
1.7.1
218e99