Files
xen/tools/libxc/xc_csched2.c
T
Keir Fraser 5cc436c1d2 libxc: eliminate static variables, use xentoollog; API change
This patch eliminate the global variables in libxenctrl (used for
logging and error reporting).

Instead the information which was in the global variables is now in a
new xc_interface* opaque structure, which xc_interface open returns
instead of the raw file descriptor; furthermore, logging is done via
xentoollog.

There are three new parameters to xc_interface_open to control the
logging, but existing callers can just pass "0" for all three to get
the old behaviour.

All libxc callers have been adjusted accordingly.

Also update QEMU_TAG for corresponding qemu change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-05-28 09:30:19 +01:00

51 lines
1.2 KiB
C

/****************************************************************************
* (C) 2006 - Emmanuel Ackaouy - XenSource Inc.
****************************************************************************
*
* File: xc_csched.c
* Author: Emmanuel Ackaouy
*
* Description: XC Interface to the credit scheduler
*
*/
#include "xc_private.h"
int
xc_sched_credit2_domain_set(
xc_interface *xch,
uint32_t domid,
struct xen_domctl_sched_credit2 *sdom)
{
DECLARE_DOMCTL;
domctl.cmd = XEN_DOMCTL_scheduler_op;
domctl.domain = (domid_t) domid;
domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT2;
domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo;
domctl.u.scheduler_op.u.credit2 = *sdom;
return do_domctl(xch, &domctl);
}
int
xc_sched_credit2_domain_get(
xc_interface *xch,
uint32_t domid,
struct xen_domctl_sched_credit2 *sdom)
{
DECLARE_DOMCTL;
int err;
domctl.cmd = XEN_DOMCTL_scheduler_op;
domctl.domain = (domid_t) domid;
domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT2;
domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
err = do_domctl(xch, &domctl);
if ( err == 0 )
*sdom = domctl.u.scheduler_op.u.credit2;
return err;
}