]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commitdiff
use xc_domain_add_to_physmap instead of open coding xc_memory_op
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 18 Oct 2010 16:24:50 +0000 (17:24 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 18 Oct 2010 16:24:50 +0000 (17:24 +0100)
[ Compatibility note: requires xen-unstable changeset 90a64629f7c0 ]

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
hw/vga.c

index fbc41d4786f91cdadf951d92b5f5d5e53b33e1b1..d0c12aabd7c93a6fb82b2d9f72b356e82c12a63c 100644 (file)
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2142,7 +2142,6 @@ static CPUWriteMemoryFunc *vga_mem_write[3] = {
 void set_vram_mapping(void *opaque, unsigned long begin, unsigned long end)
 {
     unsigned long i;
-    struct xen_add_to_physmap xatp;
     int rc;
     VGAState *s = (VGAState *) opaque;
 
@@ -2151,15 +2150,12 @@ void set_vram_mapping(void *opaque, unsigned long begin, unsigned long end)
 
     fprintf(logfile,"mapping vram to %lx - %lx\n", begin, end);
 
-    xatp.domid = domid;
-    xatp.space = XENMAPSPACE_gmfn;
-
     for (i = 0; i < (end - begin) >> TARGET_PAGE_BITS; i++) {
-        xatp.idx = (s->vram_gmfn >> TARGET_PAGE_BITS) + i;
-        xatp.gpfn = (begin >> TARGET_PAGE_BITS) + i;
-        rc = xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp);
+        unsigned long idx = (s->vram_gmfn >> TARGET_PAGE_BITS) + i;
+        xen_pfn_t gpfn = (begin >> TARGET_PAGE_BITS) + i;
+        rc = xc_domain_add_to_physmap(xc_handle, domid, XENMAPSPACE_gmfn, idx, gpfn);
         if (rc) {
-            fprintf(stderr, "add_to_physmap MFN %"PRI_xen_pfn" to PFN %"PRI_xen_pfn" failed: %d\n", xatp.idx, xatp.gpfn, rc);
+            fprintf(stderr, "add_to_physmap MFN %"PRI_xen_pfn" to PFN %"PRI_xen_pfn" failed: %d\n", idx, gpfn, rc);
             return;
         }
     }