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

Hugh O. Brock hbrock at redhat.com
Thu Nov 5 14:40:54 UTC 2009


On Thu, Nov 05, 2009 at 09:25:41AM -0500, Cole Robinson wrote:
> On 11/04/2009 07:35 PM, David Lutterkort wrote:
> >> 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!
> > 
> > I think it all boils down to who should do device discovery. As I
> > understand it, what you want is for virt-manager to have a way to list
> > all physical interfaces on a machine, figure out which ones are not used
> > by any bridge/bond etc. and offer those for addition into a new bridge.
> > 
> > For the first bit, libvirt provides the virNodeDevice* calls;
> 
> Yeah, I didn't think of that. It should be sufficient.
> 
>  for
> > figuring out which devices are free, we'd need to add something to
> > netcf, e.g. new error codes to indicate 'interface has no configuration'
> > and 'interface is slave of another interface' when calling
> > ncf_lookup_by_name. 
> 
> Not sure if I follow. If an interface has no configuration it won't show
> up in ncf_list_interfaces, and an enslaved interface will be referenced
> in some bridge/bond/foo xml, so all that information is already
> available. I think using the nodedev APIs to enumerate physical
> interfaces should be sufficient for virt-manager.
> 
> Thanks,
> Cole

I still think netcf should refuse to repurpose a device to already
exist. In Cole's case, if someone tries to enslave wlan0 to a bridge
and it already exists with an IP address and so on, surely we should
say "You have to undefine wlan0 first" and exit? It seems to me
anything else violates the principle of least surprise...

--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