From nobody Mon Feb 9 07:38:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1591629064; cv=none; d=zohomail.com; s=zohoarc; b=gzG7CFaYxbwZ/Otnh+WShfmy5BLUeCSpMdX3Ajy9TaDTnDu/+YaMO4MZupOaxswuuQ1uYAs4jo0Mf33BLOv8K+4FMae+4Mq/Pjj33s3cxaHZlO6D172qJgs6x14BKEHbpGJBh3Xya24CSmxLIli1OuKZB2c9o/a6CcMd40/O9nM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591629064; 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=UNvoHBlszDAok8xM995lFMXlpAaClR8JRlqpI6X5wCE=; b=XIXRUPk3/436htF0AqOVlxwo8HT5kqcWUL+MPQ8zCh8dW78dD7xVM+6XwyOEkBVZnF4vcnSaxxR7cuupTlnBK/tuzwoU/XMo4AVGiAkIPYSHo6n52cdb7I5rb4uFg8t0XTC9PjlCHimxYte1hIDRE67lnJG8i8tCmR0iRJxPj30= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1591629064964299.2820767698313; Mon, 8 Jun 2020 08:11: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-314-2uIq1-99M-KPCBRth2o0sQ-1; Mon, 08 Jun 2020 11:10:08 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7A3018018A7; Mon, 8 Jun 2020 15:09:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5CFFF648C9; Mon, 8 Jun 2020 15:09:59 +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 30C3EB348A; Mon, 8 Jun 2020 15:09:59 +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 058F6UfN004856 for ; Mon, 8 Jun 2020 11:06:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id A8B1210013D4; Mon, 8 Jun 2020 15:06:30 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2890710013C1 for ; Mon, 8 Jun 2020 15:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591629063; 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=UNvoHBlszDAok8xM995lFMXlpAaClR8JRlqpI6X5wCE=; b=hVu0x3qfpMwtAGB1xBvf2+szZNZTwnyxFf+yUo2AQutgKHjxEC+Vb0PsJTH81Z3IZfJ+zb tBJu5sQ7RCQc1iLRzI2CLHFkKxcrKl0qG9etYu1EFRHF3oOK7hlwgyLwRhLt2PrzQOqtvd 8ppcMDm6VkgfMx0lTgg98SBgSxA+hk8= X-MC-Unique: 2uIq1-99M-KPCBRth2o0sQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 6/7] virsysinfo: Drop global @sysinfoDmidecode Date: Mon, 8 Jun 2020 17:06:20 +0200 Message-Id: <113487746cc507e0f50190f6add1a273dbc16108.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.79 on 10.5.11.13 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" Since nobody sets custom dmidecode path anymore, we can drop all code that exists only because of that. Signed-off-by: Michal Privoznik --- src/util/virsysinfo.c | 10 ++-------- src/util/virsysinfopriv.h | 3 +-- tests/sysinfotest.c | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 0bf80c339b..a26c27e83e 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -45,23 +45,18 @@ VIR_ENUM_IMPL(virSysinfo, "smbios", ); =20 -static const char *sysinfoDmidecode =3D DMIDECODE; static const char *sysinfoSysinfo =3D "/proc/sysinfo"; static const char *sysinfoCpuinfo =3D "/proc/cpuinfo"; =20 -#define SYSINFO_SMBIOS_DECODER sysinfoDmidecode #define SYSINFO sysinfoSysinfo #define CPUINFO sysinfoCpuinfo #define CPUINFO_FILE_LEN (1024*1024) /* 1MB limit for /proc/cpuinfo fil= e */ =20 =20 void -virSysinfoSetup(const char *dmidecode, - const char *sysinfo, +virSysinfoSetup(const char *sysinfo, const char *cpuinfo) { - if (dmidecode) - sysinfoDmidecode =3D dmidecode; sysinfoSysinfo =3D sysinfo; sysinfoCpuinfo =3D cpuinfo; } @@ -1124,8 +1119,7 @@ virSysinfoReadDMI(void) g_autofree char *outbuf =3D NULL; g_autoptr(virCommand) cmd =3D NULL; =20 - cmd =3D virCommandNewArgList(SYSINFO_SMBIOS_DECODER, - "-q", "-t", "0,1,2,3,4,17", NULL); + cmd =3D virCommandNewArgList(DMIDECODE, "-q", "-t", "0,1,2,3,4,17", NU= LL); virCommandSetOutputBuffer(cmd, &outbuf); if (virCommandRun(cmd, NULL) < 0) return NULL; diff --git a/src/util/virsysinfopriv.h b/src/util/virsysinfopriv.h index cdcb021309..d6c558a32d 100644 --- a/src/util/virsysinfopriv.h +++ b/src/util/virsysinfopriv.h @@ -24,8 +24,7 @@ #pragma once =20 void -virSysinfoSetup(const char *dmidecode, - const char *sysinfo, +virSysinfoSetup(const char *sysinfo, const char *cpuinfo); =20 virSysinfoDefPtr diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index f080569730..10d24b823a 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -84,7 +84,7 @@ testSysinfo(const void *data) =20 virCommandSetDryRun(NULL, testDMIDecodeDryRun, sysinfo); =20 - virSysinfoSetup(NULL, sysinfo, cpuinfo); + virSysinfoSetup(sysinfo, cpuinfo); =20 ret =3D testdata->func(); virCommandSetDryRun(NULL, NULL, NULL); --=20 2.26.2