aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorXie Yongji <xieyongji@baidu.com>2019-03-20 19:26:44 +0800
committerMichael S. Tsirkin <mst@redhat.com>2019-05-20 18:40:02 -0400
commita57f009108076d3c30f87be5d580c6344ad44971 (patch)
tree3e6973f32e9c9da60656b9ab51455bd596533cf0 /hw/block
parentf3facbe67110089f075aba1091dbc8280304fbaf (diff)
downloadqemu-a57f009108076d3c30f87be5d580c6344ad44971.zip
qemu-a57f009108076d3c30f87be5d580c6344ad44971.tar.gz
qemu-a57f009108076d3c30f87be5d580c6344ad44971.tar.bz2
vhost-user-blk: Add return value for vhost_user_blk_start()
Add a return value for vhost_user_blk_start() to check whether we start vhost-user backend successfully or not. Signed-off-by: Xie Yongji <xieyongji@baidu.com> Signed-off-by: Zhang Yu <zhangyu31@baidu.com> Message-Id: <20190320112646.3712-6-xieyongji@baidu.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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
index 39e1adc..6802c19 100644
--- a/hw/block/vhost-user-blk.c
+++ b/hw/block/vhost-user-blk.c
@@ -103,7 +103,7 @@ const VhostDevConfigOps blk_ops = {
.vhost_dev_config_notifier = vhost_user_blk_handle_config_change,
};
-static void vhost_user_blk_start(VirtIODevice *vdev)
+static int vhost_user_blk_start(VirtIODevice *vdev)
{
VHostUserBlk *s = VHOST_USER_BLK(vdev);
BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
@@ -112,13 +112,13 @@ static void vhost_user_blk_start(VirtIODevice *vdev)
if (!k->set_guest_notifiers) {
error_report("binding does not support guest notifiers");
- return;
+ return -ENOSYS;
}
ret = vhost_dev_enable_notifiers(&s->dev, vdev);
if (ret < 0) {
error_report("Error enabling host notifiers: %d", -ret);
- return;
+ return ret;
}
ret = k->set_guest_notifiers(qbus->parent, s->dev.nvqs, true);
@@ -157,12 +157,13 @@ static void vhost_user_blk_start(VirtIODevice *vdev)
vhost_virtqueue_mask(&s->dev, vdev, i, false);
}
- return;
+ return ret;
err_guest_notifiers:
k->set_guest_notifiers(qbus->parent, s->dev.nvqs, false);
err_host_notifiers:
vhost_dev_disable_notifiers(&s->dev, vdev);
+ return ret;
}
static void vhost_user_blk_stop(VirtIODevice *vdev)