virSysinfoReadDMI: Drop needless virFindFileInPath()

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 <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Michal Privoznik 2020-06-08 10:49:36 +02:00
parent 30ccd55338
commit f603b99ad9

View File

@ -1119,20 +1119,12 @@ virSysinfoParseX86Memory(const char *base, virSysinfoDefPtr ret)
virSysinfoDefPtr
virSysinfoReadDMI(void)
{
g_autofree char *path = NULL;
g_auto(virSysinfoDefPtr) ret = NULL;
g_autofree char *outbuf = NULL;
g_autoptr(virCommand) cmd = NULL;
path = virFindFileInPath(SYSINFO_SMBIOS_DECODER);
if (path == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to find path for %s binary"),
SYSINFO_SMBIOS_DECODER);
return NULL;
}
cmd = virCommandNewArgList(path, "-q", "-t", "0,1,2,3,4,17", NULL);
cmd = virCommandNewArgList(SYSINFO_SMBIOS_DECODER,
"-q", "-t", "0,1,2,3,4,17", NULL);
virCommandSetOutputBuffer(cmd, &outbuf);
if (virCommandRun(cmd, NULL) < 0)
return NULL;