[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v8 5/7] vhost-user-blk: Add return value for vhost_u
From: |
elohimes |
Subject: |
[Qemu-devel] [PATCH v8 5/7] vhost-user-blk: Add return value for vhost_user_blk_start() |
Date: |
Wed, 20 Mar 2019 19:26:44 +0800 |
From: Xie Yongji <address@hidden>
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 <address@hidden>
Signed-off-by: Zhang Yu <address@hidden>
---
hw/block/vhost-user-blk.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
index 39e1adc60a..6802c19d65 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)
--
2.17.1
- [Qemu-devel] [PATCH v8 0/7] vhost-user-blk: Add support for backend reconnecting, elohimes, 2019/03/20
- [Qemu-devel] [PATCH v8 1/7] virtio: Introduce started flag to VirtioDevice, elohimes, 2019/03/20
- [Qemu-devel] [PATCH v8 2/7] virtio: Use started flag in virtio_vmstate_change(), elohimes, 2019/03/20
- [Qemu-devel] [PATCH v8 3/7] vhost-user-blk: Use started flag in vhost_user_blk_set_status(), elohimes, 2019/03/20
- [Qemu-devel] [PATCH v8 4/7] vhost-user-blk: Only start vhost-user backend with the first kick, elohimes, 2019/03/20
- [Qemu-devel] [PATCH v8 5/7] vhost-user-blk: Add return value for vhost_user_blk_start(),
elohimes <=
- [Qemu-devel] [PATCH v8 6/7] vhost-user-blk: Add support to reconnect backend, elohimes, 2019/03/20
- [Qemu-devel] [PATCH v8 7/7] contrib/vhost-user-blk: enable inflight I/O tracking, elohimes, 2019/03/20