diff options
author | Dunrong Huang <riegamaths@gmail.com> | 2013-09-24 18:14:01 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-10-02 11:41:50 +0200 |
commit | 2fa9aa59cfc472c16309c4e84547aa873423b2f5 (patch) | |
tree | 2c7df26bd1d6dd9bf3ce315c55cfe81b1aea2d69 /block.c | |
parent | db0749012b3d1cf655bddb3cc79052a0fd4dc97b (diff) | |
download | qemu-2fa9aa59cfc472c16309c4e84547aa873423b2f5.tar.gz qemu-2fa9aa59cfc472c16309c4e84547aa873423b2f5.tar.bz2 qemu-2fa9aa59cfc472c16309c4e84547aa873423b2f5.zip |
block: use correct filename for error report
The content filename point to will be erased by qemu_opts_absorb_qdict()
in raw_open_common() in drv->bdrv_file_open()
So it's better to use bs->filename.
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -808,8 +808,8 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file, if (ret < 0) { if (error_is_set(&local_err)) { error_propagate(errp, local_err); - } else if (filename) { - error_setg_errno(errp, -ret, "Could not open '%s'", filename); + } else if (bs->filename[0]) { + error_setg_errno(errp, -ret, "Could not open '%s'", bs->filename); } else { error_setg_errno(errp, -ret, "Could not open image"); } |