mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
Initialize qemuImageBinary path at startup
This commit is contained in:
parent
34589575bd
commit
0f5e3f136f
@ -177,7 +177,7 @@ struct _virQEMUDriver {
|
||||
/* Immutable pointer, self-locking APIs */
|
||||
virDomainObjListPtr domains;
|
||||
|
||||
/* Lazy-load on first use. Unsafe. XXX */
|
||||
/* Immutable pointer */
|
||||
char *qemuImgBinary;
|
||||
|
||||
/* Immutable pointer, lockless APIs. Pointless abstraction */
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 ?
|
||||
|
Loading…
Reference in New Issue
Block a user