From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsC1o-0006rE-1T for qemu-devel@nongnu.org; Thu, 27 Jun 2013 09:14:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsC1j-0004JB-I0 for qemu-devel@nongnu.org; Thu, 27 Jun 2013 09:14:23 -0400 Received: from mail-bk0-x22b.google.com ([2a00:1450:4008:c01::22b]:49344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsC1j-0004J3-C5 for qemu-devel@nongnu.org; Thu, 27 Jun 2013 09:14:19 -0400 Received: by mail-bk0-f43.google.com with SMTP id jm2so299343bkc.2 for ; Thu, 27 Jun 2013 06:14:18 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51CC3AA4.4020904@redhat.com> Date: Thu, 27 Jun 2013 15:14:12 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1371210243-6099-1-git-send-email-stefanha@redhat.com> <1371210243-6099-3-git-send-email-stefanha@redhat.com> In-Reply-To: <1371210243-6099-3-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 02/17] dataplane/virtio-blk: check exit conditions before aio_poll() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , Ping Fan Liu , qemu-devel@nongnu.org Il 14/06/2013 13:43, Stefan Hajnoczi ha scritto: > 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; > } > > ACK Paolo