mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +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 */
|
/* Immutable pointer, self-locking APIs */
|
||||||
virDomainObjListPtr domains;
|
virDomainObjListPtr domains;
|
||||||
|
|
||||||
/* Lazy-load on first use. Unsafe. XXX */
|
/* Immutable pointer */
|
||||||
char *qemuImgBinary;
|
char *qemuImgBinary;
|
||||||
|
|
||||||
/* Immutable pointer, lockless APIs. Pointless abstraction */
|
/* Immutable pointer, lockless APIs. Pointless abstraction */
|
||||||
|
@ -1612,14 +1612,9 @@ cleanup:
|
|||||||
const char *
|
const char *
|
||||||
qemuFindQemuImgBinary(virQEMUDriverPtr driver)
|
qemuFindQemuImgBinary(virQEMUDriverPtr driver)
|
||||||
{
|
{
|
||||||
if (!driver->qemuImgBinary) {
|
if (!driver->qemuImgBinary)
|
||||||
driver->qemuImgBinary = virFindFileInPath("kvm-img");
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
if (!driver->qemuImgBinary)
|
"%s", _("unable to find kvm-img or qemu-img"));
|
||||||
driver->qemuImgBinary = virFindFileInPath("qemu-img");
|
|
||||||
if (!driver->qemuImgBinary)
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
"%s", _("unable to find kvm-img or qemu-img"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return driver->qemuImgBinary;
|
return driver->qemuImgBinary;
|
||||||
}
|
}
|
||||||
|
@ -738,6 +738,9 @@ qemuStartup(bool privileged,
|
|||||||
virStrerror(-rc, ebuf, sizeof(ebuf)));
|
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 =
|
if (!(qemu_driver->lockManager =
|
||||||
virLockManagerPluginNew(cfg->lockManagerName ?
|
virLockManagerPluginNew(cfg->lockManagerName ?
|
||||||
|
Loading…
Reference in New Issue
Block a user