[PATCH RFC 08/15] migration: Dump ramblock and offset too when non-same-page detected

Peter Xu posted 15 patches 4 years ago
Maintainers: Juan Quintela <quintela@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Thomas Huth <thuth@redhat.com>, Markus Armbruster <armbru@redhat.com>, Eric Blake <eblake@redhat.com>, Laurent Vivier <lvivier@redhat.com>
There is a newer version of this series
[PATCH RFC 08/15] migration: Dump ramblock and offset too when non-same-page detected
Posted by Peter Xu 4 years ago
In ram_load_postcopy() we'll try to detect non-same-page case and dump error.
This error is very helpful for debugging.  Adding ramblock & offset into the
error log too.

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/ram.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/migration/ram.c b/migration/ram.c
index 930e722e39..3f823ffffc 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3705,8 +3705,12 @@ static int ram_load_postcopy(QEMUFile *f)
             } else if (tmp_page->host_addr !=
                        host_page_from_ram_block_offset(block, addr)) {
                 /* not the 1st TP within the HP */
-                error_report("Non-same host page %p/%p", tmp_page->host_addr,
-                             host_page_from_ram_block_offset(block, addr));
+                error_report("Non-same host page detected.  Target host page %p, "
+                             "received host page %p "
+                             "(rb %s offset 0x"RAM_ADDR_FMT" target_pages %d)",
+                             tmp_page->host_addr,
+                             host_page_from_ram_block_offset(block, addr),
+                             block->idstr, addr, tmp_page->target_pages);
                 ret = -EINVAL;
                 break;
             }
-- 
2.32.0


Re: [PATCH RFC 08/15] migration: Dump ramblock and offset too when non-same-page detected
Posted by Dr. David Alan Gilbert 4 years ago
* Peter Xu (peterx@redhat.com) wrote:
> In ram_load_postcopy() we'll try to detect non-same-page case and dump error.
> This error is very helpful for debugging.  Adding ramblock & offset into the
> error log too.
> 
> Signed-off-by: Peter Xu <peterx@redhat.com>

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  migration/ram.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/migration/ram.c b/migration/ram.c
> index 930e722e39..3f823ffffc 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3705,8 +3705,12 @@ static int ram_load_postcopy(QEMUFile *f)
>              } else if (tmp_page->host_addr !=
>                         host_page_from_ram_block_offset(block, addr)) {
>                  /* not the 1st TP within the HP */
> -                error_report("Non-same host page %p/%p", tmp_page->host_addr,
> -                             host_page_from_ram_block_offset(block, addr));
> +                error_report("Non-same host page detected.  Target host page %p, "
> +                             "received host page %p "
> +                             "(rb %s offset 0x"RAM_ADDR_FMT" target_pages %d)",
> +                             tmp_page->host_addr,
> +                             host_page_from_ram_block_offset(block, addr),
> +                             block->idstr, addr, tmp_page->target_pages);
>                  ret = -EINVAL;
>                  break;
>              }
> -- 
> 2.32.0
> 
-- 
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK