]> xenbits.xen.org Git - xenclient/ioemu.git/commitdiff
ide: wait for outstanding aio requests before unplugging the disk
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 31 Mar 2009 15:51:03 +0000 (16:51 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 31 Mar 2009 15:51:03 +0000 (16:51 +0100)
this patch adds a wait on the completion of any outstanding aio requests
before unplugging the hard drive.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
hw/ide.c

index 7031ba1f4956a596f772ec025ab1272562b00dac..febc87ed66f1302f882603de0679facb9ab4ece1 100644 (file)
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -3098,6 +3098,8 @@ static void _ide_unplug_harddisks(int start)
         fprintf(stderr, "No principal controller?\n");
         return;
     }
+    /* wait for outstanding aio requests */
+    qemu_aio_flush();
     for (i = start; i < 4; i++) {
         s = principal_ide_controller->ide_if + i;
         if (!s->bs)