WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] wait for outstanding aio requests before unplugging

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] wait for outstanding aio requests before unplugging the disk
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 25 Mar 2009 14:58:52 +0000
Delivery-date: Wed, 25 Mar 2009 08:06:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080505)
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@xxxxxxxxxxxxx>

---

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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] wait for outstanding aio requests before unplugging the disk, Stefano Stabellini <=