qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/2] rbd: disable unsupported librbd functions a


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH 2/2] rbd: disable unsupported librbd functions at runtime
Date: Fri, 5 Apr 2013 11:31:24 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

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 via email to

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