From nobody Sun Feb 8 20:13:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678096053; cv=none; d=zohomail.com; s=zohoarc; b=dTjn9dIQvsmrs4NE3WWJLSBAtNjejiFerHChkNYsSK/W3OlJW40R0n2SaR+WlU/q9CjJvjZQO8QmMWXEDifr7Lxo2mus+KbhLSzCnTdRObn5Fi6UuCXxoTXVbLYE33Jg6s8y6v3eUZzsWOFKhPvv4gm+nU1U0j+M/jxGEASjrXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678096053; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/xbjyOm50sAzsRzZ1ro9fSxszwN62u8kLfW1tl8ou9o=; b=duS0Z74MFSnlIPTEJJUK4emjuS3IbTOxpAb1jlIifL/XIjUv1V2lv18dxsSvS+X/W4YThXCr8nKsn/rqiXHLGV1qCUsHcOJa8PJxNPb34cL0uCvtWZCex6RBUzW27k1UDrIA1EBuiS4JkLegEJkWvMsAdu4OnWEayPEM5WtAakU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1678096053694562.7738251912116; Mon, 6 Mar 2023 01:47:33 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-451-3fq5OfE1P022vBdZwVIwAA-1; Mon, 06 Mar 2023 04:47:31 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 64439811E6E; Mon, 6 Mar 2023 09:47:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 027E72166B26; Mon, 6 Mar 2023 09:47:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E3128194658D; Mon, 6 Mar 2023 09:47:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EF3E11946586 for ; Mon, 6 Mar 2023 09:47:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id C75DD400DFA1; Mon, 6 Mar 2023 09:47:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6FC5C40C83B6 for ; Mon, 6 Mar 2023 09:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678096052; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/xbjyOm50sAzsRzZ1ro9fSxszwN62u8kLfW1tl8ou9o=; b=GQV0lB2DX+/LUQuowUE5vFM7BahpNwM9RMmM7wnpA2d8MvAQeGWFRXbOkxsB87DIz4fbVn ZPK1/z0DZi2yjsohJPAjJaZzgtp2IKX8G6mOZ0Q88aMm0OvL7cCzh2+FploPRTByzip6am Gf0HPTdT4yKaIn1Svj7D4SUmQI9RLgY= X-MC-Unique: 3fq5OfE1P022vBdZwVIwAA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] src: Document virDomainInterfaceStats() limitation Date: Mon, 6 Mar 2023 10:47:24 +0100 Message-Id: <37d3223fa7eff8d87a32edb24117d33952598eb9.1678095981.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678096054746100001 Content-Type: text/plain; charset="utf-8"; x-default="true" 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 --- 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 tha= t 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. =20 =20 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 --=20 2.39.2