qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v19 11/11] module: Pass argv[0] along the module


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v19 11/11] module: Pass argv[0] along the module load path
Date: Sun, 9 Feb 2014 11:48:10 +0000

On 9 February 2014 06:46, Paolo Bonzini <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]