From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: "Daniel P. Berrange" <berrange@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API
Date: Mon, 16 Jul 2012 15:48:40 +0800 [thread overview]
Message-ID: <5003C758.8020502@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120713091640.GD2317@redhat.com>
> 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.
>
I tried to avoid fork() and execv() in the library as much as
possible. Dealing with another program's string output will cost quite
some codes about its timeout or exception error, more "native" code
seems better to me.
> NB, I still think qemu-img info should be able to return a JSON parsable
> data format, regardless of what any block library does.
An option to qemu-img to specify output format may be a good way.
>
> Daniel
>
--
Best Regards
Wenchao Xia
next prev parent reply other threads:[~2012-07-16 7:48 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-09 8:54 [Qemu-devel] [RFC] introduce a dynamic library to expose qemu block API Wenchao Xia
2012-07-09 9:13 ` Paolo Bonzini
2012-07-10 5:04 ` Wenchao Xia
2012-07-10 7:17 ` Paolo Bonzini
2012-07-13 9:16 ` Stefan Hajnoczi
2012-07-13 9:51 ` Paolo Bonzini
2012-07-13 11:33 ` Paolo Bonzini
2012-07-13 15:03 ` Michael Tokarev
2012-07-13 15:17 ` Blue Swirl
2012-07-13 17:07 ` Stefan Weil
2012-07-13 22:55 ` Lluís Vilanova
2012-07-16 10:39 ` Stefan Hajnoczi
2012-07-23 11:55 ` Lluís Vilanova
2012-07-23 12:09 ` Paolo Bonzini
2012-07-24 9:33 ` Lluís Vilanova
2012-07-16 8:16 ` Wenchao Xia
2012-07-16 8:19 ` Paolo Bonzini
2012-07-18 8:51 ` Wenchao Xia
2012-07-18 9:03 ` Paolo Bonzini
2012-07-18 15:28 ` Kevin Wolf
2012-07-18 9:41 ` Stefan Hajnoczi
2012-07-18 10:42 ` Paolo Bonzini
2012-07-18 12:50 ` Stefan Hajnoczi
2012-07-18 13:51 ` Andreas Färber
2012-07-18 13:55 ` Kevin Wolf
2012-07-18 13:58 ` Daniel P. Berrange
2012-07-18 14:02 ` Paolo Bonzini
2012-07-18 14:12 ` Daniel P. Berrange
2012-07-18 15:23 ` Kevin Wolf
2012-07-18 15:35 ` Daniel P. Berrange
2012-07-19 11:37 ` Paolo Bonzini
2012-07-20 11:38 ` Daniel P. Berrange
2012-07-20 11:53 ` Paolo Bonzini
2012-07-23 18:15 ` Blue Swirl
2012-07-25 8:08 ` Wenchao Xia
2012-07-09 9:27 ` Daniel P. Berrange
2012-07-10 5:37 ` Wenchao Xia
2012-07-10 7:18 ` Paolo Bonzini
2012-07-13 9:12 ` Stefan Hajnoczi
2012-07-13 9:16 ` Daniel P. Berrange
2012-07-13 9:47 ` Stefan Hajnoczi
2012-07-16 7:48 ` Wenchao Xia [this message]
2012-07-09 14:36 ` Christoph Hellwig
2012-07-10 5:42 ` Wenchao Xia
2012-07-13 9:13 ` Stefan Hajnoczi
2012-07-13 9:27 ` Christoph Hellwig
2012-07-13 9:43 ` Stefan Hajnoczi
2012-07-13 10:42 ` Kevin Wolf
2012-07-13 10:55 ` Christoph Hellwig
2012-07-13 11:19 ` Kevin Wolf
2012-07-16 7:55 ` Wenchao Xia
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=5003C758.8020502@linux.vnet.ibm.com \
--to=xiawenc@linux.vnet.ibm.com \
--cc=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).