summaryrefslogtreecommitdiffstats
path: root/hw/block/vhost-user-blk.c
diff options
context:
space:
mode:
authorJin Yu2020-09-10 15:48:51 +0200
committerMichael S. Tsirkin2020-10-30 11:48:53 +0100
commitadb29c027341ba095a3ef4beef6aaef86d3a520e (patch)
tree23db478817f72c3151128f02c20d7e10aa410eee /hw/block/vhost-user-blk.c
parentpci: Disallow improper BAR registration for type 1 (diff)
downloadqemu-adb29c027341ba095a3ef4beef6aaef86d3a520e.tar.gz
qemu-adb29c027341ba095a3ef4beef6aaef86d3a520e.tar.xz
qemu-adb29c027341ba095a3ef4beef6aaef86d3a520e.zip
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> Message-Id: <20200910134851.7817-1-jin.yu@intel.com> Acked-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/block/vhost-user-blk.c')
-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 a076b1e54d..f67b29bbf3 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);
+ 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) {