[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 03/15] sheepdog: move coroutine send/recv fun
From: |
MORITA Kazutaka |
Subject: |
Re: [Qemu-devel] [PATCH v2 03/15] sheepdog: move coroutine send/recv function to generic code |
Date: |
Sun, 18 Sep 2011 02:16:37 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/22.3 (x86_64-pc-linux-gnu) MULE/5.0 (SAKAKI) |
At Sat, 17 Sep 2011 16:49:22 +0200,
Paolo Bonzini wrote:
>
> On 09/17/2011 08:29 AM, MORITA Kazutaka wrote:
> >> > +#else
> >> > + struct iovec *p = iov;
> >> > + ret = 0;
> >> > + while (iovlen> 0) {
> >> > + int rc;
> >> > + if (do_sendv) {
> >> > + rc = send(sockfd, p->iov_base, p->iov_len, 0);
> >> > + } else {
> >> > + rc = qemu_recv(sockfd, p->iov_base, p->iov_len, 0);
> >> > + }
> >> > + if (rc == -1) {
> >> > + if (errno == EINTR) {
> >> > + continue;
> >> > + }
> >> > + if (ret == 0) {
> >> > + ret = -1;
> >> > + }
> >> > + break;
> >> > + }
> >> > + iovlen--, p++;
> >> > + ret += rc;
> >> > + }
> > This code can be called inside coroutines with a non-blocking fd, so
> > should we avoid busy waiting?
>
> It doesn't busy wait, it exits with EAGAIN. I'll squash in here the
Oops, you're right. Sorry for the noise.
Thanks,
Kazutaka
> first hunk of patch 4, which is needed.
>
> qemu_co_recvv already handles reads that return zero, unlike sheepdog's
> do_readv_writev. I probably moved it there inadvertently while moving
> code around to cutils.c, but in order to fix qemu-ga I need to create a
> new file qemu-coroutine-io.c.
>
> Kevin, do you want me to resubmit everything, or are you going to apply
> some more patches to the block branch (5 to 12 should be fine)?
>
> Paolo
>
[Qemu-devel] [PATCH v2 04/15] coroutine-io: handle zero returns from recv, Paolo Bonzini, 2011/09/16
[Qemu-devel] [PATCH v2 05/15] block: emulate .bdrv_flush() using .bdrv_aio_flush(), Paolo Bonzini, 2011/09/16
[Qemu-devel] [PATCH v2 06/15] block: group together the plugging of synchronous IO emulation, Paolo Bonzini, 2011/09/16
[Qemu-devel] [PATCH v2 12/15] nbd: add support for NBD_CMD_TRIM, Paolo Bonzini, 2011/09/16
[Qemu-devel] [PATCH v2 09/15] nbd: fix error handling in the server, Paolo Bonzini, 2011/09/16
[Qemu-devel] [PATCH v2 10/15] nbd: add support for NBD_CMD_FLUSH, Paolo Bonzini, 2011/09/16
[Qemu-devel] [PATCH v2 08/15] block: add bdrv_co_discard and bdrv_aio_discard support, Paolo Bonzini, 2011/09/16