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:riegama...@gmail.com] 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 <pavel.dovga...@ispras.ru> Prevent disk data loss when closing qemu window. Signed-off-by: Pavel Dovgalyuk <pavel.dovga...@gmail.com> --- 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