[Libvir] RFC: Broadcast our presence with avahi

Daniel Veillard veillard at redhat.com
Fri Sep 14 06:43:45 UTC 2007


On Fri, Sep 14, 2007 at 03:26:40AM +0100, Daniel P. Berrange wrote:
> All the really trendy network services these days broadcast their presence
> on the LAN using mDNS. In Linux world this means becoming an Avahi client
> and registering our services. virt-manager is also able to become an Avahi
> client and browser for services. So you'll be able to let the user just
> pick a host straight off a list instead of typing in hostname.

  +1 on the principle, allows to break the bootstrap problem and way better
from an UI perspective (as long as you don't end up with a 200 host lost to
pick from.

> The attached patch does two things:
> 
>  - Extends our event loop implementation so it can modify the event mask
>    associated with an FD, and the timeout associated with a timer. While
>    you could simulate this with an add & remove, this has the possibility
>    of failure (from malloc). Merely updating an existing event can be done
>    without failure. Avahi needs this ability for its event loop integration
> 
>  - Added qemu/mdns.c file to actually provide the service information. This
>    has two parts. The first section of code is taken straight from one of
>    the Avahi example programs. The second section is a implementaiton of the
>    Avahi event loop contract in terms of our event API - it works very nicely
>    which says good things about design of our event loop
> 
> Some things...
> 
>  - I arbitrarily picked a service type of '_libvirtd._tcp'. The docs on
>    picking service types seem non-existant on Avahi website, but it seems
>    to be common to use service name from /etc/services and protocol both
>    prefixed with _.
> 
>  - I advertise two subtypes, of '_xen.libvirtd._tcp' and '_qemu.libvirtd._tcp'
>    What I actually want todo is to be able to probe the libvirt local drivers
>    to auto-discover what virtualization platforms are available. A sort of
>    lightweight  virConnectOpen which merely returns TRUE/FALSE and doesn't
>    actually allocate a virConnectPtr object. Need to extend the internal
>    driver API for this.
> 
>  - I want to advertise whether the server is configured with TLS certs or
>    not, so remote clients can automatically choose to use SSH urls with
>    the remote driver if neccessary.
> 
>  - Let the admin turn advertisement on/off in the config file because some
>    people may not like it on their LAN.
> 
> If you fancy trying it,  avahi-browse --all  from another host on the LAN
> should show the service being advertised. The advertisements do not cross
> LAN routers by default.

  Can't review the patch right now, will try over the week-end,

    thanks !

Daniel
-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard at redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/




More information about the libvir-list mailing list