yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From f792ee6d096426909f440421758e908460c18f77 Mon Sep 17 00:00:00 2001
9ae3a8
From: Juan Quintela <quintela@redhat.com>
9ae3a8
Date: Tue, 14 Jan 2014 15:07:47 +0100
9ae3a8
Subject: [PATCH 36/40] kvm: refactor start address calculation
9ae3a8
9ae3a8
RH-Author: Juan Quintela <quintela@redhat.com>
9ae3a8
Message-id: <1389712071-23303-37-git-send-email-quintela@redhat.com>
9ae3a8
Patchwork-id: 56691
9ae3a8
O-Subject: [RHEL7 qemu-kvm PATCH 36/40] kvm: refactor start address calculation
9ae3a8
Bugzilla: 997559
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
9ae3a8
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
9ae3a8
9ae3a8
Signed-off-by: Juan Quintela <quintela@redhat.com>
9ae3a8
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
9ae3a8
(cherry picked from commit c9dd46fc0d64d9f314aa3c220d4aff9d01ab778e)
9ae3a8
Signed-off-by: Juan Quintela <quintela@trasno.org>
9ae3a8
---
9ae3a8
 kvm-all.c | 8 ++++----
9ae3a8
 1 file changed, 4 insertions(+), 4 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 kvm-all.c |    8 ++++----
9ae3a8
 1 files changed, 4 insertions(+), 4 deletions(-)
9ae3a8
9ae3a8
diff --git a/kvm-all.c b/kvm-all.c
9ae3a8
index 8e2bd34..d3aa869 100644
9ae3a8
--- a/kvm-all.c
9ae3a8
+++ b/kvm-all.c
9ae3a8
@@ -367,7 +367,8 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
9ae3a8
 {
9ae3a8
     unsigned int i, j;
9ae3a8
     unsigned long page_number, c;
9ae3a8
-    hwaddr addr, addr1;
9ae3a8
+    hwaddr addr;
9ae3a8
+    ram_addr_t start = section->offset_within_region + section->mr->ram_addr;
9ae3a8
     ram_addr_t ram_addr;
9ae3a8
     unsigned int len = ((section->size / getpagesize()) + HOST_LONG_BITS - 1) / HOST_LONG_BITS;
9ae3a8
     unsigned long hpratio = getpagesize() / TARGET_PAGE_SIZE;
9ae3a8
@@ -383,9 +384,8 @@ static int kvm_get_dirty_pages_log_range(MemoryRegionSection *section,
9ae3a8
                 j = ffsl(c) - 1;
9ae3a8
                 c &= ~(1ul << j);
9ae3a8
                 page_number = (i * HOST_LONG_BITS + j) * hpratio;
9ae3a8
-                addr1 = page_number * TARGET_PAGE_SIZE;
9ae3a8
-                addr = section->offset_within_region + addr1;
9ae3a8
-                ram_addr = section->mr->ram_addr + addr;
9ae3a8
+                addr = page_number * TARGET_PAGE_SIZE;
9ae3a8
+                ram_addr = start + addr;
9ae3a8
                 cpu_physical_memory_set_dirty_range(ram_addr,
9ae3a8
                                                     TARGET_PAGE_SIZE * hpratio);
9ae3a8
             } while (c != 0);
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8