From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3PmX-0005CC-EV for qemu-devel@nongnu.org; Thu, 19 May 2016 11:22:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3PmS-00005F-EG for qemu-devel@nongnu.org; Thu, 19 May 2016 11:22:36 -0400 From: Kevin Wolf Date: Thu, 19 May 2016 17:21:52 +0200 Message-Id: <1463671329-22655-15-git-send-email-kwolf@redhat.com> In-Reply-To: <1463671329-22655-1-git-send-email-kwolf@redhat.com> References: <1463671329-22655-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 14/31] block: Don't check throttled reqs in bdrv_requests_pending() 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 Checking whether there are throttled requests requires going to the associated BlockBackend, which we want to avoid. All users of bdrv_requests_pending() in block/io.c already call bdrv_parent_drained_begin() first, which restarts all throttled requests, so no throttled requests can be left here and this is removal of dead code. The remaining users (assertions during graph manipulation in block.c) don't care about requests that are still queued in the BlockBackend and haven't been issued for a BlockDriverState yet. Signed-off-by: Kevin Wolf Acked-by: Stefan Hajnoczi --- block/io.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/block/io.c b/block/io.c index 23abbc5..6e90805 100644 --- a/block/io.c +++ b/block/io.c @@ -147,17 +147,10 @@ void bdrv_disable_copy_on_read(BlockDriverState *bs) bool bdrv_requests_pending(BlockDriverState *bs) { BdrvChild *child; - BlockBackendPublic *blkp = bs->blk ? blk_get_public(bs->blk) : NULL; if (!QLIST_EMPTY(&bs->tracked_requests)) { return true; } - if (blkp && !qemu_co_queue_empty(&blkp->throttled_reqs[0])) { - return true; - } - if (blkp && !qemu_co_queue_empty(&blkp->throttled_reqs[1])) { - return true; - } QLIST_FOREACH(child, &bs->children, next) { if (bdrv_requests_pending(child->bs)) { -- 1.8.3.1