[PATCH v3 13/13] Initialize qemuImageBinary path at startup

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

---
 src/qemu/qemu_domain.c | 11 +++--------
 src/qemu/qemu_driver.c |  3 +++
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index cb031d8..5bf0ab0 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1612,14 +1612,9 @@ cleanup:
 const char *
 qemuFindQemuImgBinary(virQEMUDriverPtr driver)
 {
-    if (!driver->qemuImgBinary) {
-        driver->qemuImgBinary = virFindFileInPath("kvm-img");
-        if (!driver->qemuImgBinary)
-            driver->qemuImgBinary = virFindFileInPath("qemu-img");
-        if (!driver->qemuImgBinary)
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           "%s", _("unable to find kvm-img or qemu-img"));
-    }
+    if (!driver->qemuImgBinary)
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       "%s", _("unable to find kvm-img or qemu-img"));
 
     return driver->qemuImgBinary;
 }
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1644792..ed44b06 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -738,6 +738,9 @@ qemuStartup(bool privileged,
                  virStrerror(-rc, ebuf, sizeof(ebuf)));
     }
 
+    qemu_driver->qemuImgBinary = virFindFileInPath("kvm-img");
+    if (!qemu_driver->qemuImgBinary)
+        qemu_driver->qemuImgBinary = virFindFileInPath("qemu-img");
 
     if (!(qemu_driver->lockManager =
           virLockManagerPluginNew(cfg->lockManagerName ?
-- 
1.8.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]