[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 26/31] ram: Remove ram_save_remaining
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 26/31] ram: Remove ram_save_remaining |
Date: |
Wed, 15 Mar 2017 14:50:16 +0100 |
Just unfold it. Move ram_bytes_remaining() with the rest of exported
functions.
Signed-off-by: Juan Quintela <address@hidden>
---
migration/ram.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 9c9533d..e7db39c 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -237,16 +237,16 @@ uint64_t xbzrle_mig_pages_overflow(void)
return ram_state.xbzrle_overflows;
}
-static ram_addr_t ram_save_remaining(void)
-{
- return ram_state.migration_dirty_pages;
-}
-
uint64_t ram_bytes_transferred(void)
{
return ram_state.bytes_transferred;
}
+uint64_t ram_bytes_remaining(void)
+{
+ return ram_state.migration_dirty_pages * TARGET_PAGE_SIZE;
+}
+
/* used by the search for pages to send */
struct PageSearchStatus {
/* Current block being searched */
@@ -1398,11 +1398,6 @@ void acct_update_position(QEMUFile *f, size_t size, bool
zero)
}
}
-uint64_t ram_bytes_remaining(void)
-{
- return ram_save_remaining() * TARGET_PAGE_SIZE;
-}
-
uint64_t ram_bytes_total(void)
{
RAMBlock *block;
@@ -2109,7 +2104,7 @@ static void ram_save_pending(QEMUFile *f, void *opaque,
uint64_t max_size,
RAMState *rs = opaque;
uint64_t remaining_size;
- remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE;
+ remaining_size = rs->migration_dirty_pages * TARGET_PAGE_SIZE;
if (!migration_in_postcopy(migrate_get_current()) &&
remaining_size < max_size) {
@@ -2118,7 +2113,7 @@ static void ram_save_pending(QEMUFile *f, void *opaque,
uint64_t max_size,
migration_bitmap_sync(rs);
rcu_read_unlock();
qemu_mutex_unlock_iothread();
- remaining_size = ram_save_remaining() * TARGET_PAGE_SIZE;
+ remaining_size = rs->migration_dirty_pages * TARGET_PAGE_SIZE;
}
/* We can do postcopy, and all the data is postcopiable */
--
2.9.3
- [Qemu-devel] [PATCH 17/31] ram: Move xbzrle_cache_miss into RAMState, (continued)
- [Qemu-devel] [PATCH 17/31] ram: Move xbzrle_cache_miss into RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 16/31] ram: Move xbzrle_pages into RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 22/31] ram: move migration_bitmap_mutex into RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 20/31] ram: move migration_dirty_pages to RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 23/31] ram: Move migration_bitmap_rcu into RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 25/31] ram: Use the RAMState bytes_transferred parameter, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 26/31] ram: Remove ram_save_remaining,
Juan Quintela <=
- [Qemu-devel] [PATCH 27/31] ram: Move last_req_rb to RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 24/31] ram: Move bytes_transferred into RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 29/31] ram: Remove dirty_bytes_rate, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 28/31] ram: Create ram_dirty_sync_count(), Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 30/31] ram: move dirty_pages_rate to RAMState, Juan Quintela, 2017/03/15
- [Qemu-devel] [PATCH 31/31] ram: move postcopy_requests into RAMState, Juan Quintela, 2017/03/15