From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: Re: Windows Bug Check 0x101 issue Date: Mon, 24 Mar 2008 11:01:24 +0000 Message-ID: <20080324110124.GH4434@implementation.uk.xensource.com> References: <7k4pawfnxs.fsf@pingu.sky.yk.fujitsu.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: <7k4pawfnxs.fsf@pingu.sky.yk.fujitsu.co.jp> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Kouya Shimura Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Kouya Shimura, le Mon 24 Mar 2008 18:53:18 +0900, a écrit : Content-Description: message body text > An attached patch fixes it. However I think the root cause is > that a timer event can't interrupt an i/o emulation. The way qemu is designed wouldn't permit that anyway. > How should we fix it? We need to change the behavior of the flush operation, to make it asynchronous, so that things can continue while the host OS is syncing, and eventually the SCSI or IDE layer will report the completion of the flush. > +static void aio_fsync_cb(void *opague, int ret) > +{ > +} > #endif > > static void raw_close(BlockDriverState *bs) > @@ -602,8 +606,20 @@ static int raw_create(const char *filena > > static void raw_flush(BlockDriverState *bs) > { > +#ifdef NO_AIO > BDRVRawState *s = bs->opaque; > fsync(s->fd); > +#else > + RawAIOCB *acb; > + > + acb = raw_aio_setup(bs, 0, NULL, 0, aio_fsync_cb, NULL); > + if (!acb) > + return; > + if (aio_fsync(O_SYNC, &acb->aiocb) < 0) { > + qemu_aio_release(acb); > + return; > + } > +#endif > } That's not correct: callers of bdrv_flush() assume that when it returns, data _is_ on the disk. We need to change that assumption, so that your code becomes correct (and reports asynchronous completion from aio_fsync_cb). Samuel