Received: from eggs.gnu.org ([2001:4830:134:3::10]:44618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfzlT-00019o-F7 for qemu-devel@nongnu.org; Thu, 01 May 2014 18:47:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfzlO-0006Yx-8N for qemu-devel@nongnu.org; Thu, 01 May 2014 18:47:39 -0400 Received: from ssl.dlhnet.de ([82.141.21.42]:50733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfzlO-0006Wr-2M for qemu-devel@nongnu.org; Thu, 01 May 2014 18:47:34 -0400 Message-ID: <1ef50e169cf16337710d32b426de3f37.squirrel@ssl.dlhnet.de> Date: Fri, 2 May 2014 00:47:31 +0200 From: "Peter Lieven" MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 08/22] iscsi: implement .bdrv_detach/attach_aio_context() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pl@kamp.de Cc: Kevin Wolf , Ronnie Sahlberg , "Shergill, Gurinder" , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , "Vinod, Chegu" 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; > } IscsiTask; > > typedef struct IscsiAIOCB { > @@ -120,7 +122,7 @@ iscsi_schedule_bh(IscsiAIOCB *acb) > if (acb->bh) { > return; > } > - acb->bh =3D qemu_bh_new(iscsi_bh_cb, acb); > + acb->bh =3D aio_bh_new(acb->iscsilun->aio_context, iscsi_bh_cb, ac= b); > qemu_bh_schedule(acb->bh); > } > > @@ -156,7 +158,7 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, in= t > status, > > out: > if (iTask->co) { > - iTask->bh =3D qemu_bh_new(iscsi_co_generic_bh_cb, iTask); > + iTask->bh =3D aio_bh_new(iTask->aio_context, > iscsi_co_generic_bh_cb, iTask); > qemu_bh_schedule(iTask->bh); > } > } > @@ -164,8 +166,9 @@ out: > static void iscsi_co_init_iscsitask(IscsiLun *iscsilun, struct IscsiTa= sk > *iTask) > { > *iTask =3D (struct IscsiTask) { > - .co =3D qemu_coroutine_self(), > - .retries =3D ISCSI_CMD_RETRIES, > + .co =3D qemu_coroutine_self(),%