diff mbox

[v9,08/10] replay: make safe vmstop at record/replay

Message ID 20170504084221.7488.13443.stgit@PASHA-ISP
State New
Headers show

Commit Message

Pavel Dovgalyuk May 4, 2017, 8:42 a.m. UTC
This patch disables bdrv flush/drain in record/replay mode.
When block request is in the replay queue it cannot be processed
with drain/flush until it is found in the log.
Therefore vm should just stop leaving unfinished operations
in the queue.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
 cpus.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index 740b8dc3f8..f21e7f3166 100644
--- a/cpus.c
+++ b/cpus.c
@@ -932,9 +932,10 @@  static int do_vm_stop(RunState state)
         qapi_event_send_stop(&error_abort);
     }
 
-    bdrv_drain_all();
-    replay_disable_events();
-    ret = bdrv_flush_all();
+    if (!replay_events_enabled()) {
+        bdrv_drain_all();
+        ret = bdrv_flush_all();
+    }
 
     return ret;
 }