migration/block-dirty-bitmap: relax error handling in incoming part
commitb91f33b81df7439ac504f4737c3e529ec2bf0525
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 27 Jul 2020 19:42:30 +0000 (27 22:42 +0300)
committerEric Blake <eblake@redhat.com>
Mon, 27 Jul 2020 20:40:14 +0000 (27 15:40 -0500)
tree7192456d1f847bac91f2c31ef48fa1aaa6708c37
parent0a47190a009614598dc5ae3d9d25138575184520
migration/block-dirty-bitmap: relax error handling in incoming part

Bitmaps data is not critical, and we should not fail the migration (or
use postcopy recovering) because of dirty-bitmaps migration failure.
Instead we should just lose unfinished bitmaps.

Still we have to report io stream violation errors, as they affect the
whole migration stream.

While touching this, tighten code that was previously blindly calling
malloc on a size read from the migration stream, as a corrupted stream
(perhaps from a malicious user) should not be able to convince us to
allocate an inordinate amount of memory.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200727194236.19551-16-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: typo fixes, enhance commit message]
Signed-off-by: Eric Blake <eblake@redhat.com>
migration/block-dirty-bitmap.c