From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFm8n-0005rW-C0 for qemu-devel@nongnu.org; Mon, 26 Jan 2015 11:03:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFm8h-0005Ab-2w for qemu-devel@nongnu.org; Mon, 26 Jan 2015 11:03:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFm8g-0005AU-SL for qemu-devel@nongnu.org; Mon, 26 Jan 2015 11:03:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0QG3jxh031684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 26 Jan 2015 11:03:46 -0500 From: Max Reitz Date: Mon, 26 Jan 2015 11:02:52 -0500 Message-Id: <1422288204-29271-19-git-send-email-mreitz@redhat.com> In-Reply-To: <1422288204-29271-1-git-send-email-mreitz@redhat.com> References: <1422288204-29271-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH 18/50] block: Respect empty BB in bdrv_query_info() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Jeff Cody , Markus Armbruster , Max Reitz , Stefan Hajnoczi , john@redhat.com Signed-off-by: Max Reitz --- block/qapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index 9a44d40..db42a6e 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -282,12 +282,12 @@ static void bdrv_query_info(BlockBackend *blk, BlockInfo **p_info, info->io_status = blk_iostatus(blk); } - if (!QLIST_EMPTY(&bs->dirty_bitmaps)) { + if (bs && !QLIST_EMPTY(&bs->dirty_bitmaps)) { info->has_dirty_bitmaps = true; info->dirty_bitmaps = bdrv_query_dirty_bitmaps(bs); } - if (bs->drv) { + if (bs && bs->drv) { info->has_inserted = true; info->inserted = bdrv_block_device_info(bs); -- 2.1.0