Skip to content

Commit

Permalink
Teach analyze-migration.py about section footers
Browse files Browse the repository at this point in the history
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
  • Loading branch information
dagrh authored and Juan Quintela committed Jun 12, 2015
1 parent f68945d commit 73d9a79
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/analyze-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ class MigrationDump(object):
QEMU_VM_SECTION_FULL = 0x04
QEMU_VM_SUBSECTION = 0x05
QEMU_VM_VMDESCRIPTION = 0x06
QEMU_VM_SECTION_FOOTER= 0x7e

def __init__(self, filename):
self.section_classes = { ( 'ram', 0 ) : [ RamSection, None ],
Expand Down Expand Up @@ -526,6 +527,10 @@ def read(self, desc_only = False, dump_memory = False, write_memory = False):
elif section_type == self.QEMU_VM_SECTION_PART or section_type == self.QEMU_VM_SECTION_END:
section_id = file.read32()
self.sections[section_id].read()
elif section_type == self.QEMU_VM_SECTION_FOOTER:
read_section_id = file.read32()
if read_section_id != section_id:
raise Exception("Mismatched section footer: %x vs %x" % (read_section_id, section_id))
else:
raise Exception("Unknown section type: %d" % section_type)
file.close()
Expand Down

0 comments on commit 73d9a79

Please sign in to comment.