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>
This commit is contained in:
Max Reitz 2019-02-01 20:29:14 +01:00
parent 009b03aaa2
commit 645ae7d88e
4 changed files with 49 additions and 33 deletions

View file

@ -3343,18 +3343,14 @@ static int img_rebase(int argc, char **argv)
bdrv_refresh_filename(bs);
overlay_filename = bs->exact_filename[0] ? bs->exact_filename
: bs->filename;
out_real_path = g_malloc(PATH_MAX);
bdrv_get_full_backing_filename_from_filename(overlay_filename,
out_baseimg,
out_real_path,
PATH_MAX,
&local_err);
out_real_path =
bdrv_get_full_backing_filename_from_filename(overlay_filename,
out_baseimg,
&local_err);
if (local_err) {
error_reportf_err(local_err,
"Could not resolve backing filename: ");
ret = -1;
g_free(out_real_path);
goto out;
}