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(-)
# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # 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 Signed-off-by: Olaf Hering <olaf@aepfle.de> diff -r 1027e7d13d02 -r bed3a6489d9a tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons +++ b/tools/hotplug/Linux/init.d/xencommons @@ -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
Olaf Hering
2011-Nov-25 13:39 UTC
[PATCH 2 of 2] xencommons: load evtchn and gntdev modules
# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # 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. Signed-off-by: Olaf Hering <olaf@aepfle.de> diff -r bed3a6489d9a -r 666c76daa1e7 tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons +++ b/tools/hotplug/Linux/init.d/xencommons @@ -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"):> Update xencommons to avoid error messages in non-Xen environment, and > load required kernel drivers.Great, thanks. Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
On Thu, Dec 01, Ian Jackson wrote:> Olaf Hering writes ("[Xen-devel] [PATCH 0 of 2] tools/hotplug fixes for xen-unstable"): > > Update xencommons to avoid error messages in non-Xen environment, and > > load required kernel drivers. > > Great, thanks. > > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>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"):> 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.