aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-02-01 20:29:14 +0100
committerMax Reitz <mreitz@redhat.com>2019-02-25 15:11:26 +0100
commit645ae7d88e5393a2a67ebe325f4456ecd49e33e5 (patch)
tree06df9097a4763481a1e9456a70c2c58c9a8730c2 /block
parent009b03aaa233ccf5bd3014404995540158d7dc93 (diff)
downloadqemu-645ae7d88e5393a2a67ebe325f4456ecd49e33e5.zip
qemu-645ae7d88e5393a2a67ebe325f4456ecd49e33e5.tar.gz
qemu-645ae7d88e5393a2a67ebe325f4456ecd49e33e5.tar.bz2
block: bdrv_get_full_backing_filename_from_...'s ret. val.
Make bdrv_get_full_backing_filename_from_filename() return an allocated string instead of placing the result in a caller-provided buffer. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190201192935.18394-11-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/vmdk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index 32e4e75..81c506c 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -2078,16 +2078,16 @@ static int coroutine_fn vmdk_co_do_create(int64_t size,
if (backing_file) {
BlockBackend *backing;
- char *full_backing = g_new0(char, PATH_MAX);
- bdrv_get_full_backing_filename_from_filename(blk_bs(blk)->filename, backing_file,
- full_backing, PATH_MAX,
- &local_err);
+ char *full_backing =
+ bdrv_get_full_backing_filename_from_filename(blk_bs(blk)->filename,
+ backing_file,
+ &local_err);
if (local_err) {
- g_free(full_backing);
error_propagate(errp, local_err);
ret = -ENOENT;
goto exit;
}
+ assert(full_backing);
backing = blk_new_open(full_backing, NULL, NULL,
BDRV_O_NO_BACKING, errp);