diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2013-04-11 17:24:08 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-08-19 15:45:34 +0200 |
commit | bf0da4df83e8af7ec02e3809f3dd30cc0a42e4bc (patch) | |
tree | 5ac156298a2e13565f877191d1da7e6d6d6276e7 /hw | |
parent | 88266f5aa70fa71fd5cc20aa4dbeb7a7bd8d2e92 (diff) | |
download | qemu-bf0da4df83e8af7ec02e3809f3dd30cc0a42e4bc.zip qemu-bf0da4df83e8af7ec02e3809f3dd30cc0a42e4bc.tar.gz qemu-bf0da4df83e8af7ec02e3809f3dd30cc0a42e4bc.tar.bz2 |
dataplane/virtio-blk: check exit conditions before aio_poll()
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>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/block/dataplane/virtio-blk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 411becc..5bd5eed 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -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; } |