From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiOZP-00017c-NP for qemu-devel@nongnu.org; Thu, 08 May 2014 09:41:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiOZK-0008Oz-1o for qemu-devel@nongnu.org; Thu, 08 May 2014 09:41:07 -0400 Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]:52918) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiOZJ-0008OX-Nc for qemu-devel@nongnu.org; Thu, 08 May 2014 09:41:01 -0400 Received: by mail-we0-f171.google.com with SMTP id w62so2502081wes.2 for ; Thu, 08 May 2014 06:41:00 -0700 (PDT) Date: Thu, 8 May 2014 15:40:57 +0200 From: Stefan Hajnoczi Message-ID: <20140508134057.GB13226@stefanha-thinkpad.redhat.com> References: <1399458461-3997-1-git-send-email-stefanha@redhat.com> <1399458461-3997-10-git-send-email-stefanha@redhat.com> <536A3FC7.2090102@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <536A3FC7.2090102@kamp.de> Subject: Re: [Qemu-devel] [PATCH v2 09/25] iscsi: implement .bdrv_detach/attach_aio_context() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Kevin Wolf , Paolo Bonzini , Ronnie Sahlberg , qemu-devel@nongnu.org, Stefan Hajnoczi On Wed, May 07, 2014 at 04:14:31PM +0200, Peter Lieven wrote: > On 07.05.2014 12:27, Stefan Hajnoczi wrote: > >Drop the assumption that we're using the main AioContext for Linux > >AIO. Convert qemu_aio_set_fd_handler() to aio_set_fd_handler() and > >timer_new_ms() to aio_timer_new(). > > > >The .bdrv_detach/attach_aio_context() interfaces also need to be > >implemented to move the fd and timer from the old to the new AioContext. > > > >Cc: Peter Lieven > >Cc: Ronnie Sahlberg > >Signed-off-by: Stefan Hajnoczi > >--- > > block/iscsi.c | 79 +++++++++++++++++++++++++++++++++++++++++------------------ > > 1 file changed, 55 insertions(+), 24 deletions(-) > > > >diff --git a/block/iscsi.c b/block/iscsi.c > >index a30202b..81e3ebd 100644 > >--- a/block/iscsi.c > >+++ b/block/iscsi.c > >@@ -47,6 +47,7 @@ > > typedef struct IscsiLun { > > struct iscsi_context *iscsi; > >+ AioContext *aio_context; > > int lun; > > enum scsi_inquiry_peripheral_device_type type; > > int block_size; > >@@ -69,6 +70,7 @@ typedef struct IscsiTask { > > struct scsi_task *task; > > Coroutine *co; > > QEMUBH *bh; > >+ AioContext *aio_context; > > If you need to respin I would copy the pointer to the whole IscsiLun struct just > in case we need access to any other member in the future. Fixed in v3. Also using IscsiLun->aio_context where possible instead of calling bdrv_get_aio_context(bs) so the field is used consistently. Stefan