Message ID | 1447164580-31094-2-git-send-email-kwolf@redhat.com |
---|---|
State | New |
Headers | show |
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; } }