[libvirt] [PATCHv2 2/2] interface: add udev based backend for virInterface

Daniel P. Berrange berrange at redhat.com
Mon Sep 10 10:08:29 UTC 2012


On Sun, Sep 09, 2012 at 05:02:09PM -0500, Doug Goldstein wrote:
> Add a read-only udev based backend for virInterface. Useful for distros
> that do not have netcf support yet. Multiple libvirt based utilities use
> a HAL based fallback when virInterface is not available which is less
> than ideal. This implements:
> * virConnectNumOfInterfaces()
> * virConnectListInterfaces()
> * virConnectNumOfDefinedInterfaces()
> * virConnectListDefinedInterfaces()
> * virConnectInterfaceLookupByName()
> * virConnectInterfaceLookupByMACString()
> ---
>  .gnulib                                |    2 +-
>  configure.ac                           |   10 +-
>  src/Makefile.am                        |   12 +-
>  src/interface/interface_backend_udev.c |  395 ++++++++++++++++++++++++++++++++
>  tools/virsh.c                          |    3 +
>  5 files changed, 417 insertions(+), 5 deletions(-)
>  create mode 100644 src/interface/interface_backend_udev.c

I'm somewhat loathe to include this impl.

The functionality provided is so limited as compared to netcf, that I
don't think it'd really be a viable alternative.  Also the semantics
of this driver are somewhat different to what we intend these APIs to
report. The intent was not that we report all physical interfaces, but
rather that we have an idea of "logical interfaces" which comprise
potentially many physical interfaces. I know you are filtering out
TUN devices and anything that's part of a bridge, so you get kind of
close to what netcf would do, but it still feels a little wrong.

If we did, however, want to go down the route of having a generic
udev based impl, then I think you'd probably want to actually do
this as an alternative netcf driver. That way you can re-use the
existing code for reverse-engineering an interface XML config from
the live config.

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list