From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zw9cQ-0000e3-88 for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:10:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zw9cP-0003sH-9s for qemu-devel@nongnu.org; Tue, 10 Nov 2015 09:09:54 -0500 From: Kevin Wolf Date: Tue, 10 Nov 2015 15:09:01 +0100 Message-Id: <1447164580-31094-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1447164580-31094-1-git-send-email-kwolf@redhat.com> References: <1447164580-31094-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL v2 01/40] block: Don't call blk_bs() twice in bdrv_lookup_bs() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Alberto Garcia Signed-off-by: Alberto Garcia Signed-off-by: Kevin Wolf --- block.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } } -- 1.8.3.1