From: "Daniel P. Berrange" <berrange(a)redhat.com>
---
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