commit | ae255e523c256cf0708f1c16cb946ff96340a800 | [log] [tgz] |
---|---|---|
author | Paolo Bonzini <pbonzini@redhat.com> | Thu Sep 08 14:28:59 2011 +0200 |
committer | Paolo Bonzini <pbonzini@redhat.com> | Thu Dec 22 11:53:57 2011 +0100 |
tree | fbc4e2309f43d337ed7ce0c1c7e3582a6008fa5c | |
parent | 8c5135f90e2dcf1d5c3d03106e0ac6e371ccb572 [diff] [blame] |
nbd: switch to asynchronous operation Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/nbd.c b/nbd.c index de880fe..ff701d3 100644 --- a/nbd.c +++ b/nbd.c
@@ -81,6 +81,14 @@ { size_t offset = 0; + if (qemu_in_coroutine()) { + if (do_read) { + return qemu_co_recv(fd, buffer, size); + } else { + return qemu_co_send(fd, buffer, size); + } + } + while (offset < size) { ssize_t len;