From nobody Thu May 2 14:40:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1551979268180606.6376172420298; Thu, 7 Mar 2019 09:21:08 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2CF7F3089E61; Thu, 7 Mar 2019 17:21:06 +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 AC1B06013F; Thu, 7 Mar 2019 17:21:05 +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 E980D181A12C; Thu, 7 Mar 2019 17:21:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x27HK10i001845 for ; Thu, 7 Mar 2019 12:20:01 -0500 Received: by smtp.corp.redhat.com (Postfix) id 85BE160142; Thu, 7 Mar 2019 17:20:01 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 07EC860141 for ; Thu, 7 Mar 2019 17:19:58 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Thu, 7 Mar 2019 18:19:57 +0100 Message-Id: <23dcbac5712e690f58be082ca07bb9c305680520.1551979183.git.phrdina@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] util: skip RDMA detection for non-PCI network devices 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 07 Mar 2019 17:21:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Only PCI devices have '/sys/class/net//device/resource' so we need to skip this check for all other network devices. Without this patch and RDMA enabled libvirt will not detect any network device that doesn't have the path above which includes 'lo', 'virbr', 'tun', etc. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1639258 Signed-off-by: Pavel Hrdina Reviewed-by: Andrea Bolognani --- src/util/virnetdev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index aeb9caab2a..699f2a0acb 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -2914,8 +2914,14 @@ virNetDevRDMAFeature(const char *ifname, =20 if (virAsprintf(ð_devpath, SYSFS_NET_DIR "%s/device/resource", ifna= me) < 0) goto cleanup; - if (!virFileExists(eth_devpath)) + + /* If /sys/class/net//device/resource doesn't exist it is not = a PCI + * device and therefore it will not have RDMA. */ + if (!virFileExists(eth_devpath)) { + ret =3D 0; goto cleanup; + } + if (virFileReadAll(eth_devpath, RESOURCE_FILE_LEN, ð_res_buf) < 0) goto cleanup; =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list