From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTICC-0001sZ-KF for qemu-devel@nongnu.org; Wed, 13 Aug 2008 11:23:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTICB-0001s8-4u for qemu-devel@nongnu.org; Wed, 13 Aug 2008 11:23:32 -0400 Received: from [199.232.76.173] (port=40166 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTICB-0001s4-2O for qemu-devel@nongnu.org; Wed, 13 Aug 2008 11:23:31 -0400 Received: from il.qumranet.com ([212.179.150.194]:21141) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTICA-0003xM-Oc for qemu-devel@nongnu.org; Wed, 13 Aug 2008 11:23:30 -0400 Received: from gleb-debian.qumranet.com (gleb-debian.qumranet.com.qumranet.com [172.16.15.143]) by il.qumranet.com (Postfix) with ESMTP id C5159250310 for ; Wed, 13 Aug 2008 18:23:29 +0300 (IDT) Date: Wed, 13 Aug 2008 18:23:29 +0300 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCH] Flush pending AIO on reboot and shutdown. Message-ID: <20080813152329.GG17567@minantech.com> References: <20080813132358.17672.68212.stgit@gleb-debian.qumranet.com.qumranet.com> <48A2E732.4040501@codemonkey.ws> <20080813141346.GC17567@minantech.com> <48A2F89A.20609@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A2F89A.20609@codemonkey.ws> 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 Wed, Aug 13, 2008 at 10:07:06AM -0500, Anthony Liguori wrote: >>> Perhaps the aio block layer should do qemu_register_reset() with a >>> handler that does a flush. >>> >>> >> I though about doing it this way, but then I saw that qemu_register_reset() >> is used for HW reset notification only. I don't think that hw/ide.c is the >> right place to register the notifier though, so I decided to call it >> explicitly. Do you think I should do qemu_register_reset() in block.c? >> > > But shouldn't the various disk types be the ones to flush their > outstanding IO on reset? > Yes, conceptually this is what should be done. But all outstanding block IO requests are stored in one global list in block-raw.c and this file also provides a global facility to flush all request from this global queue that is why I used it. Otherwise each subsisted will have to be touched to have desired affect. -- Gleb.