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-unstable] libxc: Flush I/O before xc_domain_save co

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxc: Flush I/O before xc_domain_save completion
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Apr 2010 14:55:12 -0700
Delivery-date: Tue, 13 Apr 2010 14:58:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 1271053336 -3600
# Node ID b5f9c6274d917db5bbe6cb9cc0d59910cc07a8a6
# Parent  5bc70100b514d98bd3938cdeca1e182726c26df2
libxc: Flush I/O before xc_domain_save completion

The final, flushing call to discard_file_cache also discards any
errors from fsync. Call fsync explicitly before leaving, to check if
all VM memory actually made it to the disk.

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
 tools/libxc/xc_domain_save.c |    7 +++++++
 1 files changed, 7 insertions(+)

diff -r 5bc70100b514 -r b5f9c6274d91 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c      Mon Apr 12 07:21:44 2010 +0100
+++ b/tools/libxc/xc_domain_save.c      Mon Apr 12 07:22:16 2010 +0100
@@ -1764,6 +1764,13 @@ int xc_domain_save(int xc_handle, int io
         goto out;
     }
 
+    /* Flush last write and check for errors. */
+    if ( fsync(io_fd) && errno != EINVAL )
+    {
+        PERROR("Error when flushing state file");
+        goto out;
+    }
+
     /* Success! */
     rc = 0;
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxc: Flush I/O before xc_domain_save completion, Xen patchbot-unstable <=