From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xensource.com
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [PATCH 1 of 2] xencommons: run script only when needed
Date: Fri, 25 Nov 2011 14:39:06 +0100 [thread overview]
Message-ID: <bed3a6489d9a2ee2fdfc.1322228346@probook.site> (raw)
In-Reply-To: <patchbomb.1322228345@probook.site>
# 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
next prev parent reply other threads:[~2011-11-25 13:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 13:39 [PATCH 0 of 2] tools/hotplug fixes for xen-unstable Olaf Hering
2011-11-25 13:39 ` Olaf Hering [this message]
2011-11-25 13:39 ` [PATCH 2 of 2] xencommons: load evtchn and gntdev modules Olaf Hering
2011-12-01 18:28 ` [PATCH 0 of 2] tools/hotplug fixes for xen-unstable Ian Jackson
2011-12-01 18:48 ` Olaf Hering
2011-12-08 16:53 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bed3a6489d9a2ee2fdfc.1322228346@probook.site \
--to=olaf@aepfle.de \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.