WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] hotplug: update xencommons script to run only when n

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] hotplug: update xencommons script to run only when needed
From: Olaf Hering <olaf@xxxxxxxxx>
Date: Thu, 08 Sep 2011 13:56:56 +0200
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Thu, 08 Sep 2011 04:59:44 -0700
Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1315483033; l=1505; s=domk; d=aepfle.de; h=Cc:To:From:Date:Subject:Content-Transfer-Encoding:MIME-Version: Content-Type:X-RZG-CLASS-ID:X-RZG-AUTH; bh=Mg7qng1EsYOuiY7jVhcIe6QcbRk=; b=oQQBJ3dsSJFEzwqFeSqvpfMDV/WuCoOQ1azfNhJvKrMNNq6GRNOyoSk77cRW7OsXs0n ZAtgaF5aoBnrzr1hXsrv5eZeMabUTWmCB6Y7+gxeOVMq24IReh5cGrsOrEb2bI2QfKgUD t/F/f4D45fOihs9efRLb7Qg97jOOCnEw3eE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.7.5
# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1315479698 -7200
# Node ID 7829ad83ee66fbec0653ccb53ce5b8502657a71f
# Parent  7b55f33f29cd7aaa0057485b8cae53722bac8741
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

Signed-off-by: Olaf Hering <olaf@xxxxxxxxx>

diff -r 7b55f33f29cd -r 7829ad83ee66 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
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] hotplug: update xencommons script to run only when needed, Olaf Hering <=