]> git.proxmox.com Git - mirror_qemu.git/commit
migration: Fix analyze-migration.py when ignore-shared is used
authorFabiano Rosas <farosas@suse.de>
Mon, 9 Oct 2023 18:43:24 +0000 (15:43 -0300)
committerJuan Quintela <quintela@redhat.com>
Tue, 17 Oct 2023 07:14:32 +0000 (09:14 +0200)
commitff40c7f0b787f47cf767b39a3226a113c06930f2
treeb2f0f921b6b531ff4cec48c16088e6e5d940baa1
parent31499a9dc1910d695d7df4145a30e3b9ddedf8fe
migration: Fix analyze-migration.py when ignore-shared is used

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>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231009184326.15777-5-farosas@suse.de>
scripts/analyze-migration.py