提交 f603b99a 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 30ccd553
...@@ -1119,20 +1119,12 @@ virSysinfoParseX86Memory(const char *base, virSysinfoDefPtr ret) ...@@ -1119,20 +1119,12 @@ virSysinfoParseX86Memory(const char *base, virSysinfoDefPtr ret)
virSysinfoDefPtr virSysinfoDefPtr
virSysinfoReadDMI(void) virSysinfoReadDMI(void)
{ {
g_autofree char *path = NULL;
g_auto(virSysinfoDefPtr) ret = NULL; g_auto(virSysinfoDefPtr) ret = NULL;
g_autofree char *outbuf = NULL; g_autofree char *outbuf = NULL;
g_autoptr(virCommand) cmd = NULL; g_autoptr(virCommand) cmd = NULL;
path = virFindFileInPath(SYSINFO_SMBIOS_DECODER); cmd = virCommandNewArgList(SYSINFO_SMBIOS_DECODER,
if (path == NULL) { "-q", "-t", "0,1,2,3,4,17", 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);
virCommandSetOutputBuffer(cmd, &outbuf); virCommandSetOutputBuffer(cmd, &outbuf);
if (virCommandRun(cmd, NULL) < 0) if (virCommandRun(cmd, NULL) < 0)
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册