From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO2zd-000053-DD for qemu-devel@nongnu.org; Fri, 05 Apr 2013 05:31:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UO2zY-00070l-HN for qemu-devel@nongnu.org; Fri, 05 Apr 2013 05:31:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO2zY-00070a-9K for qemu-devel@nongnu.org; Fri, 05 Apr 2013 05:31:28 -0400 Date: Fri, 5 Apr 2013 11:31:24 +0200 From: Kevin Wolf Message-ID: <20130405093124.GA2351@dhcp-200-207.str.redhat.com> References: <20130402141042.GL2341@dhcp-200-207.str.redhat.com> <1365064515-23222-2-git-send-email-josh.durgin@inktank.com> <20130404101033.GD3060@dhcp-200-207.str.redhat.com> <515DAF4F.7000009@inktank.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <515DAF4F.7000009@inktank.com> Subject: Re: [Qemu-devel] [PATCH 2/2] rbd: disable unsupported librbd functions at runtime List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Josh Durgin Cc: qemu-devel@nongnu.org, Stefan Hajnoczi 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