diff mbox series

[16/18] migration: control_save_page() can take block through pss

Message ID 20230613145757.10131-17-quintela@redhat.com
State New
Headers show
Series Migration compression cleanup | expand

Commit Message

Juan Quintela June 13, 2023, 2:57 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/ram.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Lukas Straub June 22, 2023, 11:48 a.m. UTC | #1
On Tue, 13 Jun 2023 16:57:55 +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 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/migration/ram.c b/migration/ram.c
> index e3ff98a6ce..293ea87a70 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -1114,14 +1114,14 @@ static int save_zero_page(PageSearchStatus *pss, QEMUFile *f, RAMBlock *block,
>   *
>   * Return true if the pages has been saved, otherwise false is returned.
>   */
> -static bool control_save_page(PageSearchStatus *pss, RAMBlock *block,
> +static bool control_save_page(PageSearchStatus *pss,
>                                ram_addr_t offset, int *pages)
>  {
>      uint64_t bytes_xmit = 0;
>      int ret;
>
>      *pages = -1;
> -    ret = ram_control_save_page(pss->pss_channel, block->offset, offset,
> +    ret = ram_control_save_page(pss->pss_channel, pss->block->offset, offset,
>                                  TARGET_PAGE_SIZE, &bytes_xmit);
>      if (ret == RAM_SAVE_CONTROL_NOT_SUPP) {
>          return false;
> @@ -2025,7 +2025,7 @@ static int ram_save_target_page_legacy(RAMState *rs, PageSearchStatus *pss)
>      ram_addr_t offset = ((ram_addr_t)pss->page) << TARGET_PAGE_BITS;
>      int res;
>
> -    if (control_save_page(pss, block, offset, &res)) {
> +    if (control_save_page(pss, offset, &res)) {
>          return res;
>      }
>
diff mbox series

Patch

diff --git a/migration/ram.c b/migration/ram.c
index e3ff98a6ce..293ea87a70 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1114,14 +1114,14 @@  static int save_zero_page(PageSearchStatus *pss, QEMUFile *f, RAMBlock *block,
  *
  * Return true if the pages has been saved, otherwise false is returned.
  */
-static bool control_save_page(PageSearchStatus *pss, RAMBlock *block,
+static bool control_save_page(PageSearchStatus *pss,
                               ram_addr_t offset, int *pages)
 {
     uint64_t bytes_xmit = 0;
     int ret;
 
     *pages = -1;
-    ret = ram_control_save_page(pss->pss_channel, block->offset, offset,
+    ret = ram_control_save_page(pss->pss_channel, pss->block->offset, offset,
                                 TARGET_PAGE_SIZE, &bytes_xmit);
     if (ret == RAM_SAVE_CONTROL_NOT_SUPP) {
         return false;
@@ -2025,7 +2025,7 @@  static int ram_save_target_page_legacy(RAMState *rs, PageSearchStatus *pss)
     ram_addr_t offset = ((ram_addr_t)pss->page) << TARGET_PAGE_BITS;
     int res;
 
-    if (control_save_page(pss, block, offset, &res)) {
+    if (control_save_page(pss, offset, &res)) {
         return res;
     }