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

Cole Robinson crobinso at redhat.com
Wed Nov 4 13:51:17 UTC 2009


On 11/03/2009 06:36 PM, David Lutterkort wrote:
> On Wed, 2009-10-28 at 13:51 -0400, Cole Robinson wrote:
>> 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.
> 
> But isn't that exactly what your XML file said ? That you want wlan0
> enslaved to bridge br0; that means that the config for wlan0 has to be
> overwritten. And when you undefine the bridge, we need to make the wlan0
> config 'safe', too - removing it is the safest thing to do here.
> 

Removal is fine. Its wlan0 not reappearing after bridge undefine that
was confusing.

>> 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.
> 
> But what would such a config do ? There's no reasonable way to go from
> physical NIC to actually working interface definition.
>

I think a user would expect that the wlan0 config ended up in the same
state it was before we enslaved it to the bridge, all technical details
aside.

I understand now that netcf shouldn't/can't do that for us, but it
should provide a way for an API user to make that happen. Right now if
the wlan0 config is undefined and its macaddr is not passed into the
bridge xml, the API user has no way of rediscovering that mac AFAICT, so
the chance of rebuilding a useful interface definition is slim.

Maybe for interfaces referenced in bridge/bond xml, netcf can poke into
sysfs and discover as much info as it can find (at least macaddr) and
store that in the bridge xml? That way, specifying bridge xml could just
as simple as:

   ...
   <bridge>
     <interface name="eth0"/>
   </bridge

And netcf fills in the rest.

Or some easy way for a user to say 'define wlan0' and netcf will do the
sysfs detection and build up the XML for us?

Thanks,
Cole


More information about the netcf-devel mailing list