|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH v2] hotplug: update xencommons script to run only whe
# HG changeset patch
# Parent 227130622561e20136a1ef56201fe65ead5a76e8
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
- use grep -q instead of stdout redirection when looking for xenfs
Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>
diff -r 227130622561 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons
+++ b/tools/hotplug/Linux/init.d/xencommons
@@ -29,14 +29,25 @@ 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;
+ ! grep -q '^xenfs ' /proc/mounts ;
then
mount -t xenfs xenfs /proc/xen
fi
+# run this script only in dom0:
+# no capabilities file in xenlinux kernel
+if ! test -f /proc/xen/capabilities ; then
+ exit 0
+fi
+# empty capabilities file in pv_ops kernel
if ! grep -q "control_d" /proc/xen/capabilities ; then
exit 0
fi
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|
|
|