From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTGn9-0008Bm-IB for qemu-devel@nongnu.org; Wed, 13 Aug 2008 09:53:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTGn8-0008B0-0r for qemu-devel@nongnu.org; Wed, 13 Aug 2008 09:53:35 -0400 Received: from [199.232.76.173] (port=34263 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTGn7-0008Au-R2 for qemu-devel@nongnu.org; Wed, 13 Aug 2008 09:53:33 -0400 Received: from mail-gx0-f19.google.com ([209.85.217.19]:57698) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTGn5-0005Rw-L3 for qemu-devel@nongnu.org; Wed, 13 Aug 2008 09:53:31 -0400 Received: by gxk12 with SMTP id 12so777002gxk.10 for ; Wed, 13 Aug 2008 06:53:29 -0700 (PDT) Message-ID: <48A2E732.4040501@codemonkey.ws> Date: Wed, 13 Aug 2008 08:52:50 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Flush pending AIO on reboot and shutdown. References: <20080813132358.17672.68212.stgit@gleb-debian.qumranet.com.qumranet.com> In-Reply-To: <20080813132358.17672.68212.stgit@gleb-debian.qumranet.com.qumranet.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 Gleb Natapov wrote: > If there is outstanding IDE IO when BIOS starts execution then IDE > commands sent by BIOS will interfere with it and will leave IDE > subsystem in unpredictable state. This can happen when system reboots > unexpectedly without waiting for IO completion. Flushing IO before exit > prevents data lose. > > Signed-off-by: Gleb Natapov > --- > > vl.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/vl.c b/vl.c > index e42ae64..afa2a3a 100644 > --- a/vl.c > +++ b/vl.c > @@ -7553,6 +7553,7 @@ static int main_loop(void) > if (reset_requested) { > reset_requested = 0; > qemu_system_reset(); > + qemu_aio_flush(); > Perhaps the aio block layer should do qemu_register_reset() with a handler that does a flush. Regards, Anthony Liguori > ret = EXCP_INTERRUPT; > } > if (powerdown_requested) { > @@ -9178,6 +9179,7 @@ int main(int argc, char **argv) > } > > main_loop(); > + qemu_aio_flush(); > quit_timers(); > > #if !defined(_WIN32) > > > >