Files
qemu-ios/block
Max Reitz 38841dcd27 qcow2: Fix .bdrv_has_zero_init()
If a qcow2 file is preallocated, it can no longer guarantee that it
initially appears as filled with zeroes.

So implement .bdrv_has_zero_init() by checking whether the file is
preallocated; if so, forward the call to the underlying storage node,
except for when it is encrypted: Encrypted preallocated images always
return effectively random data, so .bdrv_has_zero_init() must always
return 0 for them.

.bdrv_has_zero_init_truncate() can remain bdrv_has_zero_init_1(),
because it presupposes PREALLOC_MODE_OFF.

Reported-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190724171239.8764-7-mreitz@redhat.com
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-08-19 17:13:26 +02:00
..
2019-08-16 18:29:43 -04:00
2019-08-16 13:31:52 +02:00
2019-08-19 17:13:26 +02:00
2019-08-19 17:13:26 +02:00
2019-08-16 13:31:52 +02:00
2018-02-09 05:05:11 +01:00
2019-05-28 20:30:55 +02:00
2019-08-19 17:13:26 +02:00
2019-08-15 13:22:13 -05:00
2019-06-04 15:22:22 +02:00
2019-06-04 15:22:22 +02:00