mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block/export: report flush errors
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>
This commit is contained in:
parent
7185c85776
commit
0534b1b227
1 changed files with 7 additions and 4 deletions
|
@ -78,11 +78,11 @@ vu_block_discard_write_zeroes(VuBlockReq *req, struct iovec *iov,
|
||||||
return -EINVAL;
|
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);
|
VuBlockDev *vdev_blk = get_vu_block_device_by_server(req->server);
|
||||||
BlockBackend *backend = vdev_blk->backend;
|
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)
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case VIRTIO_BLK_T_FLUSH:
|
case VIRTIO_BLK_T_FLUSH:
|
||||||
vu_block_flush(req);
|
if (vu_block_flush(req) == 0) {
|
||||||
req->in->status = VIRTIO_BLK_S_OK;
|
req->in->status = VIRTIO_BLK_S_OK;
|
||||||
|
} else {
|
||||||
|
req->in->status = VIRTIO_BLK_S_IOERR;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case VIRTIO_BLK_T_GET_ID: {
|
case VIRTIO_BLK_T_GET_ID: {
|
||||||
size_t size = MIN(iov_size(&elem->in_sg[0], in_num),
|
size_t size = MIN(iov_size(&elem->in_sg[0], in_num),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue