]> git.ipfire.org Git - thirdparty/qemu.git/commit
dataplane: replace internal thread with IOThread
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 3 Mar 2014 10:30:08 +0000 (11:30 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 13 Mar 2014 13:42:24 +0000 (14:42 +0100)
commit48ff269272f18d2b8fa53cb08365df417588f585
tree45fb082c737ed43501322e2fd042d5a03d655785
parent6e4a876b433f78f72724f45ae3f9e26596da1b4d
dataplane: replace internal thread with IOThread

Today virtio-blk dataplane uses a 1:1 device-per-thread model.  Now that
IOThreads have been introduced we can generalize this to N:M devices per
threads.

This patch drops thread code from dataplane in favor of running inside
an IOThread AioContext.

As a bonus we solve the case where a guest keeps submitting I/O requests
while dataplane is trying to stop.  Previously the dataplane thread
would continue to process requests until the request gave it a break.
Now we can shut down in bounded time thanks to
aio_context_acquire/release.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
hw/block/dataplane/virtio-blk.c
include/hw/virtio/virtio-blk.h