diff options
author | Jeff Cody <jcody@redhat.com> | 2017-08-07 08:38:22 -0400 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-08-08 14:37:00 +0200 |
commit | 95d729835f3ceeed977eaf326a7ebb92788dee6d (patch) | |
tree | ee8da96392a78d031ba6f58535a8cee8a3259c69 | |
parent | c6572fa0d2b81bc3a9ca5716f975f2bf59c62e6c (diff) | |
download | qemu-95d729835f3ceeed977eaf326a7ebb92788dee6d.zip qemu-95d729835f3ceeed977eaf326a7ebb92788dee6d.tar.gz qemu-95d729835f3ceeed977eaf326a7ebb92788dee6d.tar.bz2 |
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 a27dc05..14b724e 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); |