From b647d69adc394312dedb56f6b3ce19b9c316931f Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Wed, 24 Jul 2019 19:12:33 +0200 Subject: 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 Message-id: 20190724171239.8764-6-mreitz@redhat.com Reviewed-by: Maxim Levitsky Reviewed-by: Stefano Garzarella [mreitz: Added commit message] Signed-off-by: Max Reitz --- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/parallels.c') diff --git a/block/parallels.c b/block/parallels.c index 00fae125d1..7cd2714b69 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -835,7 +835,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, goto fail_options; } - if (!bdrv_has_zero_init(bs->file->bs)) { + if (!bdrv_has_zero_init_truncate(bs->file->bs)) { s->prealloc_mode = PRL_PREALLOC_MODE_FALLOCATE; } -- cgit v1.2.3