qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	Juan Quintela <quintela@redhat.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] migration: fix analyze-migration.py script with radix table
Date: Tue, 5 Dec 2017 20:48:05 +0100	[thread overview]
Message-ID: <20171205204805.0f854dc8@bahia.lan> (raw)
In-Reply-To: <20171205122740.15005-1-lvivier@redhat.com>

On Tue,  5 Dec 2017 13:27:40 +0100
Laurent Vivier <lvivier@redhat.com> wrote:

> Since commit 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream")
> the HTAB migration stream contains a header set to "-1", meaning there
> is no HPT. Teach analyze-migration.py to ignore the section in this case.
> 
> Without this fix, the script fails with a dump from a POWER9 guest:
> 
> Traceback (most recent call last):
>   File "./qemu/scripts/analyze-migration.py", line 602, in <module>
>     dump.read(dump_memory = args.memory)
>   File "./qemu/scripts/analyze-migration.py", line 539, in read
>     section.read()
>   File "./qemu/scripts/analyze-migration.py", line 250, in read
>     self.file.readvar(n_valid * self.HASH_PTE_SIZE_64)
>   File "./qemu/scripts/analyze-migration.py", line 64, in readvar
>     raise Exception("Unexpected end of %s at 0x%x" % (self.filename, self.file.tell()))
> Exception: Unexpected end of migrate.dump at 0x1d4763ba
> 
> Fixes: 3a38429748 ("Add a "no HPT" encoding to HTAB migration stream")
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---

Reviewed-by: Greg Kurz <groug@kaod.org>

>  scripts/analyze-migration.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
> index 14553876a2..88ff4adb30 100755
> --- a/scripts/analyze-migration.py
> +++ b/scripts/analyze-migration.py
> @@ -234,6 +234,10 @@ class HTABSection(object):
>  
>          header = self.file.read32()
>  
> +        if (header == -1):
> +            # "no HPT" encoding
> +            return
> +
>          if (header > 0):
>              # First section, just the hash shift
>              return

      parent reply	other threads:[~2017-12-05 19:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 12:27 [Qemu-devel] [PATCH] migration: fix analyze-migration.py script with radix table Laurent Vivier
2017-12-05 12:44 ` Dr. David Alan Gilbert
2017-12-05 13:04   ` David Gibson
2017-12-05 13:14     ` Dr. David Alan Gilbert
2017-12-05 19:48 ` Greg Kurz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171205204805.0f854dc8@bahia.lan \
    --to=groug@kaod.org \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).