[PATCH v2 2/7] virSysinfoReadDMI: Drop needless virFindFileInPath()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/util/virsysinfo.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 296a2e2cc1..0f1210ab37 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -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;
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux