The virFileFindResource method merely builds up the expected fully
qualified path to the resource. It does not actually check if it exists
on disk. The loadable module callers were mistakenly thinking a NULL
indicates the file doesn't exist on disk, whereas it in fact indicates
an out of memory error.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
abs_topbuilddir "/src/.libs",
DEFAULT_DRIVER_DIR,
"LIBVIRT_DRIVER_DIR")))
- return 1;
+ return -1;
ret = virDriverLoadModuleFull(modfile, regfunc);
abs_topbuilddir "/src/.libs",
STORAGE_BACKEND_MODULE_DIR,
"LIBVIRT_STORAGE_BACKEND_DIR")))
- return 1;
+ return -1;
if ((ret = virDriverLoadModuleFull(modfile, regfunc)) != 0) {
if (forceload) {
* run from the source tree. Otherwise it will return the
* path in the installed location.
*
+ * Note that this function does not actually check whether
+ * the file exists on disk, it merely builds the fully
+ * qualified path where it is supposed to exist.
+ *
* If @envname is non-NULL it will override all other
* directory lookup.
*