From: Ian Campbell Subject: [PATCH 09 of 25] libxc: convert schedop interfaces over to hypercall buffers Date: Thu, 21 Oct 2010 11:58:52 +0100 Message-ID: <584a8eddcea8410026af.1287658732@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # Date 1287650254 -3600 # Node ID 584a8eddcea8410026af987a0dbd910852f8f1a9 # Parent 1900730c5bfccbaddf517139c6c4eb390b75237f libxc: convert schedop interfaces over to hypercall buffers Signed-off-by: Ian Campbell diff -r 1900730c5bfc -r 584a8eddcea8 tools/libxc/xc_domain.c --- a/tools/libxc/xc_domain.c Thu Oct 21 09:37:34 2010 +0100 +++ b/tools/libxc/xc_domain.c Thu Oct 21 09:37:34 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;