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]>
bdrv_drain_all();
replay_disable_events();
- ret = blk_flush_all();
+ ret = bdrv_flush_all();
return ret;
}
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();
}
}