xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH v2] hotplug: update xencommons script to run only when needed
Date: Fri, 26 Aug 2011 11:10:55 +0200	[thread overview]
Message-ID: <20110826091055.GA495@aepfle.de> (raw)
In-Reply-To: <20054.27534.720259.973323@mariner.uk.xensource.com>

# 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@aepfle.de>

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

  reply	other threads:[~2011-08-26  9:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-12  7:11 [PATCH] hotplug: update xencommons script to run only when needed Olaf Hering
2011-08-25 15:15 ` Ian Jackson
2011-08-25 15:24   ` Olaf Hering
2011-08-25 15:34     ` Ian Jackson
2011-08-26  9:10       ` Olaf Hering [this message]
2011-08-20  0:49         ` [PATCH 2/2] Load gntdev and evtchn if they're modular Jeremy Fitzhardinge
2011-08-30 16:46           ` [PATCH 2/2] Load gntdev and evtchn if they're modular. [and 1 more messages] Ian Jackson
2011-08-30 18:12             ` Olaf Hering
2011-08-31 16:02               ` 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=20110826091055.GA495@aepfle.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).