[libvirt] [Fwd: first cut public API for physical host interface configuration]

Laine Stump laine at laine.org
Fri Mar 27 16:58:44 UTC 2009


To summarize (correct anything I've gotten wrong):

1) Supporting transient interfaces would be nice, but would require too 
much re-implementation of ifup-type scripts in our code (and for every 
platorm), so it is out of scope. danpb thinks at least being able to 
query transient interfaces (those that exist, but have no ifcfg-* file) 
would be nice. (Since libnetcf currently does everything by reading the 
ifcfg-* files and converting them into XML, that would require some work).

2) Just querying by name isn't good enough, but using UUID creates extra 
complexity. The problem can also solved by querying with MAC address. 
I'll add in the appropriate functions.

3) For consistency, virInterfaceStart() should be renamed to 
virInterfaceCreate(), and virInterfaceStop() to either 
virInterfaceDestroy() or virInterfaceDelete() (I still like Startp/Stop, 
since htey imply that the objects can be re-used, but The idea of a less 
polluted namespace has its advantages). So which

4) virInterfaceDefineXML(), virInterfaceCreate(), and 
virInterfaceHumiliateAndEmasculate() (pending a concensus on name) 
should have a "flags" argument added, currently unused, but to allow for 
future expansion without needing to obsolete the API.

5) For bonus points, danpb suggests adding:

   int virInterfaceStats (virInterfacePtr interface,
                          virInterfaceStatsPtr stats,
                          size_t size);

Useful idea, but I'll save the bonus points for later - right now I'm 
just trying to avoid getting kicked off the island! (seriously, though, 
that is outside the current scope of libnetcf. Depending on what stats 
you wanted, it could be implemented on linux by just sifting through 
/proc/net/dev. Are you just looking for the same stats that are 
delivered by virDomainInterfaceStats (except for the physical host)?

Did I get everything? (I'm attaching another libvirt.h diff, based on 
the comments).



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: API2.diff
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20090327/8eebdc5d/attachment-0001.ksh>


More information about the libvir-list mailing list