[libvirt PATCH v3 2/8] qemu_conf: use virFindFileInPathFull for runtime binaries

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

 



Following patches will stop detecting the full path during compilation
so we will need to do it here.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 src/qemu/qemu_conf.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 916a3d36ee..437b3ce2be 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -109,6 +109,12 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged,
                                               const char *root)
 {
     g_autoptr(virQEMUDriverConfig) cfg = NULL;
+    const char *qemu_extra_paths[] = {
+        "/usr/libexec",
+        "/usr/lib/qemu",
+        "/usr/lib",
+        NULL,
+    };
 
     if (virQEMUConfigInitialize() < 0)
         return NULL;
@@ -267,10 +273,14 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged,
             return NULL;
     }
 
-    cfg->bridgeHelperName = g_strdup(QEMU_BRIDGE_HELPER);
-    cfg->prHelperName = g_strdup(QEMU_PR_HELPER);
-    cfg->slirpHelperName = g_strdup(QEMU_SLIRP_HELPER);
-    cfg->dbusDaemonName = g_strdup(QEMU_DBUS_DAEMON);
+    cfg->bridgeHelperName = virFindFileInPathFull(QEMU_BRIDGE_HELPER,
+                                                  (GStrv) qemu_extra_paths);
+    cfg->prHelperName = virFindFileInPathFull(QEMU_PR_HELPER,
+                                              (GStrv) qemu_extra_paths);
+    cfg->slirpHelperName = virFindFileInPathFull(QEMU_SLIRP_HELPER,
+                                                 (GStrv) qemu_extra_paths);
+    cfg->dbusDaemonName = virFindFileInPathFull(QEMU_DBUS_DAEMON,
+                                                (GStrv) qemu_extra_paths);
 
     cfg->securityDefaultConfined = true;
     cfg->securityRequireConfined = false;
-- 
2.30.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