mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 02:30:03 +01:00
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>
51 lines
1.2 KiB
C
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_credit_domain_set(
|
|
xc_interface *xch,
|
|
uint32_t domid,
|
|
struct xen_domctl_sched_credit *sdom)
|
|
{
|
|
DECLARE_DOMCTL;
|
|
|
|
domctl.cmd = XEN_DOMCTL_scheduler_op;
|
|
domctl.domain = (domid_t) domid;
|
|
domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
|
|
domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo;
|
|
domctl.u.scheduler_op.u.credit = *sdom;
|
|
|
|
return do_domctl(xch, &domctl);
|
|
}
|
|
|
|
int
|
|
xc_sched_credit_domain_get(
|
|
xc_interface *xch,
|
|
uint32_t domid,
|
|
struct xen_domctl_sched_credit *sdom)
|
|
{
|
|
DECLARE_DOMCTL;
|
|
int err;
|
|
|
|
domctl.cmd = XEN_DOMCTL_scheduler_op;
|
|
domctl.domain = (domid_t) domid;
|
|
domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_CREDIT;
|
|
domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
|
|
|
|
err = do_domctl(xch, &domctl);
|
|
if ( err == 0 )
|
|
*sdom = domctl.u.scheduler_op.u.credit;
|
|
|
|
return err;
|
|
}
|