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