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>
This commit is contained in:
Alberto Garcia
2015-11-11 16:22:46 +01:00
committed by Kevin Wolf
parent 3c07587d49
commit 9f4ed6fbd2
+3 -3
View File
@@ -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;
}
}