On Sunday 03 September 2006 09:51, Blue Swirl wrote:
> >Implementing it this way does mean savevm can effect the guest VM state
> > (it causes all pending IO to complete immediately). However this should
> > be safe, ie. it could occur by chance anyway, and qemu isn't deterministic
> > to start with. 
>
> What would be the right place for the AIO flush, how about bdrv_flush?
> Would it be OK to add bdrv_flush just before qemu_fopen_bdrv in do_savevm?

No bdrv_flush if completely different, and has no observable effect[1].

When savevm is issued, you need to halt the guest CPUs, and wait for all IO to 
complete. While doing this you need to allow device AIO completion routines 
to run, which may trigger additional IO. Once all IO has been completed you 
should then be able to safely save state.

Paul

[1] ie. should be safe to call bdrv_flush at any time, and bdrv_flush is never 
necessary for correct operations. It's purpose is to help ensure data 
consistency if the host machine dies unexpectedly.


_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to