Skip to contentSkip to conversation

qemu: use xc_domain_populate_physmap_exact.

PATCH New Ian Campbell 1 participant 2 messages Oct 12, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu: use xc_domain_populate_physmap_exact.

This new function replaces xc_domain_memory_populate_physmap.

---
 hw/vga.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/vga.c +1 -1
index ccbcda9..fbc41d4 100644
@@ -2493,7 +2493,7 @@ void xen_vga_populate_vram(uint64_t vram_addr, uint32_t vga_ram_size)
     for (i = 0; i < nr_pfn; i++)
         pfn_list[i] = (vram_addr >> TARGET_PAGE_BITS) + i;
 
-    if (xc_domain_memory_populate_physmap(xc_handle, domid, nr_pfn, 0, 0, pfn_list)) {
+    if (xc_domain_populate_physmap_exact(xc_handle, domid, nr_pfn, 0, 0, pfn_list)) {
         fprintf(stderr, "Failed to populate video ram\n");
         exit(1);
     }
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 qemu: use xc_domain_add_to_physmap instead of open coding xc_memory_op

---
 hw/vga.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
hw/vga.c +4 -8
index fbc41d4..d0c12aa 100644
@@ -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;
         }
     }
Signature · 1 line
1.5.6.5