On 9 February 2014 06:46, 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.
Ah, sorry, I hadn't spotted that. OK, then I think we should use that code (and I'll test the MacOS X version), but it should go in a called-once-from main init function that stashes the answer in a static variable, and then the 'get the path' function should just read that. Then we won't have to pass argv0 around more than we need to. thanks -- PMM