mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
block: drop unallocated_blocks_are_zero
Currently this field only set by qed and qcow2. But in fact, all backing-supporting formats (parallels, qcow, qcow2, qed, vmdk) share these semantics: on unallocated blocks, if there is no backing file they just memset the buffer with zeroes. So, document this behavior for .supports_backing and drop .unallocated_blocks_are_zero Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200528094405.145708-10-vsementsov@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
cdf9ebf18f
commit
a2adbbf603
5 changed files with 13 additions and 15 deletions
|
@ -123,7 +123,17 @@ struct BlockDriver {
|
|||
*/
|
||||
bool bdrv_needs_filename;
|
||||
|
||||
/* Set if a driver can support backing files */
|
||||
/*
|
||||
* Set if a driver can support backing files. This also implies the
|
||||
* following semantics:
|
||||
*
|
||||
* - Return status 0 of .bdrv_co_block_status means that corresponding
|
||||
* blocks are not allocated in this layer of backing-chain
|
||||
* - For such (unallocated) blocks, read will:
|
||||
* - fill buffer with zeros if there is no backing file
|
||||
* - read from the backing file otherwise, where the block layer
|
||||
* takes care of reading zeros beyond EOF if backing file is short
|
||||
*/
|
||||
bool supports_backing;
|
||||
|
||||
/* For handling image reopen for split or non-split files */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue