Stefano Stabellini
2009-Mar-25 14:58 UTC
[Xen-devel] [PATCH] wait for outstanding aio requests before unplugging the disk
Hi all, 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> --- diff --git a/hw/ide.c b/hw/ide.c index 7031ba1..febc87e 100644 --- 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) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel