Patchwork Prevent disk data loss when closing qemu

login
register
mail settings
Submitter Pavel Dovgaluk
Date May 16, 2012, 7:42 a.m.
Message ID <000901cd3337$675c1c00$36145400$@Dovgaluk@ispras.ru>
Download mbox | patch
Permalink /patch/159544/
State New
Headers show

Comments

Pavel Dovgaluk - May 16, 2012, 7:42 a.m.
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(-)

Patch

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();