]> xenbits.xensource.com Git - qemu-upstream-4.5-testing.git/commitdiff
dataplane/virtio-blk: check exit conditions before aio_poll()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 11 Apr 2013 15:24:08 +0000 (17:24 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 19 Aug 2013 13:45:34 +0000 (15:45 +0200)
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 <stefanha@redhat.com>
hw/block/dataplane/virtio-blk.c

index 411becc06eda28be29d057596fe6a91a29567af6..5bd5eed9847a90a2d70abb5e25710a2485b1a33f 100644 (file)
@@ -376,9 +376,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;
 }