]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsysinfo: Drop global @sysinfoDmidecode
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 8 Jun 2020 10:53:04 +0000 (12:53 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Jun 2020 12:00:38 +0000 (14:00 +0200)
Since nobody sets custom dmidecode path anymore, we can drop all
code that exists only because of that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virsysinfo.c
src/util/virsysinfopriv.h
tests/sysinfotest.c

index 0bf80c339b8857029b66f492ae7273d1f22f674f..a26c27e83e464ed620e2e24c9a90bb48f05d8d65 100644 (file)
@@ -45,23 +45,18 @@ VIR_ENUM_IMPL(virSysinfo,
               "smbios",
 );
 
-static const char *sysinfoDmidecode = DMIDECODE;
 static const char *sysinfoSysinfo = "/proc/sysinfo";
 static const char *sysinfoCpuinfo = "/proc/cpuinfo";
 
-#define SYSINFO_SMBIOS_DECODER sysinfoDmidecode
 #define SYSINFO sysinfoSysinfo
 #define CPUINFO sysinfoCpuinfo
 #define CPUINFO_FILE_LEN (1024*1024)    /* 1MB limit for /proc/cpuinfo file */
 
 
 void
-virSysinfoSetup(const char *dmidecode,
-                const char *sysinfo,
+virSysinfoSetup(const char *sysinfo,
                 const char *cpuinfo)
 {
-    if (dmidecode)
-        sysinfoDmidecode = dmidecode;
     sysinfoSysinfo = sysinfo;
     sysinfoCpuinfo = cpuinfo;
 }
@@ -1124,8 +1119,7 @@ virSysinfoReadDMI(void)
     g_autofree char *outbuf = NULL;
     g_autoptr(virCommand) cmd = NULL;
 
-    cmd = virCommandNewArgList(SYSINFO_SMBIOS_DECODER,
-                               "-q", "-t", "0,1,2,3,4,17", NULL);
+    cmd = virCommandNewArgList(DMIDECODE, "-q", "-t", "0,1,2,3,4,17", NULL);
     virCommandSetOutputBuffer(cmd, &outbuf);
     if (virCommandRun(cmd, NULL) < 0)
         return NULL;
index cdcb0213093bae44c275152bf597a03d2e02fcca..d6c558a32d5b72b48ed913c5359cac92f007882d 100644 (file)
@@ -24,8 +24,7 @@
 #pragma once
 
 void
-virSysinfoSetup(const char *dmidecode,
-                const char *sysinfo,
+virSysinfoSetup(const char *sysinfo,
                 const char *cpuinfo);
 
 virSysinfoDefPtr
index f0805697300129cce31bed066d914674f4dfcea0..10d24b823aeffec8252db7413833c719a482cbaf 100644 (file)
@@ -84,7 +84,7 @@ testSysinfo(const void *data)
 
     virCommandSetDryRun(NULL, testDMIDecodeDryRun, sysinfo);
 
-    virSysinfoSetup(NULL, sysinfo, cpuinfo);
+    virSysinfoSetup(sysinfo, cpuinfo);
 
     ret = testdata->func();
     virCommandSetDryRun(NULL, NULL, NULL);