From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlhw-0007y6-T5 for qemu-devel@nongnu.org; Tue, 22 May 2012 05:48:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWlhp-0008DP-GE for qemu-devel@nongnu.org; Tue, 22 May 2012 05:48:48 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:44093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWlhp-0008Cx-7R for qemu-devel@nongnu.org; Tue, 22 May 2012 05:48:41 -0400 Received: by obbwd20 with SMTP id wd20so11757373obb.4 for ; Tue, 22 May 2012 02:48:39 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4FBB5C91.4060504@redhat.com> References: <4FBA1CC4.7020009@redhat.com> <4FBB5C91.4060504@redhat.com> Date: Tue, 22 May 2012 19:48:39 +1000 Message-ID: From: ronnie sahlberg Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Weird iscsi/fd-event issue since recent merge of event system changes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel , Stefan Hajnoczi On Tue, May 22, 2012 at 7:29 PM, Paolo Bonzini wrote: > Il 22/05/2012 11:15, ronnie sahlberg ha scritto: >> Hi, >> >> Now that I see what happens, I can easily workaround this in block/iscsi= .c >> by the patch below, but I dont know if this is the right thing to do. >> >> It does appear that here, =A0when I use qemu_set_fd_handler() and add a >> handler for "writeble" it takes 55ms before the event system notices >> this and reacts. >> >> >> >> diff --git a/block/iscsi.c b/block/iscsi.c >> index d37c4ee..1ebff0f 100644 >> --- a/block/iscsi.c >> +++ b/block/iscsi.c >> @@ -105,6 +105,10 @@ iscsi_set_events(IscsiLun *iscsilun) >> =A0{ >> =A0 =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> >> + =A0 =A0if (iscsi_which_events(iscsi) & POLLOUT) { >> + =A0 =A0 =A0 =A0iscsi_process_write(iscsilun); >> + =A0 =A0} >> + >> =A0 =A0 =A0qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), iscsi_process_re= ad, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (iscsi_which_eve= nts(iscsi) & POLLOUT) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ? iscsi_process_= write : NULL, > > Doh, now I remember. =A0Whenever you change the aio handlers you need to > call qemu_notify_event() afterwards, if the handler may fire right away. Thanks. I just confirmed that qemu_notify_event() fixes the issue. Ill send a patch that uses qemu_notify_event() and a comment why this is ne= eded. regards ronnie sahlberg