From 5c98415b2a2fde5739aefe51793f969ce8bb2758 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Wed, 3 Dec 2014 14:57:22 +0100 Subject: vmdk: Fix error for JSON descriptor file names If vmdk blindly tries to use path_combine() using bs->file->filename as the base file name, this will result in a bad error message for JSON file names when calling bdrv_open(). It is better to only try bs->file->exact_filename; if that is empty, bs->file->filename will be useless for path_combine() and an error should be emitted (containing bs->file->filename because desc_file_path (which is bs->file->exact_filename) is empty). Signed-off-by: Max Reitz Reviewed-by: Fam Zheng Message-id: 1417615043-26174-2-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi --- include/block/block.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/block') diff --git a/include/block/block.h b/include/block/block.h index 610be9ff04..919c8f50ef 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -401,6 +401,7 @@ void bdrv_get_full_backing_filename(BlockDriverState *bs, char *dest, size_t sz); int bdrv_is_snapshot(BlockDriverState *bs); +int path_has_protocol(const char *path); int path_is_absolute(const char *path); void path_combine(char *dest, int dest_size, const char *base_path, -- cgit v1.2.3