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 03 of 22 v2] xenpaging: add xs_handle to struct xenpa

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH 03 of 22 v2] xenpaging: add xs_handle to struct xenpaging
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Mon, 20 Jun 2011 11:58:33 +0200
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 20 Jun 2011 03:01:10 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1308563914; l=1768; s=domk; d=aepfle.de; h=In-Reply-To:Content-Type:MIME-Version:References:Subject:Cc:To:From: Date:X-RZG-CLASS-ID:X-RZG-AUTH; bh=+ri+6no6vHuQx5t750BvdzVDcoE=; b=TucKYtPDZ0ehQTnO67J456+cBbcnIBvnbDZxqTGckNpUq7J6LLkbn45AI4ieUjxlCxE zip2vPX3s5HhN+XUiy8h/tAesB8EI6y/CCPsbOcLag2/sTa7RRkFzqoet3ML4xM0VaV9j TwQvzpqtJFEHhhstElOlQ6S57uYWiiyRljA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1308049512.17937.61.camel@xxxxxxxxxxxxxxxxxxxxxx>
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>
References: <patchbomb.1307697169@xxxxxxxxxxxx> <2d2fe3e2bd73d0c257bb.1307697172@xxxxxxxxxxxx> <1308049512.17937.61.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-12-30)
A xs_handle is currently used in the xc_mem_paging_flush_ioemu_cache()
function and will be used by a subsequent patch.
Add it to struct xenpaging.

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r f22ff6847990 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Mon Jun 20 10:58:38 2011 +0200
+++ b/tools/xenpaging/xenpaging.c       Mon Jun 20 11:06:21 2011 +0200
@@ -28,6 +28,7 @@
 #include <signal.h>
 #include <unistd.h>
 #include <xc_private.h>
+#include <xs.h>
 
 #include <xen/mem_event.h>
 
@@ -92,6 +93,14 @@ static xenpaging_t *xenpaging_init(domid
     paging = malloc(sizeof(xenpaging_t));
     memset(paging, 0, sizeof(xenpaging_t));
 
+    /* Open connection to xenstore */
+    paging->xs_handle = xs_open(0);
+    if ( paging->xs_handle == NULL )
+    {
+        ERROR("Error initialising xenstore connection");
+        goto err;
+    }
+
     p = getenv("XENPAGING_POLICY_MRU_SIZE");
     if ( p && *p )
     {
@@ -221,6 +230,8 @@ static xenpaging_t *xenpaging_init(domid
  err:
     if ( paging )
     {
+        if ( paging->xs_handle )
+            xs_close(paging->xs_handle);
         xc_interface_close(xch);
         if ( paging->mem_event.shared_page )
         {
@@ -277,6 +288,9 @@ static int xenpaging_teardown(xenpaging_
     }
     paging->mem_event.xce_handle = NULL;
     
+    /* Close connection to xenstore */
+    xs_daemon_close(paging->xs_handle);
+
     /* Close connection to Xen */
     rc = xc_interface_close(xch);
     if ( rc != 0 )
diff -r f22ff6847990 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h       Mon Jun 20 10:58:38 2011 +0200
+++ b/tools/xenpaging/xenpaging.h       Mon Jun 20 11:06:21 2011 +0200
@@ -36,6 +36,7 @@
 
 typedef struct xenpaging {
     xc_interface *xc_handle;
+    struct xs_handle *xs_handle;
 
     xc_platform_info_t *platform_info;
     xc_domaininfo_t    *domain_info;

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