From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN8vq-0002c8-Ey for qemu-devel@nongnu.org; Mon, 10 Mar 2014 18:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN8vi-0005kZ-Ve for qemu-devel@nongnu.org; Mon, 10 Mar 2014 18:44:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN8vi-0005kN-O0 for qemu-devel@nongnu.org; Mon, 10 Mar 2014 18:44:18 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2AMiIod019022 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Mar 2014 18:44:18 -0400 From: Max Reitz Date: Mon, 10 Mar 2014 23:44:08 +0100 Message-Id: <1394491449-10897-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1394491449-10897-1-git-send-email-mreitz@redhat.com> References: <1394491449-10897-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] block: bs->drv may be NULL in bdrv_debug_resume() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi , Max Reitz Currently, bdrv_debug_resume() requires every bs->drv in the BDS stack to be NULL until a bs->drv with an implementation of bdrv_debug_resume() is found. For a normal function, this would be fine, but this is a function for debugging purposes and should therefore allow intermediate BDS not to have a driver (i.e., be "ejected"). Otherwise, it is hard to debug such situations. Signed-off-by: Max Reitz --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index f1ef4b0..fb487f2 100644 --- a/block.c +++ b/block.c @@ -4055,7 +4055,7 @@ int bdrv_debug_remove_breakpoint(BlockDriverState *bs, const char *tag) int bdrv_debug_resume(BlockDriverState *bs, const char *tag) { - while (bs && bs->drv && !bs->drv->bdrv_debug_resume) { + while (bs && (!bs->drv || !bs->drv->bdrv_debug_resume)) { bs = bs->file; } -- 1.9.0