File xenpaging.evict_mmap_readonly.patch of Package xen

xenpaging: mmap gfn to evict in readonly mode

nominate/evict will not modify the page so there is no need to map the page rw.

---
 tools/xenpaging/xenpaging.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Index: xen-4.1.2-testing/tools/xenpaging/xenpaging.c
===================================================================
--- xen-4.1.2-testing.orig/tools/xenpaging/xenpaging.c
+++ xen-4.1.2-testing/tools/xenpaging/xenpaging.c
@@ -575,8 +575,7 @@ static int xenpaging_evict_page(xenpagin
 
     /* Map page to get a handle */
     gfn = victim->gfn;
-    page = xc_map_foreign_pages(xch, paging->mem_event.domain_id,
-                                PROT_READ | PROT_WRITE, &gfn, 1);
+    page = xc_map_foreign_pages(xch, paging->mem_event.domain_id, PROT_READ, &gfn, 1);
     if ( page == NULL )
     {
         if ( errno == EINVAL )
openSUSE Build Service is sponsored by