Commit f9321638 authored by Mike Hibler's avatar Mike Hibler

Sync with the current Xen 4.4 version.

parent 30b6fe64
...@@ -37,6 +37,9 @@ XENCONSOLED="$ROOT"/bin/xenconsoled ...@@ -37,6 +37,9 @@ XENCONSOLED="$ROOT"/bin/xenconsoled
XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid" XENCONSOLED_PIDFILE="/var/run/xenconsoled.pid"
XENSTORED="$ROOT"/bin/xenstored XENSTORED="$ROOT"/bin/xenstored
XENSTORED_PIDFILE="/var/run/xenstore.pid" XENSTORED_PIDFILE="/var/run/xenstore.pid"
QEMU=/usr/bin/qemu-system-i386
QEMU_PIDFILE="/var/run/qemu-dom0.pid"
QEMU_ARGS="-xen-domid 0 -xen-attach -name dom0 -nographic -M xenpv -daemonize -monitor /dev/null -serial /dev/null -parallel /dev/null"
modules_setup() modules_setup()
{ {
...@@ -179,7 +182,7 @@ xenconsoled_stop_real() ...@@ -179,7 +182,7 @@ xenconsoled_stop_real()
[ "$RETVAL" = 2 ] && return 2 [ "$RETVAL" = 2 ] && return 2
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$XENCONSOLED" start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$XENCONSOLED"
[ "$?" = 2 ] && return 2 [ "$?" = 2 ] && return 2
rm -f $PIDFILE rm -f $XENCONSOLED_PIDFILE
return "$RETVAL" return "$RETVAL"
} }
...@@ -189,6 +192,61 @@ sendsigs_omit() { ...@@ -189,6 +192,61 @@ sendsigs_omit() {
ln -sf $XENSTORED_PIDFILE $OMITDIR/xenstored ln -sf $XENSTORED_PIDFILE $OMITDIR/xenstored
} }
qemu_start()
{
[ -x $QEMU ] || return 0
log_progress_msg "qemu"
qemu_start_real
return $?
}
qemu_stop()
{
[ -x $QEMU ] || return 0
log_progress_msg "qemu"
qemu_stop_real
return $?
}
qemu_restart()
{
[ -x $QEMU ] || return 0
log_progress_msg "qemu"
qemu_stop_real
case "$?" in
0|1)
qemu_start_real
case "$?" in
0) ;;
*) return 2 ;;
esac
;;
*) return 2 ;;
esac
return 0
}
qemu_start_real()
{
start-stop-daemon --start --quiet --pidfile "$QEMU_PIDFILE" --exec "$QEMU" --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile "$QEMU_PIDFILE" --exec "$QEMU" -- \
$QEMU_ARGS -pidfile "$QEMU_PIDFILE" \
|| return 2
}
qemu_stop_real()
{
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile "$QEMU_PIDFILE" --exec "$QEMU"
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$QEMU"
[ "$?" = 2 ] && return 2
rm -f $QEMU_PIDFILE
return "$RETVAL"
}
xenstored_start() xenstored_start()
{ {
log_progress_msg "xenstored" log_progress_msg "xenstored"
...@@ -234,6 +292,11 @@ case "$1" in ...@@ -234,6 +292,11 @@ case "$1" in
0|1) ;; 0|1) ;;
*) log_end_msg 1; exit ;; *) log_end_msg 1; exit ;;
esac esac
qemu_start
case "$?" in
0|1) ;;
*) log_end_msg 1; exit ;;
esac
log_end_msg 0 log_end_msg 0
;; ;;
stop) stop)
...@@ -244,6 +307,11 @@ case "$1" in ...@@ -244,6 +307,11 @@ case "$1" in
esac esac
log_daemon_msg "Stopping $DESC" log_daemon_msg "Stopping $DESC"
ret=0 ret=0
qemu_stop
case "$?" in
0|1) ;;
*) ret=1 ;;
esac
xend_stop xend_stop
case "$?" in case "$?" in
0|1) ;; 0|1) ;;
...@@ -264,6 +332,11 @@ case "$1" in ...@@ -264,6 +332,11 @@ case "$1" in
esac esac
log_daemon_msg "Restarting $DESC" log_daemon_msg "Restarting $DESC"
ret=0 ret=0
qemu_restart
case "$?" in
0|1) ;;
*) ret=1 ;;
esac
xend_restart xend_restart
case "$?" in case "$?" in
0|1) ;; 0|1) ;;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment