Files
xen/tools/libxc/xc_sedf.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

65 lines
1.6 KiB
C

/******************************************************************************
* xc_sedf.c
*
* API for manipulating parameters of the Simple EDF scheduler.
*
* changes by Stephan Diestelhorst
* based on code
* by Mark Williamson, Copyright (c) 2004 Intel Research Cambridge.
*/
#include "xc_private.h"
int xc_sedf_domain_set(
xc_interface *xch,
uint32_t domid,
uint64_t period,
uint64_t slice,
uint64_t latency,
uint16_t extratime,
uint16_t weight)
{
DECLARE_DOMCTL;
struct xen_domctl_sched_sedf *p = &domctl.u.scheduler_op.u.sedf;
domctl.cmd = XEN_DOMCTL_scheduler_op;
domctl.domain = (domid_t)domid;
domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_SEDF;
domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_putinfo;
p->period = period;
p->slice = slice;
p->latency = latency;
p->extratime = extratime;
p->weight = weight;
return do_domctl(xch, &domctl);
}
int xc_sedf_domain_get(
xc_interface *xch,
uint32_t domid,
uint64_t *period,
uint64_t *slice,
uint64_t *latency,
uint16_t *extratime,
uint16_t *weight)
{
DECLARE_DOMCTL;
int ret;
struct xen_domctl_sched_sedf *p = &domctl.u.scheduler_op.u.sedf;
domctl.cmd = XEN_DOMCTL_scheduler_op;
domctl.domain = (domid_t)domid;
domctl.u.scheduler_op.sched_id = XEN_SCHEDULER_SEDF;
domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_getinfo;
ret = do_domctl(xch, &domctl);
*period = p->period;
*slice = p->slice;
*latency = p->latency;
*extratime = p->extratime;
*weight = p->weight;
return ret;
}