diff options
author | Jeff Cody | 2017-08-07 14:38:22 +0200 |
---|---|---|
committer | Kevin Wolf | 2017-08-08 14:37:00 +0200 |
commit | 95d729835f3ceeed977eaf326a7ebb92788dee6d (patch) | |
tree | ee8da96392a78d031ba6f58535a8cee8a3259c69 | |
parent | block/vhdx: check error return of bdrv_flush() (diff) | |
download | qemu-95d729835f3ceeed977eaf326a7ebb92788dee6d.tar.gz qemu-95d729835f3ceeed977eaf326a7ebb92788dee6d.tar.xz qemu-95d729835f3ceeed977eaf326a7ebb92788dee6d.zip |
block/vhdx: check error return of bdrv_truncate()
Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block/vhdx-log.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/block/vhdx-log.c b/block/vhdx-log.c index a27dc059cd..14b724ef7b 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -558,7 +558,11 @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, ret = -EINVAL; goto exit; } - bdrv_truncate(bs->file, new_file_size, PREALLOC_MODE_OFF, NULL); + ret = bdrv_truncate(bs->file, new_file_size, PREALLOC_MODE_OFF, + NULL); + if (ret < 0) { + goto exit; + } } } qemu_vfree(desc_entries); |