From 53f9fcb263e40ff82b9fcbce8b8cba0f3649ac9b Mon Sep 17 00:00:00 2001 From: ZhiPeng Lu Date: Tue, 12 Sep 2017 16:54:26 +0800 Subject: qga: add network stats to guest-network-get-interfaces we can get the network interface statistics inside a virtual machine by guest-network-get-interfaces command. it is very useful for us tomonitor and analyze network traffic. Signed-off-by: ZhiPeng Lu * don't rely on sizeof(wchar[]) for wchar[] indexing * avoid camelCase variable names * fix up getline() usage * condensed commit subject line Signed-off-by: Michael Roth --- qga/qapi-schema.json | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'qga/qapi-schema.json') diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json index 90a0c8602b..17884c7c70 100644 --- a/qga/qapi-schema.json +++ b/qga/qapi-schema.json @@ -642,6 +642,38 @@ 'ip-address-type': 'GuestIpAddressType', 'prefix': 'int'} } +## +# @GuestNetworkInterfaceStat: +# +# @rx-bytes: total bytes received +# +# @rx-packets: total packets received +# +# @rx-errs: bad packets received +# +# @rx-dropped: receiver dropped packets +# +# @tx-bytes: total bytes transmitted +# +# @tx-packets: total packets transmitted +# +# @tx-errs: packet transmit problems +# +# @tx-dropped: dropped packets transmitted +# +# Since: 2.11 +## +{ 'struct': 'GuestNetworkInterfaceStat', + 'data': {'rx-bytes': 'uint64', + 'rx-packets': 'uint64', + 'rx-errs': 'uint64', + 'rx-dropped': 'uint64', + 'tx-bytes': 'uint64', + 'tx-packets': 'uint64', + 'tx-errs': 'uint64', + 'tx-dropped': 'uint64' + } } + ## # @GuestNetworkInterface: # @@ -651,12 +683,16 @@ # # @ip-addresses: List of addresses assigned to @name # +# @statistics: various statistic counters related to @name +# (since 2.11) +# # Since: 1.1 ## { 'struct': 'GuestNetworkInterface', 'data': {'name': 'str', '*hardware-address': 'str', - '*ip-addresses': ['GuestIpAddress'] } } + '*ip-addresses': ['GuestIpAddress'], + '*statistics': 'GuestNetworkInterfaceStat' } } ## # @guest-network-get-interfaces: -- cgit v1.2.3-55-g7522