direct-io.hg

view tools/libxc/xc_csched.c @ 11257:86d26e6ec89b

Replace dom0_ops hypercall with three new hypercalls:
1. platform_op -- used by dom0 kernel to perform actions on the
hardware platform (e.g., MTRR access, microcode update, platform
quirks, ...)
2. domctl -- used by management tools to control a specified domain
3. sysctl -- used by management tools for system-wide actions

Benefits include more sensible factoring of actions to
hypercalls. Also allows tool compatibility to be tracked separately
from the dom0 kernel. The assumption is that it will be easier to
replace libxenctrl, libxenguest and Xen as a matched set if the
dom0 kernel does not need to be replaced too (e.g., because that
would require vendor revalidation).

From here on we hope to maintain dom0 kernel compatibility. This
promise is not extended to tool compatibility beyond the existing
guarantee that compatibility will not be broken within a three-level
stable release [3.0.2, 3.0.3, etc.].

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Fri Aug 25 18:39:10 2006 +0100 (2006-08-25)
parents 71fa0e0d520c
children
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 }