Re: [PATCHv2 09/11] qemu: bulk stats: implement interface group

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]