ia64/xen-unstable

view tools/libxc/xc_sedf.c @ 7238:971e7c7411b3

Raise an exception if an error appears on the pipes to our children, and make
sure that the child's pipes are closed even under that exception. Move the
handling of POLLHUP to the end of the loop, so that we guarantee to read any
remaining data from the child if POLLHUP and POLLIN appear at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 10:13:11 2005 +0100 (2005-10-06)
parents ddd290cc8f0d
children b3a255e88810
line source
1 /******************************************************************************
2 * xc_sedf.c
3 *
4 * API for manipulating parameters of the Simple EDF scheduler.
5 *
6 * changes by Stephan Diestelhorst
7 * based on code
8 * by Mark Williamson, Copyright (c) 2004 Intel Research Cambridge.
9 */
11 #include "xc_private.h"
13 int xc_sedf_domain_set(int xc_handle,
14 u32 domid, u64 period, u64 slice,u64 latency, u16 extratime,u16 weight)
15 {
16 dom0_op_t op;
17 struct sedf_adjdom *p = &op.u.adjustdom.u.sedf;
19 op.cmd = DOM0_ADJUSTDOM;
20 op.u.adjustdom.domain = (domid_t)domid;
21 op.u.adjustdom.sched_id = SCHED_SEDF;
22 op.u.adjustdom.direction = SCHED_INFO_PUT;
24 p->period = period;
25 p->slice = slice;
26 p->latency = latency;
27 p->extratime = extratime;
28 p->weight = weight;
29 return do_dom0_op(xc_handle, &op);
30 }
32 int xc_sedf_domain_get(int xc_handle, u32 domid, u64 *period, u64 *slice, u64* latency, u16* extratime, u16* weight)
33 {
34 dom0_op_t op;
35 int ret;
36 struct sedf_adjdom *p = &op.u.adjustdom.u.sedf;
38 op.cmd = DOM0_ADJUSTDOM;
39 op.u.adjustdom.domain = (domid_t)domid;
40 op.u.adjustdom.sched_id = SCHED_SEDF;
41 op.u.adjustdom.direction = SCHED_INFO_GET;
43 ret = do_dom0_op(xc_handle, &op);
45 *period = p->period;
46 *slice = p->slice;
47 *latency = p->latency;
48 *extratime = p->extratime;
49 *weight = p->weight;
50 return ret;
51 }