Skip to contentSkip to conversation

wait for outstanding aio requests before unplugging the disk

PATCH New Stefano Stabellini 1 participant 1 message Mar 25, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

hw/ide.c +2 -0
index 7031ba1..febc87e 100644
@@ -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)