diff options
author | Alberto Garcia <berto@igalia.com> | 2015-10-26 16:46:49 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2015-11-11 16:22:46 +0100 |
commit | 9f4ed6fbd264a7c097590d830dcfd93996a80acb (patch) | |
tree | 3068941508fac59b2bf25e14689deb758efd618a | |
parent | 3c07587d49458341510360557c849e93e9afaf59 (diff) |
block: Don't call blk_bs() twice in bdrv_lookup_bs()
Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } } |