
On 09/02/2014 06:31 AM, Francesco Romani wrote:
This patch implements the VIR_DOMAIN_STATS_INTERFACE group of statistics.
Signed-off-by: Francesco Romani <fromani@redhat.com> --- include/libvirt/libvirt.h.in | 1 + src/libvirt.c | 13 +++++++ src/qemu/qemu_driver.c | 85 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+)
* + * VIR_DOMAIN_STATS_INTERFACE: Return network interface statistics. + * The typed parameter keys are in this format: + * "net.count" - number of network interfaces on this domain. + * "net.<num>.name" - name of the interface <num>. + * "net.<num>.rx.bytes" - bytes received. + * "net.<num>.rx.pkts" - packets received. + * "net.<num>.rx.errs" - receive errors. + * "net.<num>.rx.drop" - receive packets dropped. + * "net.<num>.tx.bytes" - bytes transmitted. + * "net.<num>.tx.pkts" - packets transmitted. + * "net.<num>.tx.errs" - transmission errors. + * "net.<num>.tx.drop" - transmit packets dropped.
Missing types.
+#define QEMU_ADD_COUNT_PARAM(RECORD, MAXPARAMS, TYPE, COUNT) \ +do { \ + char param_name[NAME_MAX]; \
NAME_MAX is oversized.
+ snprintf(param_name, NAME_MAX, "%s.count", TYPE); \ + if (virTypedParamsAddUInt(&RECORD->params, \
For safety, I'd write $(RECORD)->params, and so forth. ALL_CAPS macro parameter names are unusual; it is sufficient that the macro name is all caps. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org