mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
block/vdi: Don't ignore immediate read/write failures
This patch is similar to 171e3d6b99
which fixed qcow2:
Returning -EIO is far from optimal, but at least it's an error code.
Cc: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
cc015e9a5d
commit
40a892b78c
1 changed files with 5 additions and 0 deletions
|
@ -610,6 +610,7 @@ static void vdi_aio_read_cb(void *opaque, int ret)
|
||||||
acb->hd_aiocb = bdrv_aio_readv(bs->file, offset, &acb->hd_qiov,
|
acb->hd_aiocb = bdrv_aio_readv(bs->file, offset, &acb->hd_qiov,
|
||||||
n_sectors, vdi_aio_read_cb, acb);
|
n_sectors, vdi_aio_read_cb, acb);
|
||||||
if (acb->hd_aiocb == NULL) {
|
if (acb->hd_aiocb == NULL) {
|
||||||
|
ret = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -673,6 +674,7 @@ static void vdi_aio_write_cb(void *opaque, int ret)
|
||||||
acb->hd_aiocb = bdrv_aio_writev(bs->file, 0, &acb->hd_qiov, 1,
|
acb->hd_aiocb = bdrv_aio_writev(bs->file, 0, &acb->hd_qiov, 1,
|
||||||
vdi_aio_write_cb, acb);
|
vdi_aio_write_cb, acb);
|
||||||
if (acb->hd_aiocb == NULL) {
|
if (acb->hd_aiocb == NULL) {
|
||||||
|
ret = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -702,6 +704,7 @@ static void vdi_aio_write_cb(void *opaque, int ret)
|
||||||
acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov,
|
acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov,
|
||||||
n_sectors, vdi_aio_write_cb, acb);
|
n_sectors, vdi_aio_write_cb, acb);
|
||||||
if (acb->hd_aiocb == NULL) {
|
if (acb->hd_aiocb == NULL) {
|
||||||
|
ret = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
@ -752,6 +755,7 @@ static void vdi_aio_write_cb(void *opaque, int ret)
|
||||||
&acb->hd_qiov, s->block_sectors,
|
&acb->hd_qiov, s->block_sectors,
|
||||||
vdi_aio_write_cb, acb);
|
vdi_aio_write_cb, acb);
|
||||||
if (acb->hd_aiocb == NULL) {
|
if (acb->hd_aiocb == NULL) {
|
||||||
|
ret = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -764,6 +768,7 @@ static void vdi_aio_write_cb(void *opaque, int ret)
|
||||||
acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov,
|
acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov,
|
||||||
n_sectors, vdi_aio_write_cb, acb);
|
n_sectors, vdi_aio_write_cb, acb);
|
||||||
if (acb->hd_aiocb == NULL) {
|
if (acb->hd_aiocb == NULL) {
|
||||||
|
ret = -EIO;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue