Message ID | 20230613145757.10131-16-quintela@redhat.com |
---|---|
State | New |
Headers | show |
Series | Migration compression cleanup | expand |
On Tue, 13 Jun 2023 16:57:54 +0200 Juan Quintela <quintela@redhat.com> wrote: > Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Lukas Straub <lukasstraub2@web.de> > --- > migration/ram.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 1bd586c23a..e3ff98a6ce 100644 > --- a/migration/ram.c > +++ b/migration/ram.c > @@ -1986,7 +1986,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) > * paths to handle it > */ > static bool save_compress_page(RAMState *rs, PageSearchStatus *pss, > - RAMBlock *block, ram_addr_t offset) > + ram_addr_t offset) > { > if (!migrate_compress()) { > return false; > @@ -2002,12 +2002,13 @@ static bool save_compress_page(RAMState *rs, PageSearchStatus *pss, > * We post the fist page as normal page as compression will take > * much CPU resource. > */ > - if (block != pss->last_sent_block) { > + if (pss->block != pss->last_sent_block) { > ram_flush_compressed_data(); > return false; > } > > - return compress_page_with_multi_thread(block, offset, send_queued_data); > + return compress_page_with_multi_thread(pss->block, offset, > + send_queued_data); > } > > /** > @@ -2028,7 +2029,7 @@ static int ram_save_target_page_legacy(RAMState *rs, PageSearchStatus *pss) > return res; > } > > - if (save_compress_page(rs, pss, block, offset)) { > + if (save_compress_page(rs, pss, offset)) { > return 1; > } >
diff --git a/migration/ram.c b/migration/ram.c index 1bd586c23a..e3ff98a6ce 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -1986,7 +1986,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) * paths to handle it */ static bool save_compress_page(RAMState *rs, PageSearchStatus *pss, - RAMBlock *block, ram_addr_t offset) + ram_addr_t offset) { if (!migrate_compress()) { return false; @@ -2002,12 +2002,13 @@ static bool save_compress_page(RAMState *rs, PageSearchStatus *pss, * We post the fist page as normal page as compression will take * much CPU resource. */ - if (block != pss->last_sent_block) { + if (pss->block != pss->last_sent_block) { ram_flush_compressed_data(); return false; } - return compress_page_with_multi_thread(block, offset, send_queued_data); + return compress_page_with_multi_thread(pss->block, offset, + send_queued_data); } /** @@ -2028,7 +2029,7 @@ static int ram_save_target_page_legacy(RAMState *rs, PageSearchStatus *pss) return res; } - if (save_compress_page(rs, pss, block, offset)) { + if (save_compress_page(rs, pss, offset)) { return 1; }
Signed-off-by: Juan Quintela <quintela@redhat.com> --- migration/ram.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)