From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Utd4X-0001Ec-JD for qemu-devel@nongnu.org; Mon, 01 Jul 2013 08:19:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Utd4Q-0000lF-NW for qemu-devel@nongnu.org; Mon, 01 Jul 2013 08:19:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Utd4Q-0000l4-DE for qemu-devel@nongnu.org; Mon, 01 Jul 2013 08:19:02 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r61CJ0tA023614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Jul 2013 08:19:01 -0400 From: Stefan Hajnoczi Date: Mon, 1 Jul 2013 14:18:34 +0200 Message-Id: <1372681129-18528-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1372681129-18528-1-git-send-email-stefanha@redhat.com> References: <1372681129-18528-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH v5 03/18] dataplane/virtio-blk: check exit conditions before aio_poll() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , Stefan Hajnoczi Check exit conditions before entering blocking aio_poll(). This is mainly for consistency since it's unlikely that we are stopping in the first event loop iteration. Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 0356665..0509d3f 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -379,9 +379,9 @@ static void *data_plane_thread(void *opaque) { VirtIOBlockDataPlane *s = opaque; - do { + while (!s->stopping || s->num_reqs > 0) { aio_poll(s->ctx, true); - } while (!s->stopping || s->num_reqs > 0); + } return NULL; } -- 1.8.1.4