]> Git Repo - qemu.git/commitdiff
qemu: use bdrv_flush_all for vm_stop et al
authorJohn Snow <[email protected]>
Fri, 23 Sep 2016 01:45:51 +0000 (21:45 -0400)
committerKevin Wolf <[email protected]>
Thu, 29 Sep 2016 12:13:37 +0000 (14:13 +0200)
Reimplement bdrv_flush_all for vm_stop. In contrast to blk_flush_all,
bdrv_flush_all does not have device model restrictions. This allows
us to flush and halt unconditionally without error.

This allows us to do things like migrate when we have a device with
an open tray, but has a node that may need to be flushed, or nodes
that aren't currently attached to any device and need to be flushed.

Specifically, this allows us to migrate when we have a CDROM with
an open tray.

Signed-off-by: John Snow <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Acked-by: Fam Zheng <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
cpus.c

diff --git a/cpus.c b/cpus.c
index b2fbe3330403c598c2a63ad26acda4131196a0df..31204bb4b3dd3ecd750af00a50fb4a0e1cea4092 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -751,7 +751,7 @@ static int do_vm_stop(RunState state)
 
     bdrv_drain_all();
     replay_disable_events();
-    ret = blk_flush_all();
+    ret = bdrv_flush_all();
 
     return ret;
 }
@@ -1408,7 +1408,7 @@ int vm_stop_force_state(RunState state)
         bdrv_drain_all();
         /* Make sure to return an error if the flush in a previous vm_stop()
          * failed. */
-        return blk_flush_all();
+        return bdrv_flush_all();
     }
 }
 
This page took 0.026399 seconds and 4 git commands to generate.