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.
Paolo