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] safer checks in network-bridge script

To: Charles Coffing <ccoffing@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] safer checks in network-bridge script
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Fri, 10 Mar 2006 09:58:46 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 10 Mar 2006 09:59:46 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <44105763.D169.003C.0@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <44105763.D169.003C.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Thu, Mar 09, 2006 at 06:27:33PM -0500, Charles Coffing wrote:

> The network-bridge script is fragile because of how grep is used.  As
> one example, if I already have "xenbridge", I can't create "xenbr". 
> (It's actually worse than that, because it's even grepping the header
> output by brctl show.)
> 
> Assuming dom0 is on Linux with /sys mounted (is that a safe
> assumption?) we can check for the existence of a bridge, and check if a
> device is on the bridge, by looking in /sys.  The attached patch does
> that.
> 
> If that's not a safe assumption, at least add "-w" to the two instances
> of grep.  Not perfect, but better.

Thanks for this, Charles.  I'm not sure that it's safe to rely upon /sys
though.  Could you rework this patch to use /sys/class if it exists, but falls
back to using grep / brctl otherwise (and fix the grep)?

Thanks,

Ewan.

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

<Prev in Thread] Current Thread [Next in Thread>