* Alexander Graf (ag...@suse.de) wrote:
> The configuration section has a new subsection to transmit the target page
> size along with the migration stream. The analyze migration script needs
> to learn about that to read configuration streams that were triggering
> this subsection to get transmitted.
> 
> With this patch applied, I can successfully analyze migration streams
> on AArch64 again.
> 
> Signed-off-by: Alexander Graf <ag...@suse.de>
> ---
>  scripts/analyze-migration.py | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
> index 1455387..02784f2 100755
> --- a/scripts/analyze-migration.py
> +++ b/scripts/analyze-migration.py
> @@ -254,12 +254,25 @@ class HTABSection(object):

(Note I'm not a particularly python person, so take lightly)

>  class ConfigurationSection(object):
> +    QEMU_VM_SUBSECTION    = 0x05
> +

It's odd, you already have this constant defined twice in this script.

>      def __init__(self, file):
>          self.file = file
>  
>      def read(self):
>          name_len = self.file.read32()
>          name = self.file.readstr(len = name_len)
> +        oldpos = self.file.tell()
> +        if self.file.read8() == self.QEMU_VM_SUBSECTION:
> +            name = self.file.readstr()
> +            version_id = self.file.read32()
> +            if name == "configuration/target-page-bits":
> +                target_page_size = self.file.read32()

All of your other references to target_page_size in the script
are self.TARGET_PAGE_SIZE.

You might want to make the conditional subsection check into a function
somewhere, but that's OK for now.

Dave

> +            else:
> +                raise Exception("Unknown config subsection: %s" % name)
> +        else:
> +            # No subsection following, forget that we ever read anything
> +            self.file.seek(oldpos)
>  
>  class VMSDFieldGeneric(object):
>      def __init__(self, desc, file):
> -- 
> 1.8.5.6
> 
--
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK

Reply via email to