diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-04-06 15:30:09 +0200 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2010-04-10 01:23:08 +0200 |
commit | 171e3d6b9997c98a97d0c525867f7cd9b640cadd (patch) | |
tree | 6a07c2b5d851647963c2280017f38aa8bc2b9508 | |
parent | 7eb58a6c556c3880e6712cbf6d24d681261c5095 (diff) | |
download | qemu-171e3d6b9997c98a97d0c525867f7cd9b640cadd.tar.gz qemu-171e3d6b9997c98a97d0c525867f7cd9b640cadd.tar.bz2 qemu-171e3d6b9997c98a97d0c525867f7cd9b640cadd.zip |
qcow2: Don't ignore immediate read/write failures
Returning -EIO is far from optimal, but at least it's an error code.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r-- | block/qcow2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 5b6dad9d59..b44a12cdeb 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -468,8 +468,10 @@ static void qcow_aio_read_cb(void *opaque, int ret) (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->cur_nr_sectors, qcow_aio_read_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } } return; @@ -621,8 +623,10 @@ static void qcow_aio_write_cb(void *opaque, int ret) (acb->cluster_offset >> 9) + index_in_cluster, &acb->hd_qiov, acb->cur_nr_sectors, qcow_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) + if (acb->hd_aiocb == NULL) { + ret = -EIO; goto done; + } return; |