mirror of
https://github.com/qemu/qemu.git
synced 2025-08-10 21:34:57 +00:00
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:
parent
3c07587d49
commit
9f4ed6fbd2
6
block.c
6
block.c
@ -2683,12 +2683,12 @@ BlockDriverState *bdrv_lookup_bs(const char *device,
|
|||||||
blk = blk_by_name(device);
|
blk = blk_by_name(device);
|
||||||
|
|
||||||
if (blk) {
|
if (blk) {
|
||||||
if (!blk_bs(blk)) {
|
bs = blk_bs(blk);
|
||||||
|
if (!bs) {
|
||||||
error_setg(errp, "Device '%s' has no medium", device);
|
error_setg(errp, "Device '%s' has no medium", device);
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return blk_bs(blk);
|
return bs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user