aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorJin Yu <jin.yu@intel.com>2020-11-03 20:36:17 +0800
committerMichael S. Tsirkin <mst@redhat.com>2020-11-03 16:39:05 -0500
commit1b0063b3048af65dfaae6422a572c87db8575a92 (patch)
tree60e22f00578b6e978be8fe155c08712de591140c /hw/block
parentb7c1bd9d78480481455678602c9a8505cc8adadd (diff)
downloadqemu-1b0063b3048af65dfaae6422a572c87db8575a92.zip
qemu-1b0063b3048af65dfaae6422a572c87db8575a92.tar.gz
qemu-1b0063b3048af65dfaae6422a572c87db8575a92.tar.bz2
vhost-blk: set features before setting inflight feature
Virtqueue has split and packed, so before setting inflight, you need to inform the back-end virtqueue format. Signed-off-by: Jin Yu <jin.yu@intel.com> Acked-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Message-Id: <20201103123617.28256-1-jin.yu@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/vhost-user-blk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
index a076b1e..2dd3d93 100644
--- a/hw/block/vhost-user-blk.c
+++ b/hw/block/vhost-user-blk.c
@@ -131,6 +131,12 @@ static int vhost_user_blk_start(VirtIODevice *vdev)
s->dev.acked_features = vdev->guest_features;
+ ret = vhost_dev_prepare_inflight(&s->dev, vdev);
+ if (ret < 0) {
+ error_report("Error set inflight format: %d", -ret);
+ goto err_guest_notifiers;
+ }
+
if (!s->inflight->addr) {
ret = vhost_dev_get_inflight(&s->dev, s->queue_size, s->inflight);
if (ret < 0) {