From nobody Mon Nov 25 14:44:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1601507824; cv=none; d=zohomail.com; s=zohoarc; b=HI2n1GtDJOwPIOIxqH43qLdjW/sMrl9bQTYmuI3asTL29vpwzvObh/MCZI+TuHgefupMMk1hiFVbTnewTprsn1vSh3N1RFjDhE1ViCa1zC2ra+X65JRxsvXSAv9Aoi9UTfskUmpbB/pLuG+x7tQ7GCJnKQIwSuTtpfHxZfcCHFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507824; 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=NqkpvpxoSA1EXISZUAb062wv7CcId3wLMMPW52V0opE=; b=lfP1vmWod0OvJ4gU6GF5N+C6bPGunU4+IEHUaEGOZbZTJQ6lTCY1gg7AT9EKRQcx1ZhqnMi9ddut06o0cizu1MMgNOKrwX5sNbMNdh5WAFwGZHgqJBoOxH5kx2o+Utr676MndqahUJaKL9aznAXz7pof3FzPzRvtDXpURzsE6XU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1601507824554939.0889728762498; Wed, 30 Sep 2020 16:17:04 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-586-0hEQqzOGN72IZmhd_MEQeA-1; Wed, 30 Sep 2020 19:15:54 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 05A6B2FD02; Wed, 30 Sep 2020 23:15:50 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D56F410013C0; Wed, 30 Sep 2020 23:15:49 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A403B183D024; Wed, 30 Sep 2020 23:15:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEs7t028030 for ; Wed, 30 Sep 2020 19:14:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1F14355762; Wed, 30 Sep 2020 23:14:54 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE4FB3782 for ; Wed, 30 Sep 2020 23:14:53 +0000 (UTC) Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507823; 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=NqkpvpxoSA1EXISZUAb062wv7CcId3wLMMPW52V0opE=; b=DSXYHOOa3W5akfoC2/xtDLkI9fBl9b/NSg+9/GgMV8MPaa4ulZkTtrnXFTdB7GomnaMfTO s8Vk/Kt/uKHAR18P3I2ZG6oDM2OYcKoKF6Ck4tuHWpTEtMgCWkE9sSVy99jodZDIn65iCg V18RER8kAtXiEJPTB0xF5bI072pnF+g= X-MC-Unique: 0hEQqzOGN72IZmhd_MEQeA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 7/9] util: fix Linux build when libnl-devel isn't available Date: Wed, 30 Sep 2020 19:14:42 -0400 Message-Id: <20200930231444.409215-8-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There was one stray bit of code in virnetdev.c that required libnl to build, but wasn't qualified by defined(WITH_LIBNL). Adding that, plus putting a similar check around a static function only used by that aforementioned code, makes libvirt build properly without libnl-devel installed. How useful it is in that state is a separate issue :-) Signed-off-by: Laine Stump --- src/util/virnetdev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 737081a12b..5221bada7b 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -1058,6 +1058,9 @@ virNetDevSysfsDeviceFile(char **pf_sysfs_device_link,= const char *ifname, return 0; } =20 + +# if defined(WITH_LIBNL) + /** * Determine if the device path specified in devpath is a PCI Device * by resolving the 'subsystem'-link in devpath and looking for @@ -1091,6 +1094,7 @@ virNetDevIsPCIDevice(const char *devpath) return STRPREFIX(subsys, "pci"); } =20 + static virPCIDevicePtr virNetDevGetPCIDevice(const char *devName) { @@ -1110,6 +1114,7 @@ virNetDevGetPCIDevice(const char *devName) return virPCIDeviceNew(vfPCIAddr->domain, vfPCIAddr->bus, vfPCIAddr->slot, vfPCIAddr->function); } +# endif =20 =20 /** @@ -2958,7 +2963,7 @@ virNetDevGetEthtoolFeatures(const char *ifname, } =20 =20 -# if WITH_DECL_DEVLINK_CMD_ESWITCH_GET +# if defined(WITH_LIBNL) && WITH_DECL_DEVLINK_CMD_ESWITCH_GET =20 /** * virNetDevGetFamilyId: --=20 2.26.2