diff options
Diffstat (limited to 'nbd.c')
-rw-r--r-- | nbd.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -81,6 +81,14 @@ size_t nbd_wr_sync(int fd, void *buffer, size_t size, bool do_read) { 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; |