OSDN Git Service

qemu-nbd: asynchronous operation
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 19 Sep 2011 13:19:27 +0000 (15:19 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 22 Dec 2011 10:53:59 +0000 (11:53 +0100)
commit262db38871b9a2613761cc5f05c4cf697e246a68
tree6f411fa003a3784224c96fce790cce970d14b71e
parent72deddc5e61e974fbf561dc704742f102b91de82
qemu-nbd: asynchronous operation

Using coroutines enable asynchronous operation on both the network and
the block side.  Network can be owned by two coroutines at the same time,
one writing and one reading.  On the send side, mutual exclusion is
guaranteed by a CoMutex.  On the receive side, mutual exclusion is
guaranteed because new coroutines immediately start receiving data,
and no new coroutines are created as long as the previous one is receiving.

Between receive and send, qemu-nbd can have an arbitrary number of
in-flight block transfers.  Throttling is implemented by the next
patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
nbd.c