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] xenpaging: Open paging file only if xenpa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xenpaging: Open paging file only if xenpaging_init() succeeds
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 27 Nov 2010 06:25:13 -0800
Delivery-date: Sat, 27 Nov 2010 06:25:54 -0800
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@xxxxxxx>
# Date 1290780959 0
# Node ID 7818ea9045fd1aa9dd7ef2e1b6a6281e296ae9d9
# Parent  0d0a18cd416f55921a686c32a1a8955d80907545
xenpaging: Open paging file only if xenpaging_init() succeeds

Open paging file only if xenpaging_init() succeeds. It can fail if the
host does not support the required virtualization features such as EPT
or if xenpaging was already started for this domain_id.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
Already-Acked-by: Patrick Colp <pjcolp@xxxxxxxxx>
Already-Acked-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/xenpaging/xenpaging.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff -r 0d0a18cd416f -r 7818ea9045fd tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Fri Nov 26 14:15:21 2010 +0000
+++ b/tools/xenpaging/xenpaging.c       Fri Nov 26 14:15:59 2010 +0000
@@ -502,6 +502,17 @@ int main(int argc, char *argv[])
 
     victims = calloc(num_pages, sizeof(xenpaging_victim_t));
 
+    /* Seed random-number generator */
+    srand(time(NULL));
+
+    /* Initialise domain paging */
+    paging = xenpaging_init(&xch, domain_id);
+    if ( paging == NULL )
+    {
+        ERROR("Error initialising paging");
+        goto out;
+    }
+
     /* Open file */
     sprintf(filename, "page_cache_%d", domain_id);
     fd = open(filename, open_flags, open_mode);
@@ -509,17 +520,6 @@ int main(int argc, char *argv[])
     {
         perror("failed to open file");
         return -1;
-    }
-
-    /* Seed random-number generator */
-    srand(time(NULL));
-
-    /* Initialise domain paging */
-    paging = xenpaging_init(&xch, domain_id);
-    if ( paging == NULL )
-    {
-        ERROR("Error initialising paging");
-        goto out;
     }
 
     /* Evict pages */

_______________________________________________
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] xenpaging: Open paging file only if xenpaging_init() succeeds, Xen patchbot-unstable <=