[netcf-devel] Undefining a bridge does not recreate the original interface

Hugh O. Brock hbrock at redhat.com
Wed Oct 28 18:12:36 UTC 2009


On Wed, Oct 28, 2009 at 01:51:28PM -0400, Cole Robinson wrote:
> Hi all,
> 
> Playing with netcf a bit, I'm hitting an issue with undefining a bridge:
> the original interface disappears from the ncftool --list output, and
> its ifcfg script is completely gone.
> 
> $ sudo cat /etc/sysconfig/network-scripts/ifcfg-wlan0
> # Networking Interface
> DEVICE=wlan0
> HWADDR=00:1C:BF:04:29:A4
> ONBOOT=no
> TYPE=wireless
> 
> $ cat netcfbridge.xml
> <interface type="bridge" name="testbr0">
>   <start mode="none"/>
>   <mtu size="1500"/>
>   <protocol family="ipv4">
>     <dhcp/>
>   </protocol>
>   <bridge stp="off" delay="0.01">
>     <interface type="ethernet" name="wlan0">
>       <mac address="00:1C:BF:04:29:A4"/>
>     </interface>
>   </bridge>
> </interface>
> 
> $ sudo src/ncftool
> ncftool> list --all
> eth0
> lo
> wlan0
> 
> ncftool> define netcfbridge.xml
> Defined interface testbr0
> 
> ncftool> list --all
> eth0
> lo
> testbr0
> 
> ncftool> dumpxml testbr0
> <?xml version="1.0"?>
> <interface type="bridge" name="testbr0">
>   <start mode="none"/>
>   <mtu size="1500"/>
>   <protocol family="ipv4">
>     <dhcp/>
>   </protocol>
>   <bridge stp="off" delay="0.01">
>     <interface type="ethernet" name="wlan0">
>       <mac address="00:1C:BF:04:29:A4"/>
>     </interface>
>   </bridge>
> </interface>
> 
> ncftool> undefine testbr0
> testbr0 undefined
> ncftool> list --all
> eth0
> lo
> 
> 
> Maybe netcf could attempt to rebuild ifcfg files for child interfaces
> when undefining? Since it is already accessing /sys, it should be
> straight forward to build a simple config with at least mac and
> interface name.
> 
> On an unrelated note, the bridge XML example on the main trac page is
> outdated and doesn't match the current XML schema.
> 
> Thanks,
> Cole
> _______________________________________________
> netcf-devel mailing list
> netcf-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/netcf-devel

Hmm... is the caller always going to want that to happen though? Maybe
so, not sure. If there's a case where the caller doesn't want it, then
it's probably the caller's responsibility to put wlan0
back... otherwise we'll be storing lots of random state somewhere in
netcf. 

I agree it seems like a surprising response to have the child
interfaces disappear though...

--Hugh

-- 
========================================================
Hugh Brock, hbrock at redhat.com, +1-215-564-3232
Deltacloud API + Portal http://deltacloud.org
Libvirt virtualization library http://libvirt.org
========================================================
Register now for Red Hat Virtual Experience, December 9.
Enterprise Linux, virtualization, cloud, and more.
http://www.redhat.com/virtualexperience


More information about the netcf-devel mailing list