Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
xen
24329-Teach_xenpaging_to_use_the_new_and_non-ra...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 24329-Teach_xenpaging_to_use_the_new_and_non-racy_xc_mem_paging_load_interface.patch of Package xen
changeset: 24329:a8f5faa127c4 user: Andres Lagar-Cavilla <andres@lagarcavilla.org> date: Thu Dec 01 18:14:24 2011 +0000 files: tools/xenpaging/xenpaging.c description: Teach xenpaging to use the new and non-racy xc_mem_paging_load interface Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Olaf Hering <olaf@aepfle.de> Committed-by: Tim Deegan <tim@xen.org> --- tools/xenpaging/xenpaging.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 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 @@ -45,6 +45,7 @@ static char *dom_path; static char watch_token[16]; static char *filename; static int interrupted; +static void *paging_buffer = NULL; static void unlink_pagefile(void) { @@ -438,6 +439,13 @@ static xenpaging_t *xenpaging_init(int a goto err; } + paging_buffer = init_page(); + if ( !paging_buffer ) + { + ERROR("Creating page aligned load buffer"); + goto err; + } + return paging; err: @@ -649,10 +657,20 @@ static int xenpaging_populate_page(xenpa unsigned char oom = 0; DPRINTF("populate_page < gfn %"PRI_xen_pfn" pageslot %d\n", gfn, i); + + /* Read page */ + ret = read_page(fd, paging_buffer, i); + if ( ret != 0 ) + { + ERROR("Error reading page"); + goto out; + } + do { /* Tell Xen to allocate a page for the domain */ - ret = xc_mem_paging_prep(xch, paging->mem_event.domain_id, gfn); + ret = xc_mem_paging_load(xch, paging->mem_event.domain_id, gfn, + paging_buffer); if ( ret != 0 ) { if ( errno == ENOMEM ) @@ -662,33 +680,14 @@ static int xenpaging_populate_page(xenpa sleep(1); continue; } - PERROR("Error preparing %"PRI_xen_pfn" for page-in", gfn); - goto out_map; + PERROR("Error loading %"PRI_xen_pfn" during page-in", gfn); + goto out; } } while ( ret && !interrupted ); - /* Map page */ - ret = -EFAULT; - page = xc_map_foreign_pages(xch, paging->mem_event.domain_id, - PROT_READ | PROT_WRITE, &gfn, 1); - if ( page == NULL ) - { - PERROR("Error mapping page %"PRI_xen_pfn": page is null", gfn); - goto out_map; - } - - /* Read page */ - ret = read_page(fd, page, i); - if ( ret != 0 ) - { - PERROR("Error reading page %"PRI_xen_pfn"", gfn); - goto out; - } out: - munmap(page, PAGE_SIZE); - out_map: return ret; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor