qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Flush pending AIO on reboot and shutdown.


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Flush pending AIO on reboot and shutdown.
Date: Wed, 13 Aug 2008 10:07:06 -0500
User-agent: Thunderbird 2.0.0.16 (X11/20080723)

Gleb Natapov wrote:
On Wed, Aug 13, 2008 at 08:52:50AM -0500, Anthony Liguori wrote:
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 <address@hidden>
---

 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.

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?

Regards,

Anthony Liguori

--
                        Gleb.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]