qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Josh Durgin <josh.durgin@inktank.com>
Cc: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] rbd: disable unsupported librbd functions at runtime
Date: Fri, 5 Apr 2013 11:31:24 +0200	[thread overview]
Message-ID: <20130405093124.GA2351@dhcp-200-207.str.redhat.com> (raw)
In-Reply-To: <515DAF4F.7000009@inktank.com>

Am 04.04.2013 um 18:50 hat Josh Durgin geschrieben:
> On 04/04/2013 03:10 AM, Kevin Wolf wrote:
> >After searching the net a bit and trying out some things myself, I'm
> >afraid that this approach doesn't work. It does seem to do the right
> >thing when build and runtime version are the same, but new build -> old
> >runtime segfaults (because the symbol doesn't become NULL) and old build
> >-> new runtime segfaults (because the symbol stays NULL). Unless I
> >missed some build option that is different in qemu than in my test
> >program.
> 
> It worked when downgrading the runtime version of librbd for me, so
> maybe something about qemu's build was different. This patch wouldn't
> allow newer functions in a runtime version to be used though, since
> they would be disabled if qemu were built against an older version.

Interesting that one way worked for you. At least it seems to be
unreliable, unfortunately.

> >So it looks as if you had to use dlsym() instead.
> 
> I tried this initially, using glib's portable wrappers, but found that
> it would require using the dlopen'd version only - not linking at
> build time against librbd at all. I thought this might be too big
> a change, but now it seems like the best way to go.

Aw, I didn't expect that... You're using g_module_open/symbol then? I
never used it, but from reading the docs maybe g_module_open with a NULL
filename might do the right thing when linked at build time?

On the other hand, not linking at build time at all and relying on
dlopen() only give us another nice feature: Distros can enable the rbd
block driver without introducing a hard dependency of qemu on librbd.
Maybe worth doing it for this reason alone.

> Using this approach, upgrading from a version of librbd that doesn't
> support e.g. rbd_aio_flush to one that does would not require
> recompiling qemu to be able to use the new function. In general, librbd
> would not be needed at compile time for qemu to be able to use it,
> which would make the rbd block driver much easier to install on
> distros where rbd isn't enabled at build time.
> 
> If you don't mind this approach, I'll post another version using
> only dlopen'd (via glib) librbd/librados.

Sure, if you don't mind implementing it I think it's a good idea. I
didn't mean to ask you for such a large change with my innocent
comments...

Kevin

  reply	other threads:[~2013-04-05  9:31 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 [this message]
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
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=20130405093124.GA2351@dhcp-200-207.str.redhat.com \
    --to=kwolf@redhat.com \
    --cc=josh.durgin@inktank.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).