[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 10 of 25] libxc: convert physdevop interface over to hypercall buffers



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1287650254 -3600
# Node ID a4430532beb9ddc8c48d80b45591fb25a139db8c
# Parent  584a8eddcea8410026af987a0dbd910852f8f1a9
libxc: convert physdevop interface over to hypercall buffers

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 584a8eddcea8 -r a4430532beb9 tools/libxc/xc_private.h
--- a/tools/libxc/xc_private.h  Thu Oct 21 09:37:34 2010 +0100
+++ b/tools/libxc/xc_private.h  Thu Oct 21 09:37:34 2010 +0100
@@ -181,18 +181,18 @@ static inline int do_physdev_op(xc_inter
 static inline int do_physdev_op(xc_interface *xch, int cmd, void *op, size_t 
len)
 {
     int ret = -1;
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BOUNCE(op, len, XC_HYPERCALL_BUFFER_BOUNCE_BOTH);
 
-    DECLARE_HYPERCALL;
-
-    if ( hcall_buf_prep(xch, &op, len) != 0 )
+    if ( xc_hypercall_bounce_pre(xch, op) )
     {
-        PERROR("Could not lock memory for Xen hypercall");
+        PERROR("Could not bounce memory for physdev hypercall");
         goto out1;
     }
 
     hypercall.op = __HYPERVISOR_physdev_op;
     hypercall.arg[0] = (unsigned long) cmd;
-    hypercall.arg[1] = (unsigned long) op;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(op);
 
     if ( (ret = do_xen_hypercall(xch, &hypercall)) < 0 )
     {
@@ -201,8 +201,7 @@ static inline int do_physdev_op(xc_inter
                     " rebuild the user-space tool set?\n");
     }
 
-    hcall_buf_release(xch, &op, len);
-
+    xc_hypercall_bounce_post(xch, op);
 out1:
     return ret;
 }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.