aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-02-09 10:26:06 +0100
committerKevin Wolf <kwolf@redhat.com>2011-02-10 13:23:44 +0100
commit8af364884355b3f0c5d60a2d2f427927739658ea (patch)
tree93e864055254dd0502413a748b0742b138beb9f5 /block/qcow2.c
parent3ab4c7e92d39d40e6dc0bdb1c2320889543691cb (diff)
qcow2: Fix error handling for reading compressed clusters
When reading a compressed cluster failed, qcow2 falsely returned success. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 647c2a4bc4..551b3c2f82 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -497,8 +497,10 @@ static void qcow2_aio_read_cb(void *opaque, int ret)
}
} else if (acb->cluster_offset & QCOW_OFLAG_COMPRESSED) {
/* add AIO support for compressed blocks ? */
- if (qcow2_decompress_cluster(bs, acb->cluster_offset) < 0)
+ ret = qcow2_decompress_cluster(bs, acb->cluster_offset);
+ if (ret < 0) {
goto done;
+ }
qemu_iovec_from_buffer(&acb->hd_qiov,
s->cluster_cache + index_in_cluster * 512,