Skip to contentSkip to conversation

hw/vhost-user-blk: turn on VIRTIO_BLK_F_SIZE_MAX feature for virtio blk device

PATCH In review Andy Pei 2 participants 2 messages Jan 3, 2022

lore
Share & tools
lore

Andy Pei

author
#0 lore raw

PATCH v2 1/1 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.

---
 hw/block/vhost-user-blk.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/vhost-user-blk.c +1 -0
index ba13cb8..eb1264a 100644
@@ -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);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 7 lines · Andy Pei

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.

---

Thanks!
Notes for future submissions:
- pls include acks sent on previous versions unless changes you made are substantial enough to invalidate them
- pls include a changelog for those that reviewed previous versions

No need to repost this one though.
Thanks!

Quoted 17 lines
 hw/block/vhost-user-blk.c | 1 +
 1 file changed, 1 insertion(+)
hw/block/vhost-user-blk.c +1 -0
index ba13cb8..eb1264a 100644
@@ -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);
Signature · 1 line
1.8.3.1