From nobody Tue Sep 9 09:46:10 2025 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=1745925427; cv=none; d=zohomail.com; s=zohoarc; b=ANGuYd1jAG4IP717dLBB/+dpkHK2UI/RuAUFRCeJBIEJdT24wTOmn+cdnRdeBUCTm1RWErjClWlOLPJ0GFq/ndNXdaZ6GT2TWWp/6n+IyKiRpqqPbU+WMYAS0qTBhoTSpV8p9Nu9YobSY6/jYiltCwAEfC43XBcGjh7DP2Py1+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1745925427; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=RRtC2Ra7iTlyTgXSP04z31Q6Ce937/rDX3CKZtG3Kxo=; b=fD1tw/zlOfYhAcqf8uhAVY6gghNysTlly/PFcR86y/AUxjGB1eTFzRct0NIUE81qGdszMeyCO/MPE3n1Pwa1V91zQjcvYaVEH1ESF9k9WUxPDN4qdv1FD+p1/bT21KyzmFT/LdrmSnJWf57uS9kZby0wZYEPSR93vxZYJ48wFrM= 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 1745925427332988.3181142117571; Tue, 29 Apr 2025 04:17:07 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 99AFD92A; Tue, 29 Apr 2025 07:17:06 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 0A58D1369; Tue, 29 Apr 2025 07:14:42 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DC5A61406; Tue, 29 Apr 2025 07:14:37 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 1B5CA12B7 for ; Tue, 29 Apr 2025 07:14:31 -0400 (EDT) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-592-HSUjHYyvPBuHf2pey8uPJA-1; Tue, 29 Apr 2025 07:14:29 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 74C561800373 for ; Tue, 29 Apr 2025 11:14:28 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.98]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A02EA195608D; Tue, 29 Apr 2025 11:14:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1745925270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r87jXlmisYdyubp3VigatoJ4ofBCuObO8yUnNns9L6c=; b=NuGfCSZLYaqLwVyYIjkCrkKO7LtzMH8BLIoGKyurnrcTuAvUvFJ217urWvj6otM8s+VUMD W5tWPaoWW0M6tYR0zWT+IYlOQTdukMRzQwxjohAvOTOkQ7jGoizlbNBKtD/memXhFakwhZ TBPSkBXWNbkwcWpAcPwiiMDUwfvbons= X-MC-Unique: HSUjHYyvPBuHf2pey8uPJA-1 X-Mimecast-MFC-AGG-ID: HSUjHYyvPBuHf2pey8uPJA_1745925268 To: devel@lists.libvirt.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 05/20] util: stop hardcoding 'ifconfig' path Date: Tue, 29 Apr 2025 12:14:05 +0100 Message-ID: <20250429111420.1748521-6-berrange@redhat.com> In-Reply-To: <20250429111420.1748521-1-berrange@redhat.com> References: <20250429111420.1748521-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 7qc2ndqIfC9cqW0g4PNsdGiyq3f_9eNZekaiKi2rbgc_1745925268 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: CNWIVE6P5TRUI2GPGTQNCBTIQT2RRZOY X-Message-ID-Hash: CNWIVE6P5TRUI2GPGTQNCBTIQT2RRZOY X-MailFrom: berrange@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9_via_Devel?= Reply-To: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1745925427818019000 Content-Type: text/plain; charset="utf-8" From: Daniel P. Berrang=C3=A9 Change the source to assume use of 'ifconfig' on FreeBSD builds, allowing virCommand to report missing commands at runtime. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Peter Krempa --- meson.build | 4 ---- src/util/virnetdevip.c | 8 ++++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index b0b6efee8e..ea3e752f93 100644 --- a/meson.build +++ b/meson.build @@ -837,10 +837,6 @@ required_programs =3D [ 'xsltproc', ] =20 -if host_machine.system() =3D=3D 'freebsd' - required_programs +=3D 'ifconfig' -endif - foreach name : required_programs prog =3D find_program(name, dirs: libvirt_sbin_path) varname =3D name.underscorify() diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index f365c1999c..f7a7db620d 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -390,8 +390,8 @@ virNetDevIPAddrAdd(const char *ifname, return -1; } =20 -# ifdef IFCONFIG - cmd =3D virCommandNew(IFCONFIG); +# ifdef __FreeBSD__ + cmd =3D virCommandNew("ifconfig"); virCommandAddArg(cmd, ifname); if (VIR_SOCKET_ADDR_IS_FAMILY(addr, AF_INET6)) virCommandAddArg(cmd, "inet6"); @@ -431,8 +431,8 @@ virNetDevIPAddrDel(const char *ifname, =20 if (!(addrstr =3D virSocketAddrFormat(addr))) return -1; -# ifdef IFCONFIG - cmd =3D virCommandNew(IFCONFIG); +# ifdef __FreeBSD__ + cmd =3D virCommandNew("ifconfig"); virCommandAddArg(cmd, ifname); if (VIR_SOCKET_ADDR_IS_FAMILY(addr, AF_INET6)) virCommandAddArg(cmd, "inet6"); --=20 2.49.0