hbitmap: serialization
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 13 Oct 2016 21:58:27 +0000 (17:58 -0400)
committerMax Reitz <mreitz@redhat.com>
Mon, 24 Oct 2016 15:56:07 +0000 (17:56 +0200)
commit8258888e222ff03bf791d81a0001cdc40b878de4
tree3cf4e8386cec474e510d8e2dfe8c8e7cdbbe2134
parent7105007a5c8ae6228d78487e1e382d53863ab2c9
hbitmap: serialization

Functions to serialize / deserialize(restore) HBitmap. HBitmap should be
saved to linear sequence of bits independently of endianness and bitmap
array element (unsigned long) size. Therefore Little Endian is chosen.

These functions are appropriate for dirty bitmap migration, restoring
the bitmap in several steps is available. To save performance, every
step writes only the last level of the bitmap. All other levels are
restored by hbitmap_deserialize_finish() as a last step of restoring.
So, HBitmap is inconsistent while restoring.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
[Fix left shift operand to 1UL; add "finish" parameter. - Fam]
Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1476395910-8697-8-git-send-email-jsnow@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
include/qemu/hbitmap.h
util/hbitmap.c