diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-11-30 09:12:30 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-12-15 12:40:07 +0100 |
commit | ad54ae80c73f486cf39b4b38a04b76dd971cdbf6 (patch) | |
tree | 68c7bc557d325ed840ae11332b69c1ecb63e32fd /block/blkverify.c | |
parent | 222f23f508a8d778f56eddef14752dfd26d225b4 (diff) |
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/blkverify.c')
-rw-r--r-- | block/blkverify.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/block/blkverify.c b/block/blkverify.c index 483f3b3cfe..4ca8584b88 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -310,14 +310,10 @@ static BlockDriverAIOCB *blkverify_aio_readv(BlockDriverState *bs, qemu_iovec_init(&acb->raw_qiov, acb->qiov->niov); blkverify_iovec_clone(&acb->raw_qiov, qiov, acb->buf); - if (!bdrv_aio_readv(s->test_file, sector_num, qiov, nb_sectors, - blkverify_aio_cb, acb)) { - blkverify_aio_cb(acb, -EIO); - } - if (!bdrv_aio_readv(bs->file, sector_num, &acb->raw_qiov, nb_sectors, - blkverify_aio_cb, acb)) { - blkverify_aio_cb(acb, -EIO); - } + bdrv_aio_readv(s->test_file, sector_num, qiov, nb_sectors, + blkverify_aio_cb, acb); + bdrv_aio_readv(bs->file, sector_num, &acb->raw_qiov, nb_sectors, + blkverify_aio_cb, acb); return &acb->common; } @@ -329,14 +325,10 @@ static BlockDriverAIOCB *blkverify_aio_writev(BlockDriverState *bs, BlkverifyAIOCB *acb = blkverify_aio_get(bs, true, sector_num, qiov, nb_sectors, cb, opaque); - if (!bdrv_aio_writev(s->test_file, sector_num, qiov, nb_sectors, - blkverify_aio_cb, acb)) { - blkverify_aio_cb(acb, -EIO); - } - if (!bdrv_aio_writev(bs->file, sector_num, qiov, nb_sectors, - blkverify_aio_cb, acb)) { - blkverify_aio_cb(acb, -EIO); - } + bdrv_aio_writev(s->test_file, sector_num, qiov, nb_sectors, + blkverify_aio_cb, acb); + bdrv_aio_writev(bs->file, sector_num, qiov, nb_sectors, + blkverify_aio_cb, acb); return &acb->common; } |