From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm3Oz-0007ov-OU for qemu-devel@nongnu.org; Tue, 03 Jul 2012 09:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sm3Ox-0001ML-J8 for qemu-devel@nongnu.org; Tue, 03 Jul 2012 09:44:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19019) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sm3Ox-0001Lg-BW for qemu-devel@nongnu.org; Tue, 03 Jul 2012 09:44:23 -0400 Message-ID: <4FF2F722.8080808@redhat.com> Date: Tue, 03 Jul 2012 15:44:02 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1340749583-5292-1-git-send-email-morita.kazutaka@lab.ntt.co.jp> <1340749583-5292-3-git-send-email-morita.kazutaka@lab.ntt.co.jp> <4FF2EF0E.2030802@redhat.com> In-Reply-To: <4FF2EF0E.2030802@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/6] sheepdog: restart I/O when socket becomes ready in do_co_req() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, MORITA Kazutaka Il 03/07/2012 15:09, Kevin Wolf ha scritto: >> > Signed-off-by: MORITA Kazutaka >> > --- >> > block/sheepdog.c | 14 ++++++++++++++ >> > 1 files changed, 14 insertions(+), 0 deletions(-) > Paolo, is this how qemu_co_recv/send are supposed to be used? Yes. > Shouldn't > the functions take care of reentering the coroutine like the block > functions do? No, because qemu_co_recv/send are generic outside the block layer and they don't have enough context from the caller to set up the handler. For example qemu_co_send to keep the recv handler, but in turn the recv handler might have its own opaque. In fact, qemu_co_recv/send originated in sheepdog :) so they are (even with all the refactoring that went in since) Kazutaka's pet too! Paolo