On 13 September 2012 21:12, Jason Baron <jba...@redhat.com> wrote: > If -L <dir> is specified, and qemu does not find the bios file in <dir>, then > the search fails. Add infrastructure such that the search will continue in > the default paths, if not found in the -L path.
> @@ -1872,12 +1873,15 @@ static int balloon_parse(const char *arg) > return -1; > } > > -char *qemu_find_file(int type, const char *name) > +static char *__qemu_find_file(int type, const char *name, const char *dir) > { > int len; > const char *subdir; > char *buf; > > + if (!dir) > + return NULL; > + > /* Try the name as a straight path first */ > if (access(name, R_OK) == 0) { > return g_strdup(name); This means that every try with a different directory will check the name as a straight path again, which is a bit pointless. The "just try the name" code shouldn't be in this function (which as Paolo suggests should be named qemu_find_file_in_dir()), it should be pulled out into your new qemu_find_file(), which will then look like: * try as plain pathname * try in directory 1 * try in directory 2 -- PMM