From nobody Mon Feb 9 07:26:54 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1591628810; cv=none; d=zohomail.com; s=zohoarc; b=cjl/wuoyUJT7gXdDNGVdXq8qyrjPld4TqD/Ny802OD+pjtM0MAm8MWNaYiV+8t9JUb7hGSaUOJC+05o3cPZubJH/PMfl7MhOXQPFp0QSKlYi3azRnEtvLSQ/AaFkSnDyBrw0W2+VXodFaTVNSfK0+TQt94pf4Z/103ibLLgGLxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591628810; 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=lM+2BM7mx8IjN7XvnBUNKL0nAg4txPUZnP/O8d8yqMA=; b=cSTSMFl+IEOrlOSlsa5dVI9odenpbStuYUhyKgAlmDlfI2sijo2QuUQpBkh/zHdHCf2Jfn1QifHZQPXxbUZ/A57NwnCkpgUtfnkn0Sb+O01wggpeTCIWsn0ZrsS5EHOStU6Ln/0Te3wIG61jjMHVvjVW4ETKq6Dhs+Xfs+cMO78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1591628810663593.8622210964603; Mon, 8 Jun 2020 08:06:50 -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-214-A7F2iSE0PciA3y8baUpiLA-1; Mon, 08 Jun 2020 11:06:34 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8542E18A072C; Mon, 8 Jun 2020 15:06:29 +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 64B5D2B4D3; Mon, 8 Jun 2020 15:06:29 +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 D5C361809547; Mon, 8 Jun 2020 15:06:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 058F6RiU004829 for ; Mon, 8 Jun 2020 11:06:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 34AE510013D4; Mon, 8 Jun 2020 15:06:27 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8A4A10013C1 for ; Mon, 8 Jun 2020 15:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591628809; 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=lM+2BM7mx8IjN7XvnBUNKL0nAg4txPUZnP/O8d8yqMA=; b=QAL3Qiedz5bq4E1r2o8ygVQlIUZD2HHq2DDX+e9HHmXQpKZ2slZbwWsoS7dLQvAsKIiryy RWxfWUXdA92iZ9l1I0PIlFOon9moEFvtRbTxSfWsdrDEoCrddLBEqGDGMzLyZ1uHzEVMCq oe7UR9beGWWyhu0DccBMH7D9HdmX5PQ= X-MC-Unique: A7F2iSE0PciA3y8baUpiLA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 2/7] virSysinfoReadDMI: Drop needless virFindFileInPath() Date: Mon, 8 Jun 2020 17:06:16 +0200 Message-Id: <7999154c6f34f51eab5ecae58c28e0ab4c0d4c49.1591628594.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.23 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" When trying to decode DMI table, just before constructing virCommand() the decoder is looked for in PATH using virFindFileInPath(). Well, this is not necessary because virCommandRun() will do this too (in virExec()). Signed-off-by: Michal Privoznik --- src/util/virsysinfo.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 296a2e2cc1..0f1210ab37 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -1119,20 +1119,12 @@ virSysinfoParseX86Memory(const char *base, virSysin= foDefPtr ret) virSysinfoDefPtr virSysinfoReadDMI(void) { - g_autofree char *path =3D NULL; g_auto(virSysinfoDefPtr) ret =3D NULL; g_autofree char *outbuf =3D NULL; g_autoptr(virCommand) cmd =3D NULL; =20 - path =3D virFindFileInPath(SYSINFO_SMBIOS_DECODER); - if (path =3D=3D NULL) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Failed to find path for %s binary"), - SYSINFO_SMBIOS_DECODER); - return NULL; - } - - cmd =3D virCommandNewArgList(path, "-q", "-t", "0,1,2,3,4,17", NULL); + cmd =3D virCommandNewArgList(SYSINFO_SMBIOS_DECODER, + "-q", "-t", "0,1,2,3,4,17", NULL); virCommandSetOutputBuffer(cmd, &outbuf); if (virCommandRun(cmd, NULL) < 0) return NULL; --=20 2.26.2