From: Alberto Garcia <berto@igalia.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH] block: Don't call blk_bs() twice in bdrv_lookup_bs()
Date: Mon, 26 Oct 2015 16:46:49 +0200 [thread overview]
Message-ID: <1445870809-29468-1-git-send-email-berto@igalia.com> (raw)
Signed-off-by: Alberto Garcia <berto@igalia.com>
---
block.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index e9f40dc..eb8158a 100644
--- a/block.c
+++ b/block.c
@@ -2683,12 +2683,12 @@ BlockDriverState *bdrv_lookup_bs(const char *device,
blk = blk_by_name(device);
if (blk) {
- if (!blk_bs(blk)) {
+ bs = blk_bs(blk);
+ if (!bs) {
error_setg(errp, "Device '%s' has no medium", device);
- return NULL;
}
- return blk_bs(blk);
+ return bs;
}
}
--
2.6.1
next reply other threads:[~2015-10-26 14:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 14:46 Alberto Garcia [this message]
2015-10-26 16:26 ` [Qemu-devel] [PATCH] block: Don't call blk_bs() twice in bdrv_lookup_bs() Kevin Wolf
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=1445870809-29468-1-git-send-email-berto@igalia.com \
--to=berto@igalia.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).