]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
hw/vhost-user-blk: turn on VIRTIO_BLK_F_SIZE_MAX feature for virtio blk device
authorAndy Pei <andy.pei@intel.com>
Mon, 3 Jan 2022 09:28:12 +0000 (17:28 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 7 Jan 2022 10:19:55 +0000 (05:19 -0500)
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>
hw/block/vhost-user-blk.c

index ab11ce825252e6ac63fdf224f5e015d7477fe202..1a42ae9187053ecf9aa714695d82cbcb9b92c36b 100644 (file)
@@ -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);