[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 21/33] migration/postcopy: use QEMU_IS_ALIGNED to rep
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 21/33] migration/postcopy: use QEMU_IS_ALIGNED to replace host_offset |
Date: |
Thu, 15 Aug 2019 17:34:52 +0100 |
From: Wei Yang <address@hidden>
Use QEMU_IS_ALIGNED for the check, it would be more consistent with
other align calculations.
Signed-off-by: Wei Yang <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Dr. David Alan Gilbert <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/ram.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index d2184c3cfc..eee68a7991 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -2955,14 +2955,12 @@ static void
postcopy_chunk_hostpages_pass(MigrationState *ms, bool unsent_pass,
}
while (run_start < pages) {
- unsigned long host_offset;
/*
* If the start of this run of pages is in the middle of a host
* page, then we need to fixup this host page.
*/
- host_offset = run_start % host_ratio;
- if (!host_offset) {
+ if (QEMU_IS_ALIGNED(run_start, host_ratio)) {
/* Find the end of this run */
if (unsent_pass) {
run_start = find_next_bit(unsentmap, pages, run_start + 1);
@@ -2974,10 +2972,9 @@ static void postcopy_chunk_hostpages_pass(MigrationState
*ms, bool unsent_pass,
* run doesn't finish at the end of a host page
* and we need to discard.
*/
- host_offset = run_start % host_ratio;
}
- if (host_offset) {
+ if (!QEMU_IS_ALIGNED(run_start, host_ratio)) {
unsigned long page;
unsigned long fixup_start_addr = QEMU_ALIGN_DOWN(run_start,
host_ratio);
--
2.21.0
- [Qemu-devel] [PULL 11/33] migration/savevm: move non SaveStateEntry condition check out of iteration, (continued)
- [Qemu-devel] [PULL 11/33] migration/savevm: move non SaveStateEntry condition check out of iteration, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 12/33] migration/postcopy: PostcopyState is already set in loadvm_postcopy_handle_advise(), Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 13/33] migration/postcopy: start_postcopy could be true only when migrate_postcopy() return true, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 14/33] migration: use migration_in_postcopy() to check POSTCOPY_ACTIVE, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 15/33] migration: just pass RAMBlock is enough, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 17/33] migration: return -EINVAL directly when version_id mismatch, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 16/33] migration: equation is more proper than and to check LOADVM_QUIT, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 18/33] migration: extract ram_load_precopy, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 19/33] migration/postcopy: make PostcopyDiscardState a static variable, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 20/33] migration/postcopy: simplify calculation of run_start and fixup_start_addr, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 21/33] migration/postcopy: use QEMU_IS_ALIGNED to replace host_offset,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 22/33] hmp: Remove migration capabilities from "info migrate", Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 23/33] migration: remove unused field bytes_xfer, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 24/33] migration: always initialise ram_counters for a new migration, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 25/33] migration: add qemu_file_update_transfer interface, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 26/33] migration: add speed limit for multifd migration, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 27/33] migration: update ram_counters for multifd sync packet, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 28/33] migration: rename migration_bitmap_sync_range to ramblock_sync_dirty_bitmap, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 30/33] qemu-file: move qemu_{get, put}_counted_string() declarations, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 29/33] migration/postcopy: use mis->bh instead of allocating a QEMUBH, Dr. David Alan Gilbert (git), 2019/08/15
- [Qemu-devel] [PULL 31/33] migration: Add traces for multifd terminate threads, Dr. David Alan Gilbert (git), 2019/08/15