xemu/include/migration
Dr. David Alan Gilbert f68945d42b Add a protective section footer
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 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.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2015-06-12 06:54:01 +02:00
..
block.h migration: move include files to include/migration/ 2012-12-19 08:31:32 +01:00
migration.h Add a protective section footer 2015-06-12 06:54:01 +02:00
page_cache.h xbzrle: optimize XBZRLE to decrease the cache misses 2015-01-15 17:49:43 +05:30
qemu-file.h Move copy out of qemu_peek_buffer 2015-06-12 06:54:01 +02:00
vmstate.h Move loadvm_handlers into MigrationIncomingState 2015-06-12 06:54:01 +02:00