debuggers.hg

view tools/libxc/xc_csched.c @ 16715:c5deb251b9dc

Update version to 3.2.0-rc4
author Keir Fraser <keir.fraser@citrix.com>
date Sat Dec 29 17:57:37 2007 +0000 (2007-12-29)
parents 86d26e6ec89b
children 3ffdb094c2c0
line source
1 /****************************************************************************
2 * (C) 2006 - Emmanuel Ackaouy - XenSource Inc.
3 ****************************************************************************
4 *
5 * File: xc_csched.c
6 * Author: Emmanuel Ackaouy
7 *
8 * Description: XC Interface to the credit scheduler
9 *
10 */
11 #include "xc_private.h"
14 int
15 xc_sched_credit_domain_set(
16 int xc_handle,
17 uint32_t domid,
18 struct xen_domctl_sched_credit *sdom)
19 {
20 DECLARE_DOMCTL;
22 domctl.cmd = XEN_DOMCTL_scheduler_op;
23 domctl.domain = (domid_t) domid;
24 domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
25 domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo;
26 domctl.u.scheduler_op.u.credit = *sdom;
28 return do_domctl(xc_handle, &domctl);
29 }
31 int
32 xc_sched_credit_domain_get(
33 int xc_handle,
34 uint32_t domid,
35 struct xen_domctl_sched_credit *sdom)
36 {
37 DECLARE_DOMCTL;
38 int err;
40 domctl.cmd = XEN_DOMCTL_scheduler_op;
41 domctl.domain = (domid_t) domid;
42 domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
43 domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
45 err = do_domctl(xc_handle, &domctl);
46 if ( err == 0 )
47 *sdom = domctl.u.scheduler_op.u.credit;
49 return err;
50 }