summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorDunrong Huang <riegamaths@gmail.com>2013-09-24 18:14:01 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-10-02 11:41:50 +0200
commit2fa9aa59cfc472c16309c4e84547aa873423b2f5 (patch)
tree2c7df26bd1d6dd9bf3ce315c55cfe81b1aea2d69 /block.c
parentdb0749012b3d1cf655bddb3cc79052a0fd4dc97b (diff)
downloadqemu-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/block.c b/block.c
index 93e113ad7c..e2d9936227 100644
--- a/block.c
+++ b/block.c
@@ -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");
}