aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-12-02 18:32:52 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2015-01-14 17:08:42 -0600
commit178ed9aad3b189f010f506dfbc86a0ac1efd377e (patch)
tree55f8a2cc947e84867103f00b4090150f0a5db5aa
parent0505d48c83bf3722c0a3aaa13a65d5ab17f92b97 (diff)
qcow2: Respect bdrv_truncate() error
bdrv_truncate() may fail and qcow2_write_compressed() should return the error code in that case. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit 6a69b9620ac1562a067990d87284a85552bfd61b) Conflicts: block/qcow2.c *removed context dependency on 75d3d21 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--block/qcow2.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index e3cc23c6d2..d53f181829 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1960,8 +1960,7 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num,
sector based I/Os */
cluster_offset = bdrv_getlength(bs->file);
cluster_offset = (cluster_offset + 511) & ~511;
- bdrv_truncate(bs->file, cluster_offset);
- return 0;
+ return bdrv_truncate(bs->file, cluster_offset);
}
if (nb_sectors != s->cluster_sectors) {