From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtxV3-0004TZ-K9 for qemu-devel@nongnu.org; Wed, 04 Nov 2015 07:49:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtxV0-0003iz-9T for qemu-devel@nongnu.org; Wed, 04 Nov 2015 07:49:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtxV0-0003iu-3s for qemu-devel@nongnu.org; Wed, 04 Nov 2015 07:49:10 -0500 From: Juan Quintela Date: Wed, 4 Nov 2015 13:48:57 +0100 Message-Id: <1446641337-2684-6-git-send-email-quintela@redhat.com> In-Reply-To: <1446641337-2684-1-git-send-email-quintela@redhat.com> References: <1446641337-2684-1-git-send-email-quintela@redhat.com> Subject: [Qemu-devel] [PULL 5/5] migration: fix analyze-migration.py script List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, Mark Cave-Ayland , dgilbert@redhat.com From: Mark Cave-Ayland Commit 61964 "Add configuration section" broke the analyze-migration.py script which terminates due to the unrecognised section. Fix the script by parsing the contents of the configuration section directly into a new ConfigurationSection object (although nothing is done with it yet). Signed-off-by: Mark Cave-Ayland Reviewed-by: Juan Quintela al3 Signed-off-by: Juan Quintela al3 --- scripts/analyze-migration.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py index f6894be..1455387 100755 --- a/scripts/analyze-migration.py +++ b/scripts/analyze-migration.py @@ -252,6 +252,15 @@ class HTABSection(object): def getDict(self): return "" + +class ConfigurationSection(object): + def __init__(self, file): + self.file = file + + def read(self): + name_len = self.file.read32() + name = self.file.readstr(len = name_len) + class VMSDFieldGeneric(object): def __init__(self, desc, file): self.file = file @@ -474,6 +483,7 @@ class MigrationDump(object): QEMU_VM_SECTION_FULL = 0x04 QEMU_VM_SUBSECTION = 0x05 QEMU_VM_VMDESCRIPTION = 0x06 + QEMU_VM_CONFIGURATION = 0x07 QEMU_VM_SECTION_FOOTER= 0x7e def __init__(self, filename): @@ -514,6 +524,9 @@ class MigrationDump(object): section_type = file.read8() if section_type == self.QEMU_VM_EOF: break + elif section_type == self.QEMU_VM_CONFIGURATION: + section = ConfigurationSection(file) + section.read() elif section_type == self.QEMU_VM_SECTION_START or section_type == self.QEMU_VM_SECTION_FULL: section_id = file.read32() name = file.readstr() -- 2.4.3