From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Spbz3-00026l-Jr for qemu-devel@nongnu.org; Fri, 13 Jul 2012 05:16:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Spbyy-00086g-9e for qemu-devel@nongnu.org; Fri, 13 Jul 2012 05:16:21 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:49039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Spbyy-00086U-18 for qemu-devel@nongnu.org; Fri, 13 Jul 2012 05:16:16 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Jul 2012 10:16:14 +0100 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6D9GCGE2736156 for ; Fri, 13 Jul 2012 10:16:12 +0100 Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6D9GB7B016376 for ; Fri, 13 Jul 2012 03:16:12 -0600 Date: Fri, 13 Jul 2012 10:16:11 +0100 From: Stefan Hajnoczi Message-ID: <20120713091611.GC15503@stefanha-thinkpad.localdomain> References: <4FFA9C30.2070201@linux.vnet.ibm.com> <4FFAA0C3.3080703@redhat.com> <4FFBB7FB.3070303@linux.vnet.ibm.com> <4FFBD6F1.90403@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4FFBD6F1.90403@redhat.com> Subject: Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Anthony Liguori , Wenchao Xia , qemu-devel@nongnu.org On Tue, Jul 10, 2012 at 09:17:05AM +0200, Paolo Bonzini wrote: > Il 10/07/2012 07:04, Wenchao Xia ha scritto: > > 于 2012-7-9 17:13, Paolo Bonzini 写道: > >> Il 09/07/2012 10:54, Wenchao Xia ha scritto: > >>> Following is my implementing plan draft: > >>> 1 introduce libqblock.so in sub directory in qemu. > >>> 2 write a nbd client in libqblock, similar to qemu nbd client. Then > >>> use it to talk with nbd server, by default is qemu-nbd, to get access > >>> to images. In this way, libqblock.so could be friendly LGPL licensed. > >> > >> Did you actually assess the license situation of the block layer? > >> block.c and large parts of block/* are under a BSD license, for example. > >> If the library only has to support raw files, it might do so using > >> synchronous I/O only. This would remove a large body of GPL-licensed code. > >> > > If the library was built as nbd-client communicating with nbd-server, > > which then employ the BSO licensed code, could the library ignore the > > server side's license problem? > > Yes, but if your first worry is the legal problem you are doomed to > design an awful library. > > > The reason using nbd-client approach are: > > work around qemu block layer license issue and easy to implement > > "Working around the QEMU block layer license" is not a goal per se, > especially because you haven't a) assessed _what_ is the GPL code that > the library would use; b) told us why the library should not be under > the GPL. > > Please design first according to the functionality you want to > implement, then think about the implementation. Licensing is one headache but the real challenge is that the QEMU block layer relies on the QEMU main loop and a bunch of other architecture. Using NBD allows us to focus on the library API instead worrying about untangling the block layer. If the library becomes useful it may be worth fully moving the block layer code over into the library. I think it makes sense to hammer out the library first before going down a long road of internal QEMU refactoring before we know whether the library will take off. Stefan