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

Cole Robinson crobinso at redhat.com
Wed Nov 4 14:09:37 UTC 2009


On 11/04/2009 08:51 AM, Cole Robinson wrote:
> 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.
>>
> 

Sigh, it's too early. I realize I didn't even answer your question and
just repeated what I said in my original mail.

An autogenerated config should do the same thing that this does:

# cat /etc/sysconfig/network-scripts/ifcfg-wlan0
# Networking Interface
DEVICE=wlan0
HWADDR=00:1C:BF:04:29:A4
ONBOOT=no
TYPE=wireless

That is my original wlan0 which did not reappear. Besides onboot, my
guess is it can be generated, and it must have had some usefulness to be
created in the first place.

But assuming a config is more complex than that and has info that can't
be rediscovered, not sure what the solution is. Maybe when undefining
wlan0, netcf can store a backup of the ifcfg somewhere for restoring it
when the bridge goes away.

And even if the generated config isn't that useful, it would still be
handy to have it reappear in the list of interfaces, so that
virt-manager has some list to offer users if they then want to use wlan0
in a bridge again. Maybe virt-manager can facilitate this by pulling the
interfaces from the bridge xml before undefining, then attempt to
redefine them after the bridge is gone. But if netcf is doing interface
undefine already when creating a bridge, why can't it do redefine when
removing said bridge?

At the end of the day, I'm looking for the best way to avoid future
virt-manager bug reports like:

- Help! I bridged eth1 in virt-manager, restarted the app, then deleted
the bridge and eth1 is no longer in my list of interfaces!

Thanks,
Cole


More information about the netcf-devel mailing list