]> git.proxmox.com Git - mirror_qemu.git/commit
block/blkio: Tolerate device size changes
authorAlberto Faria <afaria@redhat.com>
Sat, 29 Oct 2022 12:20:31 +0000 (13:20 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 31 Oct 2022 18:33:15 +0000 (14:33 -0400)
commit4c8f4fda0504564580f5c0a37e2d4b32ff17d2a1
tree57f53b90e5d542bd6644b7a003f1336ac255bafc
parent03d9e4c0dba9d1b5d0c532ac3518415466ebdf8f
block/blkio: Tolerate device size changes

Some libblkio drivers may be able to work with regular files (e.g.,
io_uring) or otherwise resizable devices. Conservatively set
BlockDriver::has_variable_length to true to ensure bdrv_nb_sectors()
always gives up-to-date results.

Also implement BlockDriver::bdrv_co_truncate for the case where no
preallocation is needed and the device already has a size compatible
with what was requested.

Signed-off-by: Alberto Faria <afaria@redhat.com>
Message-id: 20221029122031.975273-1-afaria@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/blkio.c