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-changelog

[Xen-changelog] [xen-3.1-testing] ioemu: IDE flush on O_DIRECT with driv

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.1-testing] ioemu: IDE flush on O_DIRECT with drive caching off.
From: "Xen patchbot-3.1-testing" <patchbot-3.1-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Feb 2008 14:10:35 -0800
Delivery-date: Tue, 26 Feb 2008 14:10:32 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1204038402 0
# Node ID 215fb8f1f8107131936cf31d69e5b299186a3f83
# Parent  939fccc415c2e1287a165d116d02b9af3eb96750
ioemu: IDE flush on O_DIRECT with drive caching off.

Long ago Xen added code to the device model to basically do an fsync()
after every data write if the user in the guest specified that IDE
write caching should be disabled.  This works fine, except in the case
where you are doing O_DIRECT writes inside the guest (ala dd
if=/dev/zero of=/dev/hdb oflag=direct). This is because you can get
out of ide_write_dma_cb() in the middle of the loop without going
through the logic to sync.  This simple patch makes sure that you
always check (and sync) inside the write callback.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 tools/ioemu/hw/ide.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -r 939fccc415c2 -r 215fb8f1f810 tools/ioemu/hw/ide.c
--- a/tools/ioemu/hw/ide.c      Thu Feb 21 15:15:36 2008 +0000
+++ b/tools/ioemu/hw/ide.c      Tue Feb 26 15:06:42 2008 +0000
@@ -1028,7 +1028,9 @@ static int ide_write_dma_cb(IDEState *s,
 #else  /* !DMA_MULTI_THREAD */
                     ;
 #endif /* DMA_MULTI_THREAD */
-                return 0;
+
+               /* make sure that we (possibly) flush before leaving */
+               break;
             }
             if (n > MAX_MULT_SECTORS)
                 n = MAX_MULT_SECTORS;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.1-testing] ioemu: IDE flush on O_DIRECT with drive caching off., Xen patchbot-3.1-testing <=