qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Josh Durgin <josh.durgin@inktank.com>
Subject: Re: [Qemu-devel] [PATCH v3 2/2] rbd: link and load librbd dynamically
Date: Thu, 11 Apr 2013 10:04:37 +0200	[thread overview]
Message-ID: <20130411080437.GC5253@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <5165D747.8010901@redhat.com>

On Wed, Apr 10, 2013 at 11:19:03PM +0200, Paolo Bonzini wrote:
> Il 10/04/2013 17:08, Anthony Liguori ha scritto:
> > /* This should not be used directly.  Use block_init etc. instead.  */
> > #ifdef CONFIG_MODULE
> > #define module_init(function, type)		   \
> > const gchar *g_module_check_init(GModule *module)  \
> > {				               	   \
> >     register_module_init(function, type);	   \
> >     return NULL;				   \
> > }
> > #else
> > #define module_init(function, type)                                         \
> > static void __attribute__((constructor)) do_qemu_init_ ## function(void) {  \
> >     register_module_init(function, type);                                   \
> > }
> > #endif
> 
> Not even that is needed.  Modules can have constructor functions that
> use symbols in the main executable.
> 
> Basically, modules would be opened with G_MODULE_BIND_LOCAL and
> communicate with QEMU via constructor functions only (registering driver
> modules or QOM types).
> 
> It is really more of a build-system hacking project than anything else.

Great.  So it seems like we just need a function early in QEMU startup
that enumerates all shared libraries in QEMU_MODULE_PATH and opens them
with G_MODULE_BIND_LOCAL.

Perhaps in the future we'll load modules on-demand to avoid reduce
footprint, but for now we can just load all of them just like you get
when you build a QEMU binary with everything included.

Stefan

  reply	other threads:[~2013-04-11  8:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-29  7:59 [Qemu-devel] [PATCH] rbd: add an asynchronous flush Josh Durgin
2013-03-29 20:03 ` [Qemu-devel] [PATCH v2] " Josh Durgin
2013-04-02 14:10   ` Kevin Wolf
2013-04-04  8:35     ` [Qemu-devel] [PATCH v3 1/2] " Josh Durgin
2013-04-04  8:35     ` [Qemu-devel] [PATCH 2/2] rbd: disable unsupported librbd functions at runtime Josh Durgin
2013-04-04 10:10       ` Kevin Wolf
2013-04-04 16:50         ` Josh Durgin
2013-04-05  9:31           ` Kevin Wolf
2013-04-10  0:05             ` [Qemu-devel] [PATCH v3 2/2] rbd: link and load librbd dynamically Josh Durgin
2013-04-10  8:09               ` Stefan Hajnoczi
2013-04-10 14:52                 ` [Qemu-devel] runtime Block driver modules (was Re: [PATCH v3 2/2] rbd: link and load librbd dynamically) Josh Durgin
2013-04-10 15:08                 ` [Qemu-devel] [PATCH v3 2/2] rbd: link and load librbd dynamically Anthony Liguori
2013-04-10 21:19                   ` Paolo Bonzini
2013-04-11  8:04                     ` Stefan Hajnoczi [this message]
2013-04-11  7:59                   ` Stefan Hajnoczi
2013-06-21 18:42                   ` Sage Weil
2013-06-21 19:08                     ` Alex Bligh
2013-06-21 19:13                     ` Anthony Liguori
2013-04-10 14:03     ` [Qemu-devel] [PATCH v2] rbd: add an asynchronous flush Josh Durgin
2013-04-11  8:02       ` Stefan Hajnoczi
2013-04-11  8:48         ` Kevin Wolf
2013-04-11 17:19           ` Josh Durgin
2013-04-12  6:50             ` Kevin Wolf
2013-04-12  7:42               ` Stefan Hajnoczi

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=20130411080437.GC5253@stefanha-thinkpad.redhat.com \
    --to=stefanha@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=josh.durgin@inktank.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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).