From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpbzY-0002oG-R7 for qemu-devel@nongnu.org; Fri, 13 Jul 2012 05:16:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SpbzS-00089O-Rs for qemu-devel@nongnu.org; Fri, 13 Jul 2012 05:16:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpbzS-00089J-K7 for qemu-devel@nongnu.org; Fri, 13 Jul 2012 05:16:46 -0400 Date: Fri, 13 Jul 2012 10:16:40 +0100 From: "Daniel P. Berrange" Message-ID: <20120713091640.GD2317@redhat.com> References: <4FFA9C30.2070201@linux.vnet.ibm.com> <20120709092705.GG16198@redhat.com> <4FFBBF8C.8080708@linux.vnet.ibm.com> <4FFBD729.8000309@redhat.com> <20120713091247.GA15503@stefanha-thinkpad.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20120713091247.GA15503@stefanha-thinkpad.localdomain> Subject: Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , Anthony Liguori , Wenchao Xia , qemu-devel@nongnu.org On Fri, Jul 13, 2012 at 10:12:47AM +0100, Stefan Hajnoczi wrote: > On Tue, Jul 10, 2012 at 09:18:01AM +0200, Paolo Bonzini wrote: > > Il 10/07/2012 07:37, Wenchao Xia ha scritto: > > >> > > >> For getting the other metadata about the disk image you mention, another > > >> possibility to is just make 'qemu-img info' return the data in a machine > > >> parseable format, ie JSON& make a client API for extracting data from > > >> this JSON document. > > >> > > > Thank u for the idea. The .so is introduced to let program access the > > > image more directly, parsing string is not so fast and it depends on > > > another program's stdout output, I hope to get a faster way. > > > > I doubt you actually have profiled it. > > I think speed is not the issue, instead it's just providing an API that > external programs can use. Management tools, backup software, custom > administration tools, etc. It's convenient to have an API. Actually I think speed could well be quite relevant. In large deployments it would not be surpising to see 1000's of images in a directory. If you want to be able to query metadata about all of them at once, then being able to open()+read(4k)+close() 1000 times is going to be dramatically faster than doing fork()+execve(qemu-img) 1000 times. NB, I still think qemu-img info should be able to return a JSON parsable data format, regardless of what any block library does. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|