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

Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-ex

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xend: update init script to avoid grep on non-existent file system
From: Richie <listmail@xxxxxxxxxxxx>
Date: Sat, 15 May 2010 12:00:37 -0400
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 15 May 2010 09:01:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C8140D61.145AC%keir.fraser@xxxxxxxxxxxxx>
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>
References: <C8140D61.145AC%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.23 (X11/20090817)
Keir Fraser wrote:
On 15/05/2010 05:16, "Richie" <listmail@xxxxxxxxxxxx> wrote:

I'm seeing a grep error during bare metal pvops kernel boot.  In the
init script, the previous checks will avoid/perform the /proc/xen mount
as appropriate, but then it does a grep on /proc/xen/capabilities
without ensuring that /proc/xen is actually mounted.  This is my attempt
(read: first patch :) ) to avoid it.

Richie,

Can you try adding the -s option to grep instead (i.e., grep -qs)? Should be
a simpler way to achieve the same thing. I'll apply that instead if it works
okay for you.

 -- Keir



# HG changeset patch
# User Richie <listmail@xxxxxxxxxxxx>
# Date 1273938512 14400
# Node ID cc3ed74cfef3f4504712d1d53c0af8c8940e9ab8
# Parent  baccadfd9418b8dee931945e5752cb118f5bf3cb
xend: suppress errors during capabilities check

diff -r baccadfd9418 -r cc3ed74cfef3 tools/hotplug/Linux/init.d/xend
--- a/tools/hotplug/Linux/init.d/xend   Fri May 14 08:05:05 2010 +0100
+++ b/tools/hotplug/Linux/init.d/xend   Sat May 15 11:48:32 2010 -0400
@@ -31,7 +31,7 @@
        mount -t xenfs xenfs /proc/xen
 fi
 
-if ! grep -q "control_d" /proc/xen/capabilities ; then
+if ! grep -qs "control_d" /proc/xen/capabilities ; then
        exit 0
 fi
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel