aboutsummaryrefslogtreecommitdiff
path: root/block-raw.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-03 12:08:37 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-09-03 12:08:37 +0000
commit6192bc374ff3fb8d7dfc8723dee28559488dfff5 (patch)
treebda053e9e0ab53ed75ad09ac0085fd09bdacc500 /block-raw.c
parenta917d384ac0d09cd68266a6f2ca5c94212c8f81e (diff)
Flush IO requests before savevm (original patch by Blue Swirl).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2140 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-raw.c')
-rw-r--r--block-raw.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/block-raw.c b/block-raw.c
index 3ed4b32de0..3a2843c5d6 100644
--- a/block-raw.c
+++ b/block-raw.c
@@ -247,6 +247,17 @@ void qemu_aio_poll(void)
the_end: ;
}
+/* Wait for all IO requests to complete. */
+void qemu_aio_flush(void)
+{
+ qemu_aio_wait_start();
+ qemu_aio_poll();
+ while (first_aio) {
+ qemu_aio_wait();
+ }
+ qemu_aio_wait_end();
+}
+
/* wait until at least one AIO was handled */
static sigset_t wait_oset;