[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/19] migration: Add pss_init()
From: |
Juan Quintela |
Subject: |
[PULL 14/19] migration: Add pss_init() |
Date: |
Thu, 15 Dec 2022 10:38:44 +0100 |
From: Peter Xu <peterx@redhat.com>
Helper to init PSS structures.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/ram.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 571d780987..d81bf7b183 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -542,6 +542,14 @@ static bool do_compress_ram_page(QEMUFile *f, z_stream
*stream, RAMBlock *block,
static void postcopy_preempt_restore(RAMState *rs, PageSearchStatus *pss,
bool postcopy_requested);
+/* NOTE: page is the PFN not real ram_addr_t. */
+static void pss_init(PageSearchStatus *pss, RAMBlock *rb, ram_addr_t page)
+{
+ pss->block = rb;
+ pss->page = page;
+ pss->complete_round = false;
+}
+
static void *do_data_compress(void *opaque)
{
CompressParam *param = opaque;
@@ -2650,9 +2658,7 @@ static int ram_find_and_save_block(RAMState *rs)
rs->last_page = 0;
}
- pss.block = rs->last_seen_block;
- pss.page = rs->last_page;
- pss.complete_round = false;
+ pss_init(&pss, rs->last_seen_block, rs->last_page);
do {
again = true;
--
2.38.1
- [PULL 03/19] migration: Export ram_transferred_ram(), (continued)
- [PULL 03/19] migration: Export ram_transferred_ram(), Juan Quintela, 2022/12/15
- [PULL 05/19] migration: Take bitmap mutex when completing ram migration, Juan Quintela, 2022/12/15
- [PULL 06/19] migration: Add postcopy_preempt_active(), Juan Quintela, 2022/12/15
- [PULL 07/19] migration: Cleanup xbzrle zero page cache update logic, Juan Quintela, 2022/12/15
- [PULL 08/19] migration: Trivial cleanup save_page_header() on same block check, Juan Quintela, 2022/12/15
- [PULL 09/19] migration: Remove RAMState.f references in compression code, Juan Quintela, 2022/12/15
- [PULL 11/19] migration: Use atomic ops properly for page accountings, Juan Quintela, 2022/12/15
- [PULL 12/19] migration: Teach PSS about host page, Juan Quintela, 2022/12/15
- [PULL 10/19] migration: Yield bitmap_mutex properly when sending/sleeping, Juan Quintela, 2022/12/15
- [PULL 13/19] migration: Introduce pss_channel, Juan Quintela, 2022/12/15
- [PULL 14/19] migration: Add pss_init(),
Juan Quintela <=
- [PULL 15/19] migration: Make PageSearchStatus part of RAMState, Juan Quintela, 2022/12/15
- [PULL 16/19] migration: Move last_sent_block into PageSearchStatus, Juan Quintela, 2022/12/15
- [PULL 17/19] migration: Send requested page directly in rp-return thread, Juan Quintela, 2022/12/15
- [PULL 18/19] migration: Remove old preempt code around state maintainance, Juan Quintela, 2022/12/15
- [PULL 19/19] migration: Drop rs->f, Juan Quintela, 2022/12/15
- Re: [PULL 00/19] Next 8.0 patches, Peter Maydell, 2022/12/15