ia64/xen-unstable

view tools/xenballoon/xenballoond.init @ 19731:01748ccc4da3

Intel VT-d: fix Stoakley boot issue with iommu=1

Signed-off-by: Weidong Han <Weidong.han@intel.com>
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jun 05 09:25:50 2009 +0100 (2009-06-05)
parents 0c5183e764d8
children 8373971089a7
line source
1 #!/bin/bash
2 #
3 # xenballoond Script to start and stop Xen ballooning daemon.
4 #
5 # Copyright (C) 2008 Oracle Corporation and/or its affiliates.
6 # All rights reserved.
7 # Written by: Dan Magenheimer <dan.magenheimer@oracle.com>
8 #
9 # chkconfig: 2345 98 01
10 # description: Starts and stops the Xen control daemon.
11 ### BEGIN INIT INFO
12 # Provides: xenballoond
13 # Required-Start: $syslog $remote_fs
14 # Should-Start:
15 # Required-Stop: $syslog $remote_fs
16 # Should-Stop:
17 # Default-Start: 3 4 5
18 # Default-Stop: 0 1 2 6
19 # Default-Enabled: yes
20 # Short-Description: Start/stop xend
21 # Description: Starts and stops the Xen ballooning daemon.
22 ### END INIT INFO
24 # Source function library
25 . /etc/init.d/functions
27 #don't use in domain0
28 [ -f /proc/xen/capabilities ] && \
29 grep -q "control_d" /proc/xen/capabilities && exit 0
31 if [ -f /etc/sysconfig/xenballoon.conf ]; then
32 . /etc/sysconfig/xenballoon.conf
33 fi
35 # Check that balloon driver is present
36 [ ! -f /proc/xen/balloon ] && exit 0
38 # Record original memory (in kB)
39 [ -z "$XENBALLOON_MAXMEMFILE" ] && exit 0
40 let maxmem=`grep MemTotal /proc/meminfo | sed 's/ */ /' | cut -f2 -d' '`
41 if [ -f "$XENBALLOON_MAXMEMFILE" ]; then
42 let oldmax=`cat $XENBALLOON_MAXMEMFILE`
43 if [ $oldmax -gt $maxmem ]; then
44 let maxmem=oldmax
45 fi
46 fi
47 echo $maxmem > $XENBALLOON_MAXMEMFILE
49 RETVAL=0
50 prog="xenballoond"
52 start() {
53 # Start daemons.
54 echo -n $"Starting $prog: "
55 daemon xenballoond $OPTIONS
56 RETVAL=$?
57 echo
58 return $RETVAL
59 }
61 stop() {
62 echo -n $"Shutting down $prog: "
63 killproc xenballoond
64 RETVAL=$?
65 echo
66 return $RETVAL
67 }
69 # See how we were called.
70 case "$1" in
71 start)
72 start
73 ;;
74 stop)
75 stop
76 ;;
77 status)
78 status xenballoond
79 RETVAL=$?
80 ;;
81 restart|reload)
82 stop
83 start
84 RETVAL=$?
85 ;;
86 *)
87 echo $"Usage: $0 {start|stop|restart|status}"
88 exit 1
89 esac
91 exit $RETVAL