mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
virsysinfo: Drop global @sysinfoDmidecode
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>
This commit is contained in:
parent
d954fbc74e
commit
994e56ba42
@ -45,23 +45,18 @@ VIR_ENUM_IMPL(virSysinfo,
|
|||||||
"smbios",
|
"smbios",
|
||||||
);
|
);
|
||||||
|
|
||||||
static const char *sysinfoDmidecode = DMIDECODE;
|
|
||||||
static const char *sysinfoSysinfo = "/proc/sysinfo";
|
static const char *sysinfoSysinfo = "/proc/sysinfo";
|
||||||
static const char *sysinfoCpuinfo = "/proc/cpuinfo";
|
static const char *sysinfoCpuinfo = "/proc/cpuinfo";
|
||||||
|
|
||||||
#define SYSINFO_SMBIOS_DECODER sysinfoDmidecode
|
|
||||||
#define SYSINFO sysinfoSysinfo
|
#define SYSINFO sysinfoSysinfo
|
||||||
#define CPUINFO sysinfoCpuinfo
|
#define CPUINFO sysinfoCpuinfo
|
||||||
#define CPUINFO_FILE_LEN (1024*1024) /* 1MB limit for /proc/cpuinfo file */
|
#define CPUINFO_FILE_LEN (1024*1024) /* 1MB limit for /proc/cpuinfo file */
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
virSysinfoSetup(const char *dmidecode,
|
virSysinfoSetup(const char *sysinfo,
|
||||||
const char *sysinfo,
|
|
||||||
const char *cpuinfo)
|
const char *cpuinfo)
|
||||||
{
|
{
|
||||||
if (dmidecode)
|
|
||||||
sysinfoDmidecode = dmidecode;
|
|
||||||
sysinfoSysinfo = sysinfo;
|
sysinfoSysinfo = sysinfo;
|
||||||
sysinfoCpuinfo = cpuinfo;
|
sysinfoCpuinfo = cpuinfo;
|
||||||
}
|
}
|
||||||
@ -1124,8 +1119,7 @@ virSysinfoReadDMI(void)
|
|||||||
g_autofree char *outbuf = NULL;
|
g_autofree char *outbuf = NULL;
|
||||||
g_autoptr(virCommand) cmd = NULL;
|
g_autoptr(virCommand) cmd = NULL;
|
||||||
|
|
||||||
cmd = virCommandNewArgList(SYSINFO_SMBIOS_DECODER,
|
cmd = virCommandNewArgList(DMIDECODE, "-q", "-t", "0,1,2,3,4,17", NULL);
|
||||||
"-q", "-t", "0,1,2,3,4,17", NULL);
|
|
||||||
virCommandSetOutputBuffer(cmd, &outbuf);
|
virCommandSetOutputBuffer(cmd, &outbuf);
|
||||||
if (virCommandRun(cmd, NULL) < 0)
|
if (virCommandRun(cmd, NULL) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -24,8 +24,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void
|
void
|
||||||
virSysinfoSetup(const char *dmidecode,
|
virSysinfoSetup(const char *sysinfo,
|
||||||
const char *sysinfo,
|
|
||||||
const char *cpuinfo);
|
const char *cpuinfo);
|
||||||
|
|
||||||
virSysinfoDefPtr
|
virSysinfoDefPtr
|
||||||
|
@ -84,7 +84,7 @@ testSysinfo(const void *data)
|
|||||||
|
|
||||||
virCommandSetDryRun(NULL, testDMIDecodeDryRun, sysinfo);
|
virCommandSetDryRun(NULL, testDMIDecodeDryRun, sysinfo);
|
||||||
|
|
||||||
virSysinfoSetup(NULL, sysinfo, cpuinfo);
|
virSysinfoSetup(sysinfo, cpuinfo);
|
||||||
|
|
||||||
ret = testdata->func();
|
ret = testdata->func();
|
||||||
virCommandSetDryRun(NULL, NULL, NULL);
|
virCommandSetDryRun(NULL, NULL, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user