tools/hotplug fixes for xen-unstable
PATCH 1/1 tools/hotplug fixes for xen-unstable
Update xencommons to avoid error messages in non-Xen environment, and load required kernel drivers.
Olaf
tools/hotplug/Linux/init.d/xencommons | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
PATCH 1/1 xencommons: run script only when needed
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1322228282 -3600
# Node ID bed3a6489d9a2ee2fdfc12a35f8544c7148dfe1a # Parent 1027e7d13d02143048c7d48d7960967c5b1657a8
xencommons: run script only when needed
Currently xencommons prints an error that /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
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
PATCH 1/1 xencommons: load evtchn and gntdev modules
In reply to Olaf Hering# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1322228288 -3600
# Node ID 666c76daa1e74cb7f6d237fe34434d262fc91f6a # Parent bed3a6489d9a2ee2fdfc12a35f8544c7148dfe1a
xencommons: load evtchn and gntdev modules
There is currently no code in the kernel to trigger autoload of the evtchn or gntdev drivers. Load them manually during xencommons start. Handle both pvops and xenlinux module names.
tools/hotplug/Linux/init.d/xencommons +5 -0
@@ -54,6 +54,11 @@ do_start () { local time=0 local timeout=30 + modprobe xen-evtchn 2>/dev/null + modprobe xen-gntdev 2>/dev/null + modprobe evtchn 2>/dev/null + modprobe gntdev 2>/dev/null + if ! `xenstore-read -s / >/dev/null 2>&1` then test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored"
Olaf Hering writes ("[Xen-devel] [PATCH 0 of 2] tools/hotplug fixes for xen-unstable"):
Quoted 2 lines
Update xencommons to avoid error messages in non-Xen environment, and load required kernel drivers.
Great, thanks.
Quoted 8 lines · Ian Jackson
Olaf Hering writes ("[Xen-devel] [PATCH 0 of 2]
tools/hotplugfixes for xen-unstable"):Quoted 2 lines
Update xencommons to avoid error messages in non-Xen environment, and load required kernel drivers.
Great, thanks.
Acked-by Ian Jackson <[email protected]>Committed-by Ian Jackson <[email protected]>
Ian,
could the modprobe change be backported to 4.1 and maybe even 4.0?
Olaf
Olaf Hering writes ("Re: [Xen-devel] [PATCH 0 of 2] tools/hotplug fixes for xen-unstable"):
Quoted 1 line
could the modprobe change be backported to 4.1 and maybe even 4.0?
Yes, I think it has been in unstable long enough. I have cherry picked it into to 4.1, whose xencommons is identical to unstable's.
As regards 4.0: the xencommons script there is substantially different, as the toolstack startup arrangements don't match 4.1/unstable. If someone wants to provide a (tested!) backport then we'll consider it.
Thanks,
Ian.