|   | 
      | 
  
  
      | 
      | 
  
 
     | 
    | 
  
  
     | 
    | 
  
  
    |   | 
      | 
  
  
    | 
         
xen-devel
[Xen-devel] [PATCH 09 of 25] libxc: convert schedop interfaces over	to h
 
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1287756891 -3600
# Node ID 13eb390743e77d302151bb2c53a333626997194c
# Parent  0ddcbfd4824fe9c44c4f98f9a4e9cf02e869c290
libxc: convert schedop interfaces over to hypercall buffers
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
diff -r 0ddcbfd4824f -r 13eb390743e7 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Fri Oct 22 15:14:51 2010 +0100
+++ b/tools/libxc/xc_domain.c   Fri Oct 22 15:14:51 2010 +0100
@@ -85,24 +85,25 @@ int xc_domain_shutdown(xc_interface *xch
                        int reason)
 {
     int ret = -1;
-    sched_remote_shutdown_t arg;
     DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(sched_remote_shutdown_t, arg);
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+    {
+        PERROR("Could not allocate memory for xc_domain_shutdown hypercall");
+        goto out1;
+    }
 
     hypercall.op     = __HYPERVISOR_sched_op;
     hypercall.arg[0] = (unsigned long)SCHEDOP_remote_shutdown;
-    hypercall.arg[1] = (unsigned long)&arg;
-    arg.domain_id = domid;
-    arg.reason = reason;
-
-    if ( lock_pages(xch, &arg, sizeof(arg)) != 0 )
-    {
-        PERROR("Could not lock memory for Xen hypercall");
-        goto out1;
-    }
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+    arg->domain_id = domid;
+    arg->reason = reason;
 
     ret = do_xen_hypercall(xch, &hypercall);
 
-    unlock_pages(xch, &arg, sizeof(arg));
+    xc_hypercall_buffer_free(xch, arg);
 
  out1:
     return ret;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread>
 |  
- [Xen-devel] [PATCH 24 of 25] libxc: do not align/lock buffers which	do not need it, (continued)
- [Xen-devel] [PATCH 24 of 25] libxc: do not align/lock buffers which	do not need it, Ian Campbell
 
- [Xen-devel] [PATCH 25 of 25] libxc: finalise transition to	hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 22 of 25] xenpm: use hypercall buffers, Ian Campbell
 
- [Xen-devel] Re: [PATCH 00 of 25] libxc: Hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 00 of 25] libxc: Hypercall buffers, Ian Campbell
- [Xen-devel] [PATCH 02 of 25] libxc: convert xc_version over to	hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 06 of 25] libxc: convert watchdog interface over	to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 01 of 25] libxc: infrastructure for hypercall	safe data buffers, Ian Campbell
 
- [Xen-devel] [PATCH 07 of 25] libxc: convert acm interfaces over to	hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 04 of 25] libxc: convert shadow domctl	interfaces and save/restore over to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 09 of 25] libxc: convert schedop interfaces over	to hypercall buffers,
Ian Campbell <=
 
- [Xen-devel] [PATCH 03 of 25] libxc: convert domctl interfaces over	to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 08 of 25] libxc: convert evtchn interfaces over	to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 10 of 25] libxc: convert physdevop interface	over to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 11 of 25] libxc: convert flask interfaces over	to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 13 of 25] libxc: convert mca interface over to	hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 12 of 25] libxc: convert hvmop interfaces over	to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 05 of 25] libxc: convert sysctl interfaces over	to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 15 of 25] libxc: convert gnttab interfaces over	to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 16 of 25] libxc: convert memory op interface	over to hypercall buffers, Ian Campbell
 
- [Xen-devel] [PATCH 14 of 25] libxc: convert tmem interface over to	hypercall buffers, Ian Campbell
 
 
 
 
 
 
 |  
  
 | 
    | 
  
  
    |   | 
    |