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 07 of 22] xenpaging: drop xc.c, move xc_mem_paging_fl

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 07 of 22] xenpaging: drop xc.c, move xc_mem_paging_flush_ioemu_cache
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Fri, 10 Jun 2011 11:12:56 +0200
Delivery-date: Fri, 10 Jun 2011 02:26:11 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1307697180; l=2537; s=domk; d=aepfle.de; h=To:From:Date:References:In-Reply-To:Subject: Content-Transfer-Encoding:MIME-Version:Content-Type:X-RZG-CLASS-ID: X-RZG-AUTH; bh=8tQS2KU32pG3mouLP49fUGuzDfM=; b=kls7UPHUJTR5yCFIGDXVCYMpo3z6XW9sWQzWg7C8k9sGL/2xdCf6Kh1iYGL4ChbQI6i Ws5U8tC+aBx9JpgyL5NL1Xm8+mC9x/YEUbR9dAUDrKGEUWOlWdf6xXw5iZFA6i14px97/ pS5cdh9YdyUW/bAjXXUF2I8CFAhDQ2zdAAM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1307697169@xxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1307695630 -7200
# Node ID fe8cb47be2adc95e6181de8c166e4460e1a2e40f
# Parent  44997646bd69e746fbf7421009f5175268da28ce
xenpaging: drop xc.c, move xc_mem_paging_flush_ioemu_cache

Move xc_mem_paging_flush_ioemu_cache() into xenpaging and massage it a bit to
use the required members from xenpaging_t.
Also update type of rc to match xs_write() return value.

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

diff -r 44997646bd69 -r fe8cb47be2ad tools/xenpaging/xc.c
--- a/tools/xenpaging/xc.c      Fri Jun 10 10:47:08 2011 +0200
+++ b/tools/xenpaging/xc.c      Fri Jun 10 10:47:10 2011 +0200
@@ -31,24 +31,6 @@
 
 
 
-int xc_mem_paging_flush_ioemu_cache(domid_t domain_id)
-{
-    struct xs_handle *xsh = NULL;
-    char path[80];
-    int rc;
-
-    sprintf(path, "/local/domain/0/device-model/%u/command", domain_id);
-
-    xsh = xs_daemon_open();
-    if ( xsh == NULL )
-        return -EIO;
-
-    rc = xs_write(xsh, XBT_NULL, path, "flush-cache", strlen("flush-cache")); 
-
-    xs_daemon_close(xsh);
-
-    return rc ? 0 : -1;
-}
 
 int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned 
long ms)
 {
diff -r 44997646bd69 -r fe8cb47be2ad tools/xenpaging/xc.h
--- a/tools/xenpaging/xc.h      Fri Jun 10 10:47:08 2011 +0200
+++ b/tools/xenpaging/xc.h      Fri Jun 10 10:47:10 2011 +0200
@@ -37,7 +37,6 @@
 
 
 
-int xc_mem_paging_flush_ioemu_cache(domid_t domain_id);
 int xc_wait_for_event_or_timeout(xc_interface *xch, xc_evtchn *xce, unsigned 
long ms);
 
 
diff -r 44997646bd69 -r fe8cb47be2ad tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c       Fri Jun 10 10:47:08 2011 +0200
+++ b/tools/xenpaging/xenpaging.c       Fri Jun 10 10:47:10 2011 +0200
@@ -48,6 +48,20 @@ static void close_handler(int sig)
         unlink(filename);
 }
 
+static int xenpaging_mem_paging_flush_ioemu_cache(xenpaging_t *paging)
+{
+    struct xs_handle *xsh = paging->xs_handle;
+    domid_t domain_id = paging->mem_event.domain_id;
+    char path[80];
+    bool rc;
+
+    sprintf(path, "/local/domain/0/device-model/%u/command", domain_id);
+
+    rc = xs_write(xsh, XBT_NULL, path, "flush-cache", strlen("flush-cache")); 
+
+    return rc == true ? 0 : -1;
+}
+
 static void *init_page(void)
 {
     void *buffer;
@@ -484,7 +498,7 @@ static int evict_victim(xenpaging_t *pag
         else
         {
             if ( j++ % 1000 == 0 )
-                if ( 
xc_mem_paging_flush_ioemu_cache(paging->mem_event.domain_id) )
+                if ( xenpaging_mem_paging_flush_ioemu_cache(paging) )
                     ERROR("Error flushing ioemu cache");
         }
     }

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

<Prev in Thread] Current Thread [Next in Thread>