mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06: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
1 changed files with 3 additions and 3 deletions
6
block.c
6
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue