qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] Prevent disk data loss when closing qemu


From: Pavel Dovgaluk
Subject: Re: [Qemu-devel] [PATCH] Prevent disk data loss when closing qemu
Date: Wed, 16 May 2012 14:16:07 +0400

I use qemu under Windows and it has two windows when executes - console and SDL 
ones.
When I close SDL window main loop function terminates correctly, and when I 
close 
console window to terminate qemu then the code after main loop is not executed.

Pavel Dovgaluk

From: dunrong huang [mailto:address@hidden 
Sent: Wednesday, May 16, 2012 12:17 PM
To: Pavel Dovgaluk
Cc: qemu-devel
Subject: Re: [Qemu-devel] [PATCH] Prevent disk data loss when closing qemu

What's the difference of these two method to call bdrv_close_all?

If you close qemu window, the main_loop will return immediately, and call 
bdrv_close_all.
2012/5/16 Pavel Dovgaluk <address@hidden>
Prevent disk data loss when closing qemu window.

Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/vl.c b/vl.c
index 23ab3a3..b6cfd29 100644
--- a/vl.c
+++ b/vl.c
@@ -3650,10 +3650,10 @@ int main(int argc, char **argv, char **envp)
    }

    os_setup_post();
+    atexit(bdrv_close_all);

    resume_all_vcpus();
    main_loop();
-    bdrv_close_all();
    pause_all_vcpus();
    net_cleanup();
    res_free();






-- 
linuxer and emacser and pythoner living in beijing
blog: http://mathslinux.org
twitter: https://twitter.com/mathslinux
google+: https://plus.google.com/118129852578326338750




reply via email to

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