diff options
author | Paolo Bonzini | 2011-11-30 09:12:30 +0100 |
---|---|---|
committer | Kevin Wolf | 2011-12-15 12:40:07 +0100 |
commit | ad54ae80c73f486cf39b4b38a04b76dd971cdbf6 (patch) | |
tree | 68c7bc557d325ed840ae11332b69c1ecb63e32fd /block/vdi.c | |
parent | tcg/arm: remove fixed map code buffer restriction (diff) | |
download | qemu-ad54ae80c73f486cf39b4b38a04b76dd971cdbf6.tar.gz qemu-ad54ae80c73f486cf39b4b38a04b76dd971cdbf6.tar.xz qemu-ad54ae80c73f486cf39b4b38a04b76dd971cdbf6.zip |
block: bdrv_aio_* do not return NULL
Initially done with the following semantic patch:
@ rule1 @
expression E;
statement S;
@@
E =
(
bdrv_aio_readv
| bdrv_aio_writev
| bdrv_aio_flush
| bdrv_aio_discard
| bdrv_aio_ioctl
)
(...);
(
- if (E == NULL) { ... }
|
- if (E)
{ <... S ...> }
)
which however missed the occurrence in block/blkverify.c
(as it should have done), and left behind some unused
variables.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vdi.c')
-rw-r--r-- | block/vdi.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/block/vdi.c b/block/vdi.c index e1d8cffc2d..6bb43b8858 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -633,10 +633,6 @@ static void vdi_aio_read_cb(void *opaque, int ret) qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); acb->hd_aiocb = bdrv_aio_readv(bs->file, offset, &acb->hd_qiov, n_sectors, vdi_aio_read_cb, acb); - if (acb->hd_aiocb == NULL) { - ret = -EIO; - goto done; - } } return; done: @@ -708,10 +704,6 @@ static void vdi_aio_write_cb(void *opaque, int ret) qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); acb->hd_aiocb = bdrv_aio_writev(bs->file, 0, &acb->hd_qiov, 1, vdi_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) { - ret = -EIO; - goto done; - } return; } else if (VDI_IS_ALLOCATED(acb->bmap_first)) { /* One or more new blocks were allocated. */ @@ -738,10 +730,6 @@ static void vdi_aio_write_cb(void *opaque, int ret) n_sectors, bmap_first); acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov, n_sectors, vdi_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) { - ret = -EIO; - goto done; - } return; } ret = 0; @@ -789,10 +777,6 @@ static void vdi_aio_write_cb(void *opaque, int ret) acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov, s->block_sectors, vdi_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) { - ret = -EIO; - goto done; - } } else { uint64_t offset = s->header.offset_data / SECTOR_SIZE + (uint64_t)bmap_entry * s->block_sectors + @@ -802,10 +786,6 @@ static void vdi_aio_write_cb(void *opaque, int ret) qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1); acb->hd_aiocb = bdrv_aio_writev(bs->file, offset, &acb->hd_qiov, n_sectors, vdi_aio_write_cb, acb); - if (acb->hd_aiocb == NULL) { - ret = -EIO; - goto done; - } } return; |