[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 41/51] migration: Add pss_init()
From: |
Juan Quintela |
Subject: |
[PATCH v2 41/51] migration: Add pss_init() |
Date: |
Mon, 5 Dec 2022 10:52:18 +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
- Re: [PATCH v2 00/51] migration patches for VFIO, (continued)
- Re: [PATCH v2 00/51] migration patches for VFIO, Juan Quintela, 2022/12/05
- [PATCH v2 32/51] migration: Take bitmap mutex when completing ram migration, Juan Quintela, 2022/12/05
- [PATCH v2 33/51] migration: Add postcopy_preempt_active(), Juan Quintela, 2022/12/05
- [PATCH v2 34/51] migration: Cleanup xbzrle zero page cache update logic, Juan Quintela, 2022/12/05
- [PATCH v2 36/51] migration: Remove RAMState.f references in compression code, Juan Quintela, 2022/12/05
- [PATCH v2 35/51] migration: Trivial cleanup save_page_header() on same block check, Juan Quintela, 2022/12/05
- [PATCH v2 39/51] migration: Teach PSS about host page, Juan Quintela, 2022/12/05
- [PATCH v2 37/51] migration: Yield bitmap_mutex properly when sending/sleeping, Juan Quintela, 2022/12/05
- [PATCH v2 38/51] migration: Use atomic ops properly for page accountings, Juan Quintela, 2022/12/05
- [PATCH v2 40/51] migration: Introduce pss_channel, Juan Quintela, 2022/12/05
- [PATCH v2 41/51] migration: Add pss_init(),
Juan Quintela <=
- [PATCH v2 42/51] migration: Make PageSearchStatus part of RAMState, Juan Quintela, 2022/12/05
- [PATCH v2 43/51] migration: Move last_sent_block into PageSearchStatus, Juan Quintela, 2022/12/05
- [PATCH v2 44/51] migration: Send requested page directly in rp-return thread, Juan Quintela, 2022/12/05
- [PATCH v2 45/51] migration: Remove old preempt code around state maintainance, Juan Quintela, 2022/12/05
- [PATCH v2 46/51] migration: Drop rs->f, Juan Quintela, 2022/12/05
- [PATCH v2 47/51] migration: Remove res_compatible parameter, Juan Quintela, 2022/12/05
- [PATCH v2 48/51] migration: No save_live_pending() method uses the QEMUFile parameter, Juan Quintela, 2022/12/05
- [PATCH v2 50/51] migration: Remove unused threshold_size parameter, Juan Quintela, 2022/12/05
- [PATCH v2 51/51] migration: simplify migration_iteration_run(), Juan Quintela, 2022/12/05
- [PATCH v2 49/51] migration: Split save_live_pending() into state_pending_*, Juan Quintela, 2022/12/05