qemu-devel
[Top][All Lists]
Advanced

[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
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]