|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH v19 11/11] module: Pass argv[0] along the module load path |
Date: | Sun, 09 Feb 2014 00:36:37 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
Il 08/02/2014 18:46, Peter Maydell ha scritto:
This adds parameter "argv0" in calling path from main() to > module_call_init(). So that module loader knows the location of > executable.This patch looks kind of odd to me. Why are there so many different places calling module_call_init() and passing in an argv0? I would have expected that vl.c (and the equivalent main functions for the tools) would just initialise the module system once, passing in the argv0 at that point.
I'm ambivalent about this.
It's not obvious why the block layer should be handing argv0 around through bdrv_init in order to (re-?) initialise modules.
The executable directory is not found once and for all, it's recomputed on any call to module_load or os_find_datadir.
But I think this is pointless anyway. The OS knows the executable file name, and the right thing to do is to extend support for finding the executable to all supported OSes. It's a pity that glib doesn't have a function anyway.
Peter, does the patch using the Apple-specific function to find the executable work?
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |