[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/6] migration: Fix analyze-migration.py when ignore-share
From: |
Juan Quintela |
Subject: |
Re: [PATCH v2 4/6] migration: Fix analyze-migration.py when ignore-shared is used |
Date: |
Wed, 11 Oct 2023 15:23:48 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) |
Fabiano Rosas <farosas@suse.de> wrote:
> The script is currently broken when the x-ignore-shared capability is
> used:
>
> Traceback (most recent call last):
> File "./scripts/analyze-migration.py", line 656, in <module>
> dump.read(dump_memory = args.memory)
> File "./scripts/analyze-migration.py", line 593, in read
> section.read()
> File "./scripts/analyze-migration.py", line 163, in read
> self.name = self.file.readstr(len = namelen)
> File "./scripts/analyze-migration.py", line 53, in readstr
> return self.readvar(len).decode('utf-8')
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 55:
> invalid start byte
>
> We're currently adding data to the middle of the ram section depending
> on the presence of the capability. As a consequence, any code loading
> the ram section needs to know about capabilities so it can interpret
> the stream.
>
> Skip the byte that's added when x-ignore-shared is used to fix the
> script.
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
> @@ -582,6 +586,7 @@ def read(self, desc_only = False, dump_memory = False,
> write_memory = False):
> config_desc = self.vmsd_desc.get('configuration')
> section = ConfigurationSection(file, config_desc)
> section.read()
> + ramargs['ignore_shared'] =
> section.has_capability('x-ignore-shared')
should we consider s/x-ignore-shared/ignore-shared/?
> elif section_type == self.QEMU_VM_SECTION_START or section_type
> == self.QEMU_VM_SECTION_FULL:
> section_id = file.read32()
> name = file.readstr()