From: John Snow Date: Fri, 23 Sep 2016 01:45:51 +0000 (-0400) Subject: qemu: use bdrv_flush_all for vm_stop et al X-Git-Tag: TizenStudio_2.0_p2.3.2~9^2~14^2~5^2~144^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22af08eacf6b5aa0e6c0581e547380b3eb4f95e9;p=sdk%2Femulator%2Fqemu.git qemu: use bdrv_flush_all for vm_stop et al 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 Reviewed-by: Kevin Wolf Reviewed-by: Max Reitz Acked-by: Fam Zheng Signed-off-by: Kevin Wolf --- diff --git a/cpus.c b/cpus.c index b2fbe33..31204bb 100644 --- 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(); } }