[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/13] arch_init: Count the total number of pages by
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PULL 08/13] arch_init: Count the total number of pages by using helper function |
Date: |
Tue, 17 Mar 2015 16:30:30 +0100 |
From: zhanghailiang <address@hidden>
There is already a helper function ram_bytes_total(), we can use it to
help counting the total number of pages used by ram blocks.
Signed-off-by: zhanghailiang <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
arch_init.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/arch_init.c b/arch_init.c
index c3f7d3f..fcfa328 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -895,13 +895,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque)
* Count the total number of pages used by ram blocks not including any
* gaps due to alignment or unplugs.
*/
- migration_dirty_pages = 0;
- QLIST_FOREACH_RCU(block, &ram_list.blocks, next) {
- uint64_t block_pages;
-
- block_pages = block->used_length >> TARGET_PAGE_BITS;
- migration_dirty_pages += block_pages;
- }
+ migration_dirty_pages = ram_bytes_total() >> TARGET_PAGE_BITS;
memory_global_dirty_log_start();
migration_bitmap_sync();
--
2.1.0
- [Qemu-devel] [PULL 06/13] Warn against the use of the string as uri parameter to migrate-incoming, (continued)
- [Qemu-devel] [PULL 06/13] Warn against the use of the string as uri parameter to migrate-incoming, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 02/13] migration/rdma: clean up qemu_rdma_dest_init a bit, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 04/13] migration: Fix remaining 32 bit compiler errors, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 05/13] migrate_incoming: use hmp_handle_error, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 07/13] migrate_incoming: Cleanup/clarify error messages, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 10/13] migration: Rename abbreviated macro MIG_STATE_* to MIGRATION_STATUS_*, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 09/13] migration: Remove unused functions, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 12/13] migration: Convert 'status' of MigrationInfo to use an enum type, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 11/13] hmp: Rename 'MigrationStatus' to 'HMPMigrationStatus', Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 13/13] migration: Expose 'cancelling' status to user, Juan Quintela, 2015/03/17
- [Qemu-devel] [PULL 08/13] arch_init: Count the total number of pages by using helper function,
Juan Quintela <=
- Re: [Qemu-devel] [PULL 00/13] migration pull queue, Peter Maydell, 2015/03/17