All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wait for outstanding aio requests before unplugging the disk
@ 2009-03-25 14:58 Stefano Stabellini
  0 siblings, 0 replies; only message in thread
From: Stefano Stabellini @ 2009-03-25 14:58 UTC (permalink / raw)
  To: xen-devel

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)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-25 14:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-25 14:58 [PATCH] wait for outstanding aio requests before unplugging the disk Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.