qemu/block
Eric Blake ef893b5c84 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>
2020-05-19 10:32:14 -05:00
..
monitor Use &error_abort instead of separate assert() 2020-03-17 16:05:40 +01:00
accounting.c block: add empty account cookie type 2019-10-10 10:56:18 +02:00
aio_task.c block: introduce aio task pool 2019-10-10 10:56:17 +02:00
backup-top.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
backup-top.h block: introduce backup-top filter driver 2019-10-10 10:56:18 +02:00
backup.c backup: Make sure that source and target size match 2020-05-08 13:26:35 +02:00
blkdebug.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
blklogwrites.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
blkreplay.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
blkverify.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
block-backend.c block: Pass BdrvChildRole in remaining cases 2020-05-18 19:05:25 +02:00
block-copy.c block/block-copy: Simplify block_copy_do_copy() 2020-05-18 19:05:25 +02:00
bochs.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
cloop.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
commit.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
copy-on-read.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
create.c block/create: Do not abort if a block driver is not available 2019-09-13 12:18:37 +02:00
crypto.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
crypto.h Clean up ill-advised or unusual header guards 2019-05-13 08:58:55 +02:00
curl.c block/curl: HTTP header field names are case insensitive 2020-03-11 12:42:29 +01:00
dirty-bitmap.c block: Make it easier to learn which BDS support bitmaps 2020-05-19 10:32:14 -05:00
dmg-bz2.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
dmg-lzfse.c block: adding lzfse decompressing support as a module. 2018-12-14 11:52:40 +01:00
dmg.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
dmg.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
file-posix.c block: Drop unused .bdrv_has_zero_init_truncate 2020-05-08 13:26:35 +02:00
file-win32.c block: Drop unused .bdrv_has_zero_init_truncate 2020-05-08 13:26:35 +02:00
filter-compress.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
gluster.c gluster: Drop useless has_zero_init callback 2020-05-08 13:26:35 +02:00
io.c block: Rename BdrvChildRole to BdrvChildClass 2020-05-18 19:05:25 +02:00
io_uring.c block/io_uring: Remove superfluous semicolon 2020-02-18 10:54:02 +01:00
iscsi-opts.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
iscsi.c lockable: replaced locks with lock guard macros where appropriate 2020-05-04 16:07:43 +01:00
linux-aio.c misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
Makefile.objs monitor/hmp: rename device-hotplug.c to block/monitor/block-hmp-cmds.c 2020-03-09 18:05:31 +00:00
mirror.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
nbd.c block/nbd-client: drop max_block restriction from discard 2020-05-04 15:16:46 -05:00
nfs.c block: Drop unused .bdrv_has_zero_init_truncate 2020-05-08 13:26:35 +02:00
null.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
nvme.c Compress lines for immediate return 2020-05-04 14:43:22 +02:00
parallels.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
parallels.h Clean up includes 2018-02-09 05:05:11 +01:00
qapi-sysemu.c block: Move system emulator QMP commands to block/qapi-sysemu.c 2020-03-06 17:15:38 +01:00
qapi.c block: Fix VM size field width in snapshot dump 2020-02-20 16:43:42 +01:00
qcow.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
qcow2-bitmap.c block: Make it easier to learn which BDS support bitmaps 2020-05-19 10:32:14 -05:00
qcow2-cache.c core: replace getpagesize() with qemu_real_host_page_size 2019-10-26 15:38:06 +02:00
qcow2-cluster.c qcow2: Support BDRV_REQ_ZERO_WRITE for truncate 2020-04-30 17:51:07 +02:00
qcow2-refcount.c block: Comment cleanups 2020-05-05 13:17:36 +02:00
qcow2-snapshot.c qcow2: Allow resize of images with internal snapshots 2020-05-05 13:17:36 +02:00
qcow2-threads.c qcow2: add zstd cluster compression 2020-05-13 14:20:31 +02:00
qcow2.c block: Make it easier to learn which BDS support bitmaps 2020-05-19 10:32:14 -05:00
qcow2.h block: Make it easier to learn which BDS support bitmaps 2020-05-19 10:32:14 -05:00
qed-check.c block/qed: add missed coroutine_fn markers 2019-04-30 15:29:00 +02:00
qed-cluster.c qed: protect table cache with CoMutex 2017-07-17 11:34:11 +08:00
qed-l2-cache.c qed: protect table cache with CoMutex 2017-07-17 11:34:11 +08:00
qed-table.c block/qed: add missed coroutine_fn markers 2019-04-30 15:29:00 +02:00
qed.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
qed.h block/qed: add missed coroutine_fn markers 2019-04-30 15:29:00 +02:00
quorum.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
raw-format.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
rbd.c block: Drop unused .bdrv_has_zero_init_truncate 2020-05-08 13:26:35 +02:00
replication.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
sheepdog.c block: Drop unused .bdrv_has_zero_init_truncate 2020-05-08 13:26:35 +02:00
snapshot.c block/snapshot: rename Error ** parameter to more common errp 2019-12-18 08:43:19 +01:00
ssh.c block: Drop unused .bdrv_has_zero_init_truncate 2020-05-08 13:26:35 +02:00
stream.c block/stream: Remove redundant statement in stream_run() 2020-03-09 15:59:31 +01:00
throttle-groups.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
throttle.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
trace-events block/block-copy: use block_status 2020-03-11 12:42:30 +01:00
vdi.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
vhdx-endian.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
vhdx-log.c block: Add flags to bdrv(_co)_truncate() 2020-04-30 17:51:07 +02:00
vhdx.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
vhdx.h block/vhdx: Use IEC binary prefixes for size constants 2019-04-30 15:29:00 +02:00
vmdk.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
vpc.c block: Use bdrv_default_perms() 2020-05-18 19:05:25 +02:00
vvfat.c block: Drop @child_class from bdrv_child_perm() 2020-05-18 19:05:25 +02:00
vxhs.c replay: add BH oneshot event for block layer 2019-10-14 17:12:48 +02:00
win32-aio.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
write-threshold.c qapi: Drop qapi_event_send_FOO()'s Error ** argument 2018-08-28 18:21:38 +02:00