From fb0b154c801e3447e505de420195fb7038695941 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Thu, 25 Feb 2021 09:12:39 +0900 Subject: virtio-blk: Respect discard granularity Report the configured granularity for discard operation to the guest. If this is not set use the block size. Since until now we have ignored the configured discard granularity and always reported the block size, let's add 'report-discard-granularity' property and disable it for older machine types to avoid migration issues. Signed-off-by: Akihiko Odaki Reviewed-by: Stefano Garzarella Signed-off-by: Stefan Hajnoczi Message-Id: <20210225001239.47046-1-akihiko.odaki@gmail.com> --- include/hw/virtio/virtio-blk.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/hw') diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h index 214ab74822..29655a406d 100644 --- a/include/hw/virtio/virtio-blk.h +++ b/include/hw/virtio/virtio-blk.h @@ -41,6 +41,7 @@ struct VirtIOBlkConf uint16_t num_queues; uint16_t queue_size; bool seg_max_adjust; + bool report_discard_granularity; uint32_t max_discard_sectors; uint32_t max_write_zeroes_sectors; bool x_enable_wce_if_config_wce; -- cgit v1.2.3-55-g7522