[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/38] migration: Fix analyze-migration.py 'configuration' parsing
From: |
Juan Quintela |
Subject: |
[PULL 06/38] migration: Fix analyze-migration.py 'configuration' parsing |
Date: |
Mon, 16 Oct 2023 12:06:34 +0200 |
From: Fabiano Rosas <farosas@suse.de>
The 'configuration' state subsections are currently not being parsed
and the script fails when analyzing an aarch64 stream:
Traceback (most recent call last):
File "./scripts/analyze-migration.py", line 625, in <module>
dump.read(dump_memory = args.memory)
File "./scripts/analyze-migration.py", line 571, in read
raise Exception("Unknown section type: %d" % section_type)
Exception: Unknown section type: 5
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-3-farosas@suse.de>
---
scripts/analyze-migration.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index 082424558b..24687db497 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -261,12 +261,21 @@ def getDict(self):
class ConfigurationSection(object):
- def __init__(self, file):
+ def __init__(self, file, desc):
self.file = file
+ self.desc = desc
def read(self):
- name_len = self.file.read32()
- name = self.file.readstr(len = name_len)
+ if self.desc:
+ version_id = self.desc['version']
+ section = VMSDSection(self.file, version_id, self.desc,
+ 'configuration')
+ section.read()
+ else:
+ # backward compatibility for older streams that don't have
+ # the configuration section in the json
+ name_len = self.file.read32()
+ name = self.file.readstr(len = name_len)
class VMSDFieldGeneric(object):
def __init__(self, desc, file):
@@ -532,7 +541,8 @@ def read(self, desc_only = False, dump_memory = False,
write_memory = False):
if section_type == self.QEMU_VM_EOF:
break
elif section_type == self.QEMU_VM_CONFIGURATION:
- section = ConfigurationSection(file)
+ config_desc = self.vmsd_desc.get('configuration')
+ section = ConfigurationSection(file, config_desc)
section.read()
elif section_type == self.QEMU_VM_SECTION_START or section_type ==
self.QEMU_VM_SECTION_FULL:
section_id = file.read32()
--
2.41.0
- [PULL 00/38] Migration 20231016 patches, Juan Quintela, 2023/10/16
- [PULL 01/38] migration: refactor migration_completion, Juan Quintela, 2023/10/16
- [PULL 02/38] migration: Use g_autofree to simplify ram_dirty_bitmap_reload(), Juan Quintela, 2023/10/16
- [PULL 03/38] migration: Allow user to specify available switchover bandwidth, Juan Quintela, 2023/10/16
- [PULL 04/38] migration: fix RAMBlock add NULL check, Juan Quintela, 2023/10/16
- [PULL 06/38] migration: Fix analyze-migration.py 'configuration' parsing,
Juan Quintela <=
- [PULL 07/38] migration: Add capability parsing to analyze-migration.py, Juan Quintela, 2023/10/16
- [PULL 05/38] migration: Add the configuration vmstate to the json writer, Juan Quintela, 2023/10/16
- [PULL 08/38] migration: Fix analyze-migration.py when ignore-shared is used, Juan Quintela, 2023/10/16
- [PULL 12/38] migration: hold the BQL during setup, Juan Quintela, 2023/10/16
- [PULL 13/38] migration: Non multifd migration don't care about multifd flushes, Juan Quintela, 2023/10/16
- [PULL 14/38] migration: Create migrate_rdma(), Juan Quintela, 2023/10/16
- [PULL 15/38] migration/rdma: Unfold ram_control_before_iterate(), Juan Quintela, 2023/10/16
- [PULL 09/38] migration: Fix analyze-migration read operation signedness, Juan Quintela, 2023/10/16
- [PULL 10/38] tests/qtest/migration: Add a test for the analyze-migration script, Juan Quintela, 2023/10/16
- [PULL 11/38] tests/qtest: migration-test: Add tests for file-based migration, Juan Quintela, 2023/10/16