qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, Fam Zheng <famz@redhat.com>
Cc: "Kevin Wolf" <kwolf@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Michael Tokarev" <mjt@tls.msk.ru>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Alex Bligh" <alex@alex.org.uk>,
	"Miroslav Rezanina" <mrezanin@redhat.com>,
	"Lluís Vilanova" <vilanova@ac.upc.edu>,
	"Richard Henderson" <rth@twiddle.net>
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	[thread overview]
Message-ID: <52F6BF85.8080504@redhat.com> (raw)
In-Reply-To: <CAFEAcA-Z49BNM=6o05ubxn6rOAVwC2q379wbda0HyMB+0h8Wcg@mail.gmail.com>

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

  reply	other threads:[~2014-02-08 23:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08  4:40 [Qemu-devel] [PATCH v19 11/11] module: Pass argv[0] along the module load path Fam Zheng
2014-02-08 14:12 ` Paolo Bonzini
2014-02-08 15:16   ` Fam Zheng
2014-02-08 17:16 ` Andreas Färber
2014-02-08 17:24   ` Alexander Graf
2014-02-08 17:46 ` Peter Maydell
2014-02-08 23:36   ` Paolo Bonzini [this message]
2014-02-09  0:18     ` Peter Maydell
2014-02-09  6:46       ` Paolo Bonzini
2014-02-09  9:16         ` Fam Zheng
2014-02-09 11:48         ` Peter Maydell
2014-02-09 12:13           ` Fam Zheng
2014-02-09  9:26     ` Fam Zheng
2014-02-09 10:00       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52F6BF85.8080504@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=alex@alex.org.uk \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=mrezanin@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=vilanova@ac.upc.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).