diff options
author | Kevin Wolf <kwolf@redhat.com> | 2020-04-24 16:27:01 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-04-30 17:51:07 +0200 |
commit | eb8a0cf3ba26611f3981f8f45ac6a868975a68cc (patch) | |
tree | 4b8711b089ae88ba8166f9881f83ac3ffb1092b5 /hw/xtensa | |
parent | bf03dede475e29a16f9188ea85a4d77cd3dcf2b7 (diff) | |
download | qemu-eb8a0cf3ba26611f3981f8f45ac6a868975a68cc.zip |
qcow2: Forward ZERO_WRITE flag for full preallocation
The BDRV_REQ_ZERO_WRITE is currently implemented in a way that first the
image is possibly preallocated and then the zero flag is added to all
clusters. This means that a copy-on-write operation may be needed when
writing to these clusters, despite having used preallocation, negating
one of the major benefits of preallocation.
Instead, try to forward the BDRV_REQ_ZERO_WRITE to the protocol driver,
and if the protocol driver can ensure that the new area reads as zeros,
we can skip setting the zero flag in the qcow2 layer.
Unfortunately, the same approach doesn't work for metadata
preallocation, so we'll still set the zero flag there.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200424142701.67053-1-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/xtensa')
0 files changed, 0 insertions, 0 deletions