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> --- hw/core/machine.c | 1 + 1 file changed, 1 insertion(+) (limited to 'hw/core/machine.c') diff --git a/hw/core/machine.c b/hw/core/machine.c index 4386f57b5c..4c1a4a4c32 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -39,6 +39,7 @@ GlobalProperty hw_compat_5_2[] = { { "ICH9-LPC", "smm-compat", "on"}, { "PIIX4_PM", "smm-compat", "on"}, + { "virtio-blk-device", "report-discard-granularity", "off" }, }; const size_t hw_compat_5_2_len = G_N_ELEMENTS(hw_compat_5_2); -- cgit 1.4.1