hotplug: update xencommons script to run only when needed
PATCH 1/1 hotplug: update xencommons script to run only when needed
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1315479698 -7200
# Node ID 7829ad83ee66fbec0653ccb53ce5b8502657a71f # Parent 7b55f33f29cd7aaa0057485b8cae53722bac8741
hotplug: update xencommons script to run only when needed
Currently xencommons prints an error if /proc/xen/capabilities does not exist when started on a non-xen kernel.
Update the xencommons script to run only when needed:
- do not run if /proc/xen does not exist
- check if /proc/xen/capabilities exists before doing the grep for dom0
Signed-off-by Olaf Hering <[email protected]>
tools/hotplug/Linux/init.d/xencommons +11 -2
@@ -29,15 +29,24 @@ test -f $xencommons_config/xencommons && XENCONSOLED_PIDFILE=/var/run/xenconsoled.pid shopt -s extglob +# not running in Xen dom0 or domU +if ! test -d /proc/xen ; then + exit 0 +fi + +# mount xenfs in dom0 or domU with a pv_ops kernel if test "x$1" = xstart && \ - test -d /proc/xen && \ ! test -f /proc/xen/capabilities && \ ! grep '^xenfs ' /proc/mounts >/dev/null; then mount -t xenfs xenfs /proc/xen fi -if ! grep -q "control_d" /proc/xen/capabilities ; then +# run this script only in dom0: +# no capabilities file in xenlinux domU kernel +# empty capabilities file in pv_ops domU kernel +if test -f /proc/xen/capabilities && \ + ! grep -q "control_d" /proc/xen/capabilities ; then exit 0 fi