[libvirt] anyone implementing host device enumeration?

David Lively dlively at virtualiron.com
Tue Sep 30 04:17:27 UTC 2008


Hi Daniel -

  I'm not really ready to submit this yet (hence no [PATCH] in the
subject), but it is functional enough to play with, mostly with the
HAL-based driver, though the devkit-based one works too.  In particular,
I'm not yet happy with the code to gather capabilities and bus info
(though gather_capabilities in node_device_hal.c is close to what I'm
going for).  Also, many of the details (which properties do we care
about for which buses and capabilities?) that make this useful are
missing, though I've provided a few guesses to get started.  And
finally, it's had very little testing at this point.

  Configure --with-hal or --with-devkit to support one or both (if both
are configured, HAL is preferred, provided we can talk to hald on dbus).
There are quite a few TODO's in the patch (mostly little things).

The larger TODO's are (in (my) priority order):
 * generalize gather_capabilities (node_device_hal.c) to work for HAL
bus info as well
 * share the nodeDevices hash table among (non-remote) connections
(perhaps store it in the virNodeDriver?)
 * register for HAL events to keep device info up-to-date
 * finish virsh, python support (for now there's enough to get devs/xml)
 * support more capability & bus properties (in HAL)
 * generalize gather_capabilities to work for gathering bus & capability
info for both HAL & devkit drivers
 * figure out how devkit and HAL correlate, so we report device info
consistently
 * register for devkit events to keep device info up-to-date

Dave

P.S. I'm afraid the patch is rather large, but remember to skip the
generated files when looking it over:

 configure.in                        |   97 ++++++
 include/libvirt/libvirt.h           |   78 +++++
 include/libvirt/libvirt.h.in        |   78 +++++
 include/libvirt/virterror.h         |    4
 python/generator.py                 |   15 +
 python/libvir.c                     |  127 ++++++++
 python/libvirt-python-api.xml       |   17 +
 python/libvirt_wrap.h               |   10
 python/types.c                      |   15 +
 qemud/remote.c                      |  282 +++++++++++++++++++
 qemud/remote_dispatch_localvars.h   |   20 +
 qemud/remote_dispatch_proc_switch.h |   93 ++++++
 qemud/remote_dispatch_prototypes.h  |   11
 qemud/remote_protocol.c             |  220 +++++++++++++++
 qemud/remote_protocol.h             |  184 ++++++++++++
 qemud/remote_protocol.x             |  117 +++++++
 src/Makefile.am                     |   19 +
 src/driver.h                        |   67 ++++
 src/hash.c                          |  181 ++++++++++++
 src/internal.h                      |   52 +++
 src/libvirt.c                       |  528
+++++++++++++++++++++++++++++++++++\
-
 src/libvirt_sym.version             |   14
 src/node_device.c                   |  262 +++++++++++++++++
 src/node_device.h                   |   38 ++
 src/node_device_devkit.c            |  299 ++++++++++++++++++++
 src/node_device_hal.c               |  475
++++++++++++++++++++++++++++++++
 src/remote_internal.c               |  364 ++++++++++++++++++++++++
 src/virsh.c                         |   80 +++++
 src/virterror.c                     |   21 +
 29 files changed, 3757 insertions(+), 11 deletions(-)


On Fri, 2008-09-26 at 14:15 +0100, Daniel P. Berrange wrote:
> On Thu, Aug 21, 2008 at 03:18:57PM -0400, David Lively wrote:
> > Hi -
> > 
> >   I'm about to start working on host device enumeration, along the
> > (HAL-ish) lines of what was discussed back in April:
> >   https://www.redhat.com/archives/libvir-list/2008-April/msg00005.html
> > 
> >   I know the xml details haven't been fully fleshed out, but there seems
> > to be agreement that it will be a fairly direct mapping from (a subset
> > of the) HAL info to the details that we need in the xml.  Doubtless it
> > will take a while to figure out exactly what subset suffices (and, for
> > that matter, if everything needed is available via HAL ...), but I think
> > the work is well-defined for some of the obvious details (discussed in
> > the above thread) on which there's broad agreement.
> > 
> >   Is anyone working on such an implementation?
> 
> Did you ever start any work on this project ?  The oVirt guys really want
> this done asap, so if you've not started on it, or have a partial start
> to work from, I plan to make time to look at it next week
> 
> Regards,
> Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: host-dev-enum.patch
Type: text/x-patch
Size: 159556 bytes
Desc: 
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080930/0c9eba0f/attachment-0001.bin>


More information about the libvir-list mailing list