mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
block: Use bdrv_has_zero_init_truncate()
vhdx and parallels call bdrv_has_zero_init() when they do not really care about an image's post-create state but only about what happens when you grow an image. That is a bit ugly, and also overly safe when growing preallocated images without preallocating the new areas. Let them use bdrv_has_zero_init_truncate() instead. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190724171239.8764-6-mreitz@redhat.com Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> [mreitz: Added commit message] Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
1dcaf52760
commit
b647d69adc
2 changed files with 2 additions and 2 deletions
|
@ -1282,7 +1282,7 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num,
|
|||
/* Queue another write of zero buffers if the underlying file
|
||||
* does not zero-fill on file extension */
|
||||
|
||||
if (bdrv_has_zero_init(bs->file->bs) == 0) {
|
||||
if (bdrv_has_zero_init_truncate(bs->file->bs) == 0) {
|
||||
use_zero_buffers = true;
|
||||
|
||||
/* zero fill the front, if any */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue