summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Pei2022-01-03 10:28:12 +0100
committerMichael S. Tsirkin2022-01-07 11:19:55 +0100
commit0a963af3e3c12074ed93babe0b908a1bce79f84f (patch)
treee4a0989f120e365f382d94068b0b43a0686f5b85
parenthw/i386: expose a "smbios-entry-point-type" PC machine property (diff)
downloadqemu-0a963af3e3c12074ed93babe0b908a1bce79f84f.tar.gz
qemu-0a963af3e3c12074ed93babe0b908a1bce79f84f.tar.xz
qemu-0a963af3e3c12074ed93babe0b908a1bce79f84f.zip
hw/vhost-user-blk: turn on VIRTIO_BLK_F_SIZE_MAX feature for virtio blk device
Turn on pre-defined feature VIRTIO_BLK_F_SIZE_MAX for virtio blk device to avoid guest DMA request sizes which are too large for hardware spec. Signed-off-by: Andy Pei <andy.pei@intel.com> Message-Id: <1641202092-149677-1-git-send-email-andy.pei@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
-rw-r--r--hw/block/vhost-user-blk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
index ab11ce8252..1a42ae9187 100644
--- a/hw/block/vhost-user-blk.c
+++ b/hw/block/vhost-user-blk.c
@@ -252,6 +252,7 @@ static uint64_t vhost_user_blk_get_features(VirtIODevice *vdev,
VHostUserBlk *s = VHOST_USER_BLK(vdev);
/* Turn on pre-defined features */
+ virtio_add_feature(&features, VIRTIO_BLK_F_SIZE_MAX);
virtio_add_feature(&features, VIRTIO_BLK_F_SEG_MAX);
virtio_add_feature(&features, VIRTIO_BLK_F_GEOMETRY);
virtio_add_feature(&features, VIRTIO_BLK_F_TOPOLOGY);