From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUbHF-0004JU-Nm for qemu-devel@nongnu.org; Wed, 16 May 2012 06:16:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUbH8-0000ue-82 for qemu-devel@nongnu.org; Wed, 16 May 2012 06:16:17 -0400 Received: from mail.ispras.ru ([83.149.199.43]:60671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUbH8-0000uR-0M for qemu-devel@nongnu.org; Wed, 16 May 2012 06:16:10 -0400 From: "Pavel Dovgaluk" References: <4fb35a7e.2458b40a.3ed6.649cSMTPIN_ADDED@mx.google.com> In-Reply-To: Date: Wed, 16 May 2012 14:16:07 +0400 Message-ID: <001001cd334c$e8d95260$ba8bf720$@Dovgaluk@ispras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Content-Language: ru Subject: Re: [Qemu-devel] [PATCH] Prevent disk data loss when closing qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'dunrong huang' Cc: 'qemu-devel' 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=20 console window to terminate qemu then the code after main loop is not = executed. Pavel Dovgaluk From: dunrong huang [mailto:riegamaths@gmail.com]=20 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 Prevent disk data loss when closing qemu window. Signed-off-by: Pavel Dovgalyuk --- =9Avl.c | =9A =9A2 +- =9A1 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) =9A =9A } =9A =9A os_setup_post(); + =9A =9Aatexit(bdrv_close_all); =9A =9A resume_all_vcpus(); =9A =9A main_loop(); - =9A =9Abdrv_close_all(); =9A =9A pause_all_vcpus(); =9A =9A net_cleanup(); =9A =9A res_free(); --=20 linuxer and emacser and pythoner living in beijing blog: http://mathslinux.org twitter: https://twitter.com/mathslinux google+: https://plus.google.com/118129852578326338750