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] qemu: use xc_domain_add_to_physmap instead of open c

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] qemu: use xc_domain_add_to_physmap instead of open coding xc_memory_op
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 12 Oct 2010 15:16:28 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 12 Oct 2010 07:31:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1286892988-16221-1-git-send-email-ian.campbell@xxxxxxxxxx>
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: <1286892988-16221-1-git-send-email-ian.campbell@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 hw/vga.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/hw/vga.c b/hw/vga.c
index fbc41d4..d0c12aa 100644
--- 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;
         }
     }
-- 
1.5.6.5


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

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