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: Prevent XenD touching externally managed bridges

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] PATCH: Prevent XenD touching externally managed bridges
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Fri, 14 Dec 2007 22:10:05 +0000
Delivery-date: Fri, 14 Dec 2007 14:10:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
With current XenD 3.0.4 or later try the following:

    brctl addbr demo
    ifconfig demo up

    /etc/init.d/xend start
    /etc/init.d/xend stop
    
    ifconfig demo down
    brctl delbr demo

Now, start XenD again....

    /etc/init.d/xend start

And watch in horror as it re-creates your 'demo' bridge. 

The problem is that the 'XendNetwork' class does not distinguish between
bridge devices that it is managing (ie those created via XenAPI) and those
which it does not manage (ie those created by OS distro init scripts, or
by apps like  libvirt).

While initially I thought I could just make XenD ignore externally-managed
bridges completely, it seems to needs to know about them otherwise it can't
hook up guest VIFs to them correctly. So the attached patch adds a 'managed'
flag to the XendNetwork class. Externally managed bridges have this set 
to False. At startup XenD will now only re-create bridge devices which have
the 'managed' flag set to 'True'  - ie those created via XenAPI.

  Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Attachment: xen-network-unmanaged.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] PATCH: Prevent XenD touching externally managed bridges, Daniel P. Berrange <=