qemu/include
Eric Blake 86a3d5c688 block: Add .bdrv_co_block_status() callback
We are gradually moving away from sector-based interfaces, towards
byte-based. Now that the block layer exposes byte-based allocation,
it's time to tackle the drivers.  Add a new callback that operates
on as small as byte boundaries. Subsequent patches will then update
individual drivers, then finally remove .bdrv_co_get_block_status().

The new code also passes through the 'want_zero' hint, which will
allow subsequent patches to further optimize callers that only care
about how much of the image is allocated (want_zero is false),
rather than full details about runs of zeroes and which offsets the
allocation actually maps to (want_zero is true).  As part of this
effort, fix another part of the documentation: the claim in commit
4c41cb4 that BDRV_BLOCK_ALLOCATED is short for 'DATA || ZERO' is a
lie at the block layer (see commit e88ae2264), even though it is
how the bit is computed from the driver layer.  After all, there
are intentionally cases where we return ZERO but not ALLOCATED at
the block layer, when we know that a read sees zero because the
backing file is too short.  Note that the driver interface is thus
slightly different than the public interface with regards to which
bits will be set, and what guarantees are provided on input.

We also add an assertion that any driver using the new callback will
make progress (the only time pnum will be 0 is if the block layer
already handled an out-of-bounds request, or if there is an error);
the old driver interface did not provide this guarantee, which
could lead to some inf-loops in drastic corner-case failures.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-03-02 18:39:07 +01:00
..
block block: Add .bdrv_co_block_status() callback 2018-03-02 18:39:07 +01:00
chardev Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
crypto Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
disas target/xtensa: implement disassembler 2018-01-09 09:55:39 -08:00
exec include/exec/helper-head.h: support f16 in helper calls 2018-03-01 11:13:59 +00:00
fpu arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16 2018-03-01 11:13:59 +00:00
hw hw/arm/iotkit: Model Arm IOT Kit 2018-03-02 11:03:45 +00:00
io io: Fix QIOChannelFile when creating and opening read-write 2018-02-15 16:54:57 +00:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration virtio,vhost,pci,pc: features, fixes and cleanups 2018-02-13 16:33:31 +00:00
monitor Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
net net/can: simple messages transport implementation for QEMU 2018-02-13 11:44:13 +01:00
qapi Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
qemu fpu/softfloat-types: new header to prevent excessive re-builds 2018-02-21 10:20:19 +00:00
qom Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
scsi Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
standard-headers virtio-gpu-3d: add support for second capability set (v4) 2018-02-26 13:41:34 +01:00
sysemu cryptodev-vhost-user: set the key length 2018-03-01 18:26:17 +02:00
ui console/opengl: split up dpy_gl_cursor ops 2018-02-22 10:35:00 +01:00
elf.h linux-user: MIPS set cpu to r6 CPU if binary is R6 2018-02-25 17:29:45 +01:00
glib-compat.h glib-compat: move G_SOURCE_CONTINUE/REMOVE there 2017-10-10 16:33:55 +02:00
qemu-common.h Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
qemu-io.h hmp: Request permissions in qemu-io 2017-02-28 20:47:50 +01:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00