From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtGnL-0000wR-7I for qemu-devel@nongnu.org; Tue, 25 Nov 2014 09:08:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtGnF-0006o7-Sa for qemu-devel@nongnu.org; Tue, 25 Nov 2014 09:08:43 -0500 From: Max Reitz Date: Tue, 25 Nov 2014 15:08:04 +0100 Message-Id: <1416924485-13304-12-git-send-email-mreitz@redhat.com> In-Reply-To: <1416924485-13304-1-git-send-email-mreitz@redhat.com> References: <1416924485-13304-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 11/12] qcow2: Respect bdrv_truncate() error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Peter Lieven , qemu-stable@nongnu.org, Markus Armbruster , Stefan Hajnoczi , Max Reitz 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 --- block/qcow2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 2bd2a53..691f363 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -2163,8 +2163,7 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num, /* align end of file to a sector boundary to ease reading with sector based I/Os */ cluster_offset = bdrv_getlength(bs->file); - bdrv_truncate(bs->file, cluster_offset); - return 0; + return bdrv_truncate(bs->file, cluster_offset); } if (nb_sectors != s->cluster_sectors) { -- 1.9.3