diff options
author | Eric Blake <eblake@redhat.com> | 2020-05-12 20:16:42 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2020-05-19 10:32:14 -0500 |
commit | ef893b5c84f3199d777e33966dc28839f71b1a5c (patch) | |
tree | 3241a6d374a143be1f250e656ac9ff4c2d86ebd0 /block/qcow2.h | |
parent | 0562adf51712c3c0354d68e745afb7e6705668f1 (diff) | |
download | qemu-ef893b5c84f3199d777e33966dc28839f71b1a5c.zip qemu-ef893b5c84f3199d777e33966dc28839f71b1a5c.tar.gz qemu-ef893b5c84f3199d777e33966dc28839f71b1a5c.tar.bz2 |
block: Make it easier to learn which BDS support bitmaps
Upcoming patches will enhance bitmap support in qemu-img, but in doing
so, it turns out to be nice to suppress output when persistent bitmaps
make no sense (such as on a qcow2 v2 image). Add a hook to make this
easier to query.
This patch adds a new callback .bdrv_supports_persistent_dirty_bitmap,
rather than trying to shoehorn the answer in via existing callbacks.
In particular, while it might have been possible to overload
.bdrv_co_can_store_new_dirty_bitmap to special-case a NULL input to
answer whether any persistent bitmaps are supported, that is at odds
with whether a particular bitmap can be stored (for example, even on
an image that supports persistent bitmaps but has currently filled up
the maximum number of bitmaps, attempts to store another one should
fail); and the new functionality doesn't require coroutine safety.
Similarly, we could have added one more piece of information to
.bdrv_get_info, but then again, most callers to that function tend to
already discard extraneous information, and making it a catch-all
rather than a series of dedicated scalar queries hasn't really
simplified life.
In the future, when we improve the ability to look up bitmaps through
a filter, we will probably also want to teach the block layer to
automatically let filters pass this request on through.
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200513011648.166876-4-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'block/qcow2.h')
-rw-r--r-- | block/qcow2.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.h b/block/qcow2.h index 6a8b82e..402e8ac 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -782,6 +782,7 @@ bool qcow2_co_can_store_new_dirty_bitmap(BlockDriverState *bs, int qcow2_co_remove_persistent_dirty_bitmap(BlockDriverState *bs, const char *name, Error **errp); +bool qcow2_supports_persistent_dirty_bitmap(BlockDriverState *bs); ssize_t coroutine_fn qcow2_co_compress(BlockDriverState *bs, void *dest, size_t dest_size, |