From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Id8zL-0003fe-2L for qemu-devel@nongnu.org; Wed, 03 Oct 2007 14:30:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Id8zH-0003c0-Ak for qemu-devel@nongnu.org; Wed, 03 Oct 2007 14:30:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Id8zH-0003bq-4R for qemu-devel@nongnu.org; Wed, 03 Oct 2007 14:30:23 -0400 Received: from wx-out-0506.google.com ([66.249.82.237]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Id8zG-0000xB-Sz for qemu-devel@nongnu.org; Wed, 03 Oct 2007 14:30:23 -0400 Received: by wx-out-0506.google.com with SMTP id h31so4064295wxd for ; Wed, 03 Oct 2007 11:30:22 -0700 (PDT) Message-ID: <779506c70710031130w742906e9me6bc47a3a412c716@mail.gmail.com> Date: Wed, 3 Oct 2007 14:30:22 -0400 From: "Leonardo Reiter" Subject: Re: [Qemu-devel] Hard disk support is broken in Windows 98SE guest In-Reply-To: <779506c70710031118p6ea95878i553ddc04c013ea6e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <47026ED5.FAC8.003F.0@bnm.org> <20071002164337.GH16772@networkno.de> <47038399.FAC8.003F.0@bnm.org> <779506c70710031118p6ea95878i553ddc04c013ea6e@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 10/3/07, Leonardo Reiter wrote: > Index: hw/ide.c > =================================================================== > RCS file: /cvsroot/qemu/qemu/hw/ide.c,v > retrieving revision 1.69 > diff -a -u -r1.69 ide.c > --- hw/ide.c 17 Sep 2007 08:09:47 -0000 1.69 > +++ hw/ide.c 3 Oct 2007 18:00:31 -0000 > @@ -900,7 +900,9 @@ > if(bm == NULL) { > bm = qemu_mallocz(sizeof(BMDMAState)); > s->bmdma = bm; > - } > + } else if (bm->aiocb != NULL) > + qemu_aio_wait(); > + > bm->ide_if = s; > bm->dma_cb = ide_sector_write_aio_cb; > > > The danger here is that the AIO signal came in already by the time we > call qemu_aio_wait() (but bm->aiocb was not called yet), which is > pretty unlikely, but I think it could trigger a deadlock. If you want to try that hack, I think it's probably safer (and more correct) to use qemu_aio_flush() instead of qemu_aio_wait(). Regards, Leo Reiter