* [Qemu-devel] [PATCH] block: Don't call blk_bs() twice in bdrv_lookup_bs()
@ 2015-10-26 14:46 Alberto Garcia
2015-10-26 16:26 ` Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Alberto Garcia @ 2015-10-26 14:46 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Alberto Garcia, Stefan Hajnoczi, qemu-block,
Max Reitz
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] block: Don't call blk_bs() twice in bdrv_lookup_bs()
2015-10-26 14:46 [Qemu-devel] [PATCH] block: Don't call blk_bs() twice in bdrv_lookup_bs() Alberto Garcia
@ 2015-10-26 16:26 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2015-10-26 16:26 UTC (permalink / raw)
To: Alberto Garcia; +Cc: Stefan Hajnoczi, qemu-devel, qemu-block, Max Reitz
Am 26.10.2015 um 15:46 hat Alberto Garcia geschrieben:
> Signed-off-by: Alberto Garcia <berto@igalia.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-26 16:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-26 14:46 [Qemu-devel] [PATCH] block: Don't call blk_bs() twice in bdrv_lookup_bs() Alberto Garcia
2015-10-26 16:26 ` Kevin Wolf
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).