Skip to content
  • Kevin Wolf's avatar
    c9fdcf20
    qemu-img: Use BDRV_REQ_NO_FALLBACK for pre-zeroing · c9fdcf20
    Kevin Wolf authored
    
    
    If qemu-img convert sees that the target image isn't zero-initialised
    yet, it tries to do an efficient zero write for the whole image first
    to save the overhead of repeated explicit zero writes during the
    conversion. Obviously, this provides only an advantage if the
    pre-zeroing is actually efficient. Otherwise, we can end up writing
    zeroes slowly while zeroing out the whole image, and then overwrite the
    same blocks again with real data, potentially doubling the written data.
    
    Pass BDRV_REQ_NO_FALLBACK to blk_make_zero() to avoid this case. If we
    can't efficiently zero out, we'll instead write explicit zeroes only if
    there is no data to be written to a block.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Acked-by: default avatarEric Blake <eblake@redhat.com>
    c9fdcf20
    qemu-img: Use BDRV_REQ_NO_FALLBACK for pre-zeroing
    Kevin Wolf authored
    
    
    If qemu-img convert sees that the target image isn't zero-initialised
    yet, it tries to do an efficient zero write for the whole image first
    to save the overhead of repeated explicit zero writes during the
    conversion. Obviously, this provides only an advantage if the
    pre-zeroing is actually efficient. Otherwise, we can end up writing
    zeroes slowly while zeroing out the whole image, and then overwrite the
    same blocks again with real data, potentially doubling the written data.
    
    Pass BDRV_REQ_NO_FALLBACK to blk_make_zero() to avoid this case. If we
    can't efficiently zero out, we'll instead write explicit zeroes only if
    there is no data to be written to a block.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Acked-by: default avatarEric Blake <eblake@redhat.com>
Loading