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>
This commit is contained in:
Dunrong Huang 2013-09-24 18:14:01 +08:00 committed by Stefan Hajnoczi
parent db0749012b
commit 2fa9aa59cf

View File

@ -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");
}