[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: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 03/15] sheepdog: move coroutine send/recv function to generic code |
Date: |
Mon, 19 Sep 2011 09:47:53 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
Am 17.09.2011 16:49, schrieb Paolo Bonzini:
> 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
> 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)?
As long as it's clear what the current version is, I don't mind. Do I
understand right that there will be a v3 for patches 3 and 4?
Kevin
[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
[Qemu-devel] [PATCH v2 07/15] block: add bdrv_co_flush support, Paolo Bonzini, 2011/09/16