From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> Badly formatted migration streams can go undetected or produce misleading errors due to a lock of checking at the end of sections. In particular a section that adds an extra 0x00 at the end causes what looks like a normal end of stream and thus doesn't produce any errors, and something that ends in a 0x01..0x04 kind of look like real section headers and then fail when the section parser tries to figure out which section they are. This is made worse by the choice of 0x00..0x04 being small numbers that are particularly common in normal section data.
This patch series adds a section footer consisting of a marker (0x7e - ~) followed by the section-id that was also sent in the header. If they mismatch then it throws an error explaining which section was being loaded. The footers are tied to new machine types (on both pc types). Dr. David Alan Gilbert (4): Merge section header writing Disable section footers on older machine types Add a protective section footer Teach analyze-migration.py about section footers hw/i386/pc_piix.c | 2 + hw/i386/pc_q35.c | 2 + include/migration/migration.h | 2 + savevm.c | 141 ++++++++++++++++++++++++++++-------------- scripts/analyze-migration.py | 5 ++ 5 files changed, 107 insertions(+), 45 deletions(-) -- 2.4.1