From 73d0f9a5439717a7c6661ac9ff87656bd7bc2938 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 31 Mar 2009 16:51:03 +0100 Subject: [PATCH] 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 --- hw/ide.c | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.39.5