]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
xenpaging: Switch from xc_{set,get}_hvm_param to xc_hvm_param_{set,get}
authorIan Campbell <ian.campbell@citrix.com>
Thu, 28 Jan 2016 15:09:03 +0000 (15:09 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 10 Feb 2016 12:45:23 +0000 (12:45 +0000)
The former have been deprecated for some time (they take unsigned
longs, not uint64_t's, and therefore risk truncation for some params)
and I'm about to remove them.

To get the types write for both xc_hvm_param_get and
xc_domain_populate_physmap_exact (which takes an array of xen_pfn_t)
we need to launder the ring pointer through a temporary 64 bit
variable.

This is the only remaining in tree user.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
tools/xenpaging/xenpaging.c

index 0377507e115e812822a2ec09bf736e78733e674e..675e1dd83e28ac52ceb5b7c1b32fe004f4d095b2 100644 (file)
@@ -279,7 +279,8 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[])
     xentoollog_logger *dbg = NULL;
     char *p;
     int rc;
-    unsigned long ring_pfn, mmap_pfn;
+    uint64_t val;
+    xen_pfn_t ring_pfn, mmap_pfn;
 
     /* Allocate memory */
     paging = calloc(1, sizeof(struct xenpaging));
@@ -337,9 +338,9 @@ static struct xenpaging *xenpaging_init(int argc, char *argv[])
     }
 
     /* Map the ring page */
-    xc_get_hvm_param(xch, paging->vm_event.domain_id, 
-                        HVM_PARAM_PAGING_RING_PFN, &ring_pfn);
-    mmap_pfn = ring_pfn;
+    xc_hvm_param_get(xch, paging->vm_event.domain_id,
+                        HVM_PARAM_PAGING_RING_PFN, &val);
+    mmap_pfn = ring_pfn = (xen_pfn_t)val;
     paging->vm_event.ring_page = 
         xc_map_foreign_pages(xch, paging->vm_event.domain_id,
                              PROT_READ | PROT_WRITE, &mmap_pfn, 1);