Received: from eggs.gnu.org ([2001:4830:134:3::10]:56694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk275-0003Wo-4M for qemu-devel@nongnu.org; Mon, 12 May 2014 22:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk270-0002Ud-1m for qemu-devel@nongnu.org; Mon, 12 May 2014 22:06:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk26z-0002UX-QT for qemu-devel@nongnu.org; Mon, 12 May 2014 22:06:33 -0400 Date: Tue, 13 May 2014 10:06:40 +0800 From: Fam Zheng Message-ID: <20140513020640.GA26360@T430.nay.redhat.com> References: <1399559698-31900-1-git-send-email-stefanha@redhat.com> <1399559698-31900-8-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1399559698-31900-8-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 07/25] curl: implement .bdrv_detach/attach_aio_context() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Paolo Bonzini , Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger On Thu, 05/08 16:34, Stefan Hajnoczi wrote: > The curl block driver uses fd handlers, timers, and BHs. The fd > handlers and timers are managed on behalf of libcurl, which controls > them using callback functions that the block driver implements. > > The simplest way to implement .bdrv_detach/attach_aio_context() is to > clean up libcurl in the old event loop and initialize it again in the > new event loop. We do not need to keep track of anything since there > are no pending requests when the AioContext is changed. > > Also make sure to use aio_set_fd_handler() instead of > qemu_aio_set_fd_handler() and aio_bh_new() instead of qemu_bh_new() so > the current AioContext is passed in. > > Cc: Alexander Graf > Cc: Fam Zheng > Signed-off-by: Stefan Hajnoczi Looks good to me, Reviewed-by: Fam Zheng