From nobody Tue Mar 3 04:55:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1772183121; cv=none; d=zohomail.com; s=zohoarc; b=X7LeFbZoTyhP7Pus11/0GW8RzhpGq+kmXzfpRCgzYtLK4IitB1/yWPjKJWMZbvjIbRs38hblDz0NgfRjZJZaMBrejORSQ+syMBhr7tURGFeGj4n88AUfcnGnH+HnyCGuTttO5F43FVwngNKOgJafAuGW66S5xo+rmovZ82UxBdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772183121; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=xPuv30NK5+RDNfa2vorNDZ0jD/gUmMgDH1yMb+3PXwY=; b=X5epPRbcNoRkivc0t09wDGmQLl2xTdFV1RbvSmEWao9z2qbIb0pSwNusNG6xyRJD+iFia/IBaCEwZaTp6YGALOv+kKtHeF0xTLGdMOMSXuHkaNJ1TVbd2As8FB0ATjk7bRHDkTlcvLm+RyB8oyOz8QrwgP5cj/1sbv65DYmyyUc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1772183121718729.3520204625398; Fri, 27 Feb 2026 01:05:21 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id A613541D8D; Fri, 27 Feb 2026 04:05:20 -0500 (EST) Received: from [172.19.199.12] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 9DFAC423DA; Fri, 27 Feb 2026 04:03:22 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 68CDA41D3B; Fri, 27 Feb 2026 04:03:17 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id B143741AE5 for ; Fri, 27 Feb 2026 04:03:10 -0500 (EST) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-457-EeV_dM0jNrSJyW6nHSnTOg-1; Fri, 27 Feb 2026 04:03:08 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 95D8A19560A1 for ; Fri, 27 Feb 2026 09:03:07 +0000 (UTC) Received: from moe (unknown [10.43.3.236]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0251319560B5 for ; Fri, 27 Feb 2026 09:03:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HELO_MISC_IP,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_SBL_CSS,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772182990; h=from:from: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; bh=xPuv30NK5+RDNfa2vorNDZ0jD/gUmMgDH1yMb+3PXwY=; b=M7tVPxeuN1+aZHIdyEHyF1bMGHUjiOTPrZzciffj7Qb3khAcoyo62jneRtTEMluDM9O371 ZN9E8TU+KmTDnZoPtxrY5IkILqoTGs3aYB2Q06N8nu+ezVPSJ1YMhIYWW5OgniWgChBJi7 4d1XiPVXX+Hz46tp6nSAoP+JSovk0K8= X-MC-Unique: EeV_dM0jNrSJyW6nHSnTOg-1 X-Mimecast-MFC-AGG-ID: EeV_dM0jNrSJyW6nHSnTOg_1772182987 To: devel@lists.libvirt.org Subject: [PATCH 3/4] virnetdevmock: Mock virNetDevSaveNetConfig() and virNetDevSetNetConfig() Date: Fri, 27 Feb 2026 10:02:58 +0100 Message-ID: <6ce24124692ecbd5b0db6466f1b5af559cf914ef.1772182866.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 4CH_3ZVC2-VHOPN9uI95ornX_5lA5JhQfLSYK9zQWkM_1772182987 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CBWUTJFKBRCTXWTZOYTVL5TT2XZQXAQW X-Message-ID-Hash: CBWUTJFKBRCTXWTZOYTVL5TT2XZQXAQW X-MailFrom: mprivozn@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Michal Privoznik via Devel Reply-To: Michal Privoznik X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1772183122345158500 Content-Type: text/plain; charset="utf-8"; x-default="true" From: Michal Privoznik We really don't want our test suite talking to kernel and setting various attributes on NICs. Signed-off-by: Michal Privoznik --- src/util/virnetdev.h | 5 +++-- tests/virnetdevmock.c | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 1da1795487..424d4c0e52 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -248,7 +248,8 @@ int virNetDevGetVirtualFunctions(const char *pfname, int virNetDevSaveNetConfig(const char *linkdev, int vf, const char *stateDir, bool saveVlan) - ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; + ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT + ATTRIBUTE_MOCKABLE; =20 int virNetDevReadNetConfig(const char *linkdev, int vf, @@ -265,7 +266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, const virNetDevVlan *vlan, const virMacAddr *MAC, bool setVLan) - ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; + ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_MOCKABLE; =20 int virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname, int *vf) diff --git a/tests/virnetdevmock.c b/tests/virnetdevmock.c index 910009d80c..c45b89288b 100644 --- a/tests/virnetdevmock.c +++ b/tests/virnetdevmock.c @@ -33,6 +33,28 @@ virNetDevSysfsFile(char **pf_sysfs_device_link, NET_DEV_TEST_DATA_PREFIX, ifna= me, file); return 0; } + + +int +virNetDevSaveNetConfig(const char *linkdev G_GNUC_UNUSED, + int vf G_GNUC_UNUSED, + const char *stateDir G_GNUC_UNUSED, + bool saveVlan G_GNUC_UNUSED) +{ + return 0; +} + + +int +virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED, + int vf G_GNUC_UNUSED, + const virMacAddr *adminMAC G_GNUC_UNUSED, + const virNetDevVlan *vlan G_GNUC_UNUSED, + const virMacAddr *MAC G_GNUC_UNUSED, + bool setVLan G_GNUC_UNUSED) +{ + return 0; +} #else /* Nothing to override on non-__linux__ platforms */ #endif --=20 2.52.0