summaryrefslogtreecommitdiffstats
path: root/include/hw/virtio
diff options
context:
space:
mode:
authorEvgeny Yakovlev2019-11-05 19:22:17 +0100
committerStefan Hajnoczi2019-12-13 12:22:06 +0100
commit5f2585772fff7ada93cb6691c51603451228a09c (patch)
tree65858f3bf90fecbf987a9364ad1cea6fad0ca91c /include/hw/virtio
parentUpdate version for v4.2.0 release (diff)
downloadqemu-5f2585772fff7ada93cb6691c51603451228a09c.tar.gz
qemu-5f2585772fff7ada93cb6691c51603451228a09c.tar.xz
qemu-5f2585772fff7ada93cb6691c51603451228a09c.zip
virtio-blk: advertise F_WCE (F_FLUSH) if F_CONFIG_WCE is advertised
Virtio spec 1.1 (and earlier), 5.2.5.2 Driver Requirements: Device Initialization: "Devices SHOULD always offer VIRTIO_BLK_F_FLUSH, and MUST offer it if they offer VIRTIO_BLK_F_CONFIG_WCE" Currently F_CONFIG_WCE and F_WCE are not connected to each other. Qemu will advertise F_CONFIG_WCE if config-wce argument is set for virtio-blk device. And F_WCE is advertised only if underlying block backend actually has it's caching enabled. Fix this by advertising F_WCE if F_CONFIG_WCE is also advertised. To preserve backwards compatibility with newer machine types make this behaviour governed by "x-enable-wce-if-config-wce" virtio-blk-device property and introduce hw_compat_4_2 with new property being off by default for all machine types <= 4.2 (but don't introduce 4.3 machine type itself yet). Signed-off-by: Evgeny Yakovlev <wrfsh@yandex-team.ru> Message-Id: <1572978137-189218-1-git-send-email-wrfsh@yandex-team.ru> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/hw/virtio')
-rw-r--r--include/hw/virtio/virtio-blk.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index cddcfbebe9..9c19f5b634 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -40,6 +40,7 @@ struct VirtIOBlkConf
uint16_t queue_size;
uint32_t max_discard_sectors;
uint32_t max_write_zeroes_sectors;
+ bool x_enable_wce_if_config_wce;
};
struct VirtIOBlockDataPlane;