summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-12-03 14:57:22 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2014-12-12 13:14:10 +0000
commit5c98415b2a2fde5739aefe51793f969ce8bb2758 (patch)
tree9a9b7acd93caa089341164c00f6898ebfff375f7 /block.c
parentebd9fbd7e102c533143c2c8372312b75c2b2678a (diff)
downloadqemu-5c98415b2a2fde5739aefe51793f969ce8bb2758.tar.gz
qemu-5c98415b2a2fde5739aefe51793f969ce8bb2758.tar.bz2
qemu-5c98415b2a2fde5739aefe51793f969ce8bb2758.zip
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 <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1417615043-26174-2-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block.c b/block.c
index 82f33c51b7..a75a99228c 100644
--- a/block.c
+++ b/block.c
@@ -229,7 +229,7 @@ size_t bdrv_opt_mem_align(BlockDriverState *bs)
}
/* check if the path starts with "<protocol>:" */
-static int path_has_protocol(const char *path)
+int path_has_protocol(const char *path)
{
const char *p;