On Sun, Feb 9, 2014 at 2:46 PM, Paolo Bonzini <pbonz...@redhat.com> wrote: > Il 09/02/2014 01:18, Peter Maydell ha scritto: > >> Haven't checked it yet. I just don't really see what the point is >> in having a huge amount of OS specific code to do something >> which we already do in a portable way. It might be nice to abstract >> out stashing initial-argv0 and adding a utility function for it. >> >> If we do want to use OS-specific code, then we should be >> consistent, ie change the datadir lookup to use it. > > > It is using it already. argv[0] is just a fallback, and Fam's patches moved > the OS-specific code of os_find_datadir out of it so that module loading > could reuse it. > > I think there are cases where argv[0] cannot work, such as using the exec > system call to invoke QEMU, and specifying a different argv[0] than the > actually executed file; or invoking a non-installed QEMU executable by > putting its directory in the PATH. They are probably not happening in > practice, but they are there. >
Searching for module files in paths relative to executable is mostly used for convenience of developers. End users, ideally, should have the modules installed under $libdir. So, do we care about the corner cases of argv[0]? Fam