[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 16/28] block/export: report flush errors
From: |
Stefan Hajnoczi |
Subject: |
[PULL v2 16/28] block/export: report flush errors |
Date: |
Thu, 22 Oct 2020 12:27:14 +0100 |
Propagate the flush return value since errors are possible.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20200924151549.913737-11-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
block/export/vhost-user-blk-server.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/block/export/vhost-user-blk-server.c
b/block/export/vhost-user-blk-server.c
index 4d35232bf3..faefcfcaea 100644
--- a/block/export/vhost-user-blk-server.c
+++ b/block/export/vhost-user-blk-server.c
@@ -78,11 +78,11 @@ vu_block_discard_write_zeroes(VuBlockReq *req, struct iovec
*iov,
return -EINVAL;
}
-static void coroutine_fn vu_block_flush(VuBlockReq *req)
+static int coroutine_fn vu_block_flush(VuBlockReq *req)
{
VuBlockDev *vdev_blk = get_vu_block_device_by_server(req->server);
BlockBackend *backend = vdev_blk->backend;
- blk_co_flush(backend);
+ return blk_co_flush(backend);
}
static void coroutine_fn vu_block_virtio_process_req(void *opaque)
@@ -152,8 +152,11 @@ static void coroutine_fn vu_block_virtio_process_req(void
*opaque)
break;
}
case VIRTIO_BLK_T_FLUSH:
- vu_block_flush(req);
- req->in->status = VIRTIO_BLK_S_OK;
+ if (vu_block_flush(req) == 0) {
+ req->in->status = VIRTIO_BLK_S_OK;
+ } else {
+ req->in->status = VIRTIO_BLK_S_IOERR;
+ }
break;
case VIRTIO_BLK_T_GET_ID: {
size_t size = MIN(iov_size(&elem->in_sg[0], in_num),
--
2.26.2
- [PULL v2 06/28] block/export: vhost-user block device backend server, (continued)
- [PULL v2 06/28] block/export: vhost-user block device backend server, Stefan Hajnoczi, 2020/10/22
- [PULL v2 07/28] MAINTAINERS: Add vhost-user block device backend server maintainer, Stefan Hajnoczi, 2020/10/22
- [PULL v2 08/28] util/vhost-user-server: s/fileds/fields/ typo fix, Stefan Hajnoczi, 2020/10/22
- [PULL v2 09/28] util/vhost-user-server: drop unnecessary QOM cast, Stefan Hajnoczi, 2020/10/22
- [PULL v2 10/28] util/vhost-user-server: drop unnecessary watch deletion, Stefan Hajnoczi, 2020/10/22
- [PULL v2 11/28] block/export: consolidate request structs into VuBlockReq, Stefan Hajnoczi, 2020/10/22
- [PULL v2 12/28] util/vhost-user-server: drop unused DevicePanicNotifier, Stefan Hajnoczi, 2020/10/22
- [PULL v2 13/28] util/vhost-user-server: fix memory leak in vu_message_read(), Stefan Hajnoczi, 2020/10/22
- [PULL v2 14/28] util/vhost-user-server: check EOF when reading payload, Stefan Hajnoczi, 2020/10/22
- [PULL v2 15/28] util/vhost-user-server: rework vu_client_trip() coroutine lifecycle, Stefan Hajnoczi, 2020/10/22
- [PULL v2 16/28] block/export: report flush errors,
Stefan Hajnoczi <=
- [PULL v2 17/28] block/export: convert vhost-user-blk server to block export API, Stefan Hajnoczi, 2020/10/22
- [PULL v2 18/28] util/vhost-user-server: move header to include/, Stefan Hajnoczi, 2020/10/22
- [PULL v2 19/28] util/vhost-user-server: use static library in meson.build, Stefan Hajnoczi, 2020/10/22
- [PULL v2 20/28] qemu-storage-daemon: avoid compiling blockdev_ss twice, Stefan Hajnoczi, 2020/10/22
- [PULL v2 21/28] block: move block exports to libblockdev, Stefan Hajnoczi, 2020/10/22
- [PULL v2 24/28] block/io: fix bdrv_co_block_status_above, Stefan Hajnoczi, 2020/10/22
- [PULL v2 23/28] block/export: add vhost-user-blk multi-queue support, Stefan Hajnoczi, 2020/10/22
- [PULL v2 22/28] block/export: add iothread and fixed-iothread options, Stefan Hajnoczi, 2020/10/22
- [PULL v2 26/28] block/io: bdrv_common_block_status_above: support bs == base, Stefan Hajnoczi, 2020/10/22
- [PULL v2 27/28] block/io: fix bdrv_is_allocated_above, Stefan Hajnoczi, 2020/10/22