diff options
author | George Dunlap <george.dunlap@eu.citrix.com> | 2012-02-23 10:17:50 +0000 |
---|---|---|
committer | George Dunlap <george.dunlap@eu.citrix.com> | 2012-02-23 10:17:50 +0000 |
commit | 83421b2079dfb2702df99727216635177689312a (patch) | |
tree | d1d637fb97d05d9218a02e9eca64d3ff5d9dc577 /tools/libxc/xc_csched.c | |
parent | 3ffbb6bf35abbf33b04e98a04123ab6b2c9fd4b8 (diff) | |
download | xen-83421b2079dfb2702df99727216635177689312a.tar.gz xen-83421b2079dfb2702df99727216635177689312a.tar.bz2 xen-83421b2079dfb2702df99727216635177689312a.zip |
libxc: Implement SCHEDOP sysctl for credit scheduler
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'tools/libxc/xc_csched.c')
-rw-r--r-- | tools/libxc/xc_csched.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/libxc/xc_csched.c b/tools/libxc/xc_csched.c index 212bc4f395..390c645f27 100644 --- a/tools/libxc/xc_csched.c +++ b/tools/libxc/xc_csched.c @@ -61,3 +61,47 @@ xc_sched_credit_domain_get( return err; } + +int +xc_sched_credit_params_set( + xc_interface *xch, + uint32_t cpupool_id, + struct xen_sysctl_credit_schedule *schedule) +{ + int rc; + DECLARE_SYSCTL; + + sysctl.cmd = XEN_SYSCTL_scheduler_op; + sysctl.u.scheduler_op.cpupool_id = cpupool_id; + sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT; + sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_putinfo; + + sysctl.u.scheduler_op.u.sched_credit = *schedule; + + rc = do_sysctl(xch, &sysctl); + + *schedule = sysctl.u.scheduler_op.u.sched_credit; + + return rc; +} + +int +xc_sched_credit_params_get( + xc_interface *xch, + uint32_t cpupool_id, + struct xen_sysctl_credit_schedule *schedule) +{ + int rc; + DECLARE_SYSCTL; + + sysctl.cmd = XEN_SYSCTL_scheduler_op; + sysctl.u.scheduler_op.cpupool_id = cpupool_id; + sysctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT; + sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_getinfo; + + rc = do_sysctl(xch, &sysctl); + + *schedule = sysctl.u.scheduler_op.u.sched_credit; + + return rc; +} |