diff options
author | Alberto Garcia <berto@igalia.com> | 2017-06-19 16:40:02 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-06-26 14:51:13 +0200 |
commit | 026ac1586bdbd184e24082aa2bbab1fa3c48456b (patch) | |
tree | 23c2b2258e9b1686d3080695d9022c08f43a0abd /block | |
parent | b2b2b67a0057407e19cfa3fdd9002db21ced8b01 (diff) |
qcow2: Remove unused Error variable in do_perform_cow()
We are using the return value of qcow2_encrypt_sectors() to detect
problems but we are throwing away the returned Error since we have no
way to report it to the user. Therefore we can simply get rid of the
local Error variable and pass NULL instead.
Alternatively we could try to figure out a way to pass the original
error instead of simply returning -EIO, but that would be more
invasive, so let's keep the current approach.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/qcow2-cluster.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index d779ea19cf..d1c419f52b 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -440,16 +440,14 @@ static int coroutine_fn do_perform_cow(BlockDriverState *bs, } if (bs->encrypted) { - Error *err = NULL; int64_t sector = (src_cluster_offset + offset_in_cluster) >> BDRV_SECTOR_BITS; assert(s->cipher); assert((offset_in_cluster & ~BDRV_SECTOR_MASK) == 0); assert((bytes & ~BDRV_SECTOR_MASK) == 0); if (qcow2_encrypt_sectors(s, sector, iov.iov_base, iov.iov_base, - bytes >> BDRV_SECTOR_BITS, true, &err) < 0) { + bytes >> BDRV_SECTOR_BITS, true, NULL) < 0) { ret = -EIO; - error_free(err); goto out; } } |