I've already been working on incorporating physical host interface
configuration into libvirt by way of using libnetcf on the backend. It's
becoming apparent that, in addition to modifying and reporting the
current configuration of interfaces, libvirt users also want to query
current status of each interface (up/down, possibly other flags,
packet/byte/error counts, current IP address, etc).
There are two possible ways of doing this:
1) maintain libnetcf's focus on just interface configuration, and
add code directly into libvirt to grab this information via
appropriate ioctls
or
2) add the functionality to libnetcf, and have libvirt call the
new libnetcf API.
(2) seems to make the most sense, because likely other libnetcf
consumers will want this capability too.
I'm thinking of a single API, something like:
int netcf_if_status(netcf_if *, netcf_if_stats *);
(or maybe int netcf_if_info(netcf_if *, netcf_if_info *))
I haven't really put much thought into the details of what should be in
netcf_if_stats yet (beyond what I listed above), but wanted to get this
idea out there so people can start sounding off (if I'm going down the
wrong road, I'd rather be put on the right path before I get too far along!)
This function could be exposed in the libvirt API as something like:
int virInterfaceStatus|Info(virInterffacePtr iface,
virInterfaceStats|Info *info);
Any comments/ideas on this?
(One possible complication I can see is interfaces with multiple
associated IPs. On some platforms, each interface can have only a single
IPv4 and a single IPv6 address (more IPs == more interfaces), but on
others there can be multiples.)
A (kind of) separate issue: In libvirt we want to be able to list active
(up) and inactive (down) interfaces separately. For consistency,
libvirt's way of exposing that will be to mimic what is done with
virConnectListNetworks() (active) vs. virConnectListDefinedNetworks()
(inactive).
But netcf could do it with an extra argument to ncf_list_interfaces().
If the latter, should the default behavior be to list all interfaces,
with flags set to eliminate up or down interfaces?
0 (list all)
NETCF_NOLIST_UP
NETCF_NOLIST_DOWN
Or should the values be something like this:
0 (list all)
NETCF_LIST_UP_ONLY
NETCF_LIST_DOWN_ONLY
(UP_ONLY + DOWN_ONLY would be equivalent to 0. As long as nobody came up
with a good reason for "0".
So should we do one of those, or should we mimic libirt's virNetwork API
in libnetcf too?
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list