From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
Dunrong Huang <riegamaths@gmail.com>,
Anthony Liguori <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PULL 3/8] block: use correct filename for error report
Date: Mon, 7 Oct 2013 13:28:04 +0200 [thread overview]
Message-ID: <1381145289-6591-4-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1381145289-6591-1-git-send-email-stefanha@redhat.com>
From: Dunrong Huang <riegamaths@gmail.com>
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>
---
block.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 93e113a..e2d9936 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");
}
--
1.8.3.1
next prev parent reply other threads:[~2013-10-07 11:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 11:28 [Qemu-devel] [PULL 0/8] Block patches Stefan Hajnoczi
2013-10-07 11:28 ` [Qemu-devel] [PULL 1/8] qcow2: Correct endianness in overlap check Stefan Hajnoczi
2013-10-07 11:28 ` [Qemu-devel] [PULL 2/8] qcow2: CHECK_OFLAG_COPIED is obsolete Stefan Hajnoczi
2013-10-07 11:28 ` Stefan Hajnoczi [this message]
2013-10-07 11:28 ` [Qemu-devel] [PULL 4/8] block: vhdx - add migration blocker Stefan Hajnoczi
2013-10-07 11:28 ` [Qemu-devel] [PULL 5/8] qcow2: Switch L1 table in a single sequence Stefan Hajnoczi
2013-10-07 11:28 ` [Qemu-devel] [PULL 6/8] qcow2: Free allocated L2 cluster on error Stefan Hajnoczi
2013-10-07 11:28 ` [Qemu-devel] [PULL 7/8] qemu-iotests: Correct 026 output Stefan Hajnoczi
2013-10-07 11:28 ` [Qemu-devel] [PULL 8/8] block: use correct filename Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381145289-6591-4-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
--cc=riegamaths@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).