From: Ian Jackson Date: Tue, 31 Mar 2009 15:51:03 +0000 (+0100) Subject: ide: wait for outstanding aio requests before unplugging the disk X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=73d0f9a5439717a7c6661ac9ff87656bd7bc2938;p=xenclient%2Fioemu.git ide: wait for outstanding aio requests before unplugging the disk this patch adds a wait on the completion of any outstanding aio requests before unplugging the hard drive. Signed-off-by: Stefano Stabellini --- diff --git a/hw/ide.c b/hw/ide.c index 7031ba1f..febc87ed 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)