hbitmap: Add hbitmap_is_serializable()
commit20a579de8484096d18e65751ebe63fee31551f04
authorMax Reitz <mreitz@redhat.com>
Tue, 15 Nov 2016 22:57:45 +0000 (15 23:57 +0100)
committerFam Zheng <famz@redhat.com>
Thu, 26 Jan 2017 02:25:01 +0000 (26 10:25 +0800)
treeb18432ea3cce4bb67817676b72a8c1e2ee0c3bb3
parentc7f1cf01b8245762ca5864e835d84f6677ae8b1f
hbitmap: Add hbitmap_is_serializable()

Bitmaps with a granularity of 58 or above can be neither serialized nor
deserialized (see the comment in the function added in this series for
an explanation). This patch adds a function so that we can check whether
a bitmap actually can be (de-)serialized at all, thus avoiding failing
the necessary assertion in hbitmap_serialization_granularity().

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20161115225746.3590-2-mreitz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
include/qemu/hbitmap.h
util/hbitmap.c