From 928e741172eba526e01fb95abdcc69de2c353e5d Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Mon, 6 Mar 2023 09:56:52 +0100 Subject: [PATCH] src: Document virDomainInterfaceStats() limitation For unmanaged ethernet , it is user's responsibility to set up the interface. And as such it can be just anything. Therefore, it's (almost) impossible for the virDomainInterfaceStats() API to tell whether RX/TX values need to be swapped or copied verbatim into the return structure. Document this limitation. Signed-off-by: Michal Privoznik Reviewed-by: Martin Kletzander --- docs/manpages/virsh.rst | 3 ++- src/libvirt-domain.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index d5b614dc03..26c328d390 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -2012,7 +2012,8 @@ interface stats are only available for interfaces that have a physical source interface. This does not include, for example, a 'user' interface type since it is a virtual LAN with NAT to the outside world. *interface-device* can be the interface target by -name or MAC address. +name or MAC address. Please note, for an unmanaged *ethernet* +type returned stats might have RX/TX swapped. domiftune diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 3199a27065..379057d9a7 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -5965,6 +5965,9 @@ virDomainBlockStatsFlags(virDomainPtr dom, * * The returned stats are from domain's point of view. * + * Please note, for an unmanaged ethernet type, returned stats + * might have RX/TX swapped. + * * Returns: 0 in case of success or -1 in case of failure. * * Since: 0.3.2