All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pavel Dovgaluk" <Pavel.Dovgaluk@ispras.ru>
To: 'dunrong huang' <riegamaths@gmail.com>
Cc: 'qemu-devel' <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Prevent disk data loss when closing qemu
Date: Wed, 16 May 2012 14:16:07 +0400	[thread overview]
Message-ID: <001001cd334c$e8d95260$ba8bf720$@Dovgaluk@ispras.ru> (raw)
In-Reply-To: <CAOZVR5a8ONxE+XZSJXON3hConUEJNryJCta8cbwcPKbjb30-Zw@mail.gmail.com>

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:riegamaths@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.Dovgaluk@ispras.ru>
Prevent disk data loss when closing qemu window.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@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

  reply	other threads:[~2012-05-16 10:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4fb35a7e.2458b40a.3ed6.649cSMTPIN_ADDED@mx.google.com>
2012-05-16  8:16 ` [Qemu-devel] [PATCH] Prevent disk data loss when closing qemu dunrong huang
2012-05-16 10:16   ` Pavel Dovgaluk [this message]
2012-05-22  8:51     ` Kevin Wolf
2012-05-22  9:25       ` Paolo Bonzini
2012-05-23  6:48         ` Pavel Dovgaluk
     [not found]         ` <3123.31610261953$1337755763@news.gmane.org>
2012-05-23  7:03           ` Paolo Bonzini
2012-05-24  7:41             ` Pavel Dovgaluk
2012-05-16  7:42 Pavel Dovgaluk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001001cd334c$e8d95260$ba8bf720$@Dovgaluk@ispras.ru' \
    --to=pavel.dovgaluk@ispras.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=riegamaths@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.