From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQUcq-0005Op-EF for qemu-devel@nongnu.org; Thu, 11 Apr 2013 23:26:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQUcp-0002fm-4m for qemu-devel@nongnu.org; Thu, 11 Apr 2013 23:26:08 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:54308) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQUco-0002Za-Dv for qemu-devel@nongnu.org; Thu, 11 Apr 2013 23:26:07 -0400 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 12 Apr 2013 08:51:12 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp02.in.ibm.com (Postfix) with ESMTP id 836D3394005B for ; Fri, 12 Apr 2013 08:55:57 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3C3Pobl61866080 for ; Fri, 12 Apr 2013 08:55:51 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3C3Pqc0024527 for ; Fri, 12 Apr 2013 13:25:53 +1000 Message-ID: <51677EAE.4010801@linux.vnet.ibm.com> Date: Fri, 12 Apr 2013 11:25:34 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1364903250-10429-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1364903250-10429-12-git-send-email-xiawenc@linux.vnet.ibm.com> <20130408133354.GB4429@stefanha-thinkpad.redhat.com> <87wqsawebj.fsf@blackfin.pond.sub.org> <20130410145718.6c7683a9@redhat.com> <5166573C.1030506@linux.vnet.ibm.com> <87ip3tjtwe.fsf@blackfin.pond.sub.org> In-Reply-To: <87ip3tjtwe.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V11 11/17] qmp: add ImageInfo in BlockDeviceInfo used by query-block List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: kwolf@redhat.com, Stefan Hajnoczi , pbonzini@redhat.com, qemu-devel@nongnu.org, Luiz Capitulino 于 2013-4-11 17:31, Markus Armbruster 写道: > Wenchao Xia writes: > >> 于 2013-4-11 2:57, Luiz Capitulino 写道: >>> On Wed, 10 Apr 2013 18:17:04 +0200 >>> Markus Armbruster wrote: >>> >>>> Stefan Hajnoczi writes: >>>> >>>>> On Tue, Apr 02, 2013 at 07:47:24PM +0800, Wenchao Xia wrote: >>>>>> diff --git a/qmp-commands.hx b/qmp-commands.hx >>>>>> index 6b20684..b856be7 100644 >>>>>> --- a/qmp-commands.hx >>>>>> +++ b/qmp-commands.hx >>>>>> @@ -1703,6 +1703,47 @@ Each json-object contain the following: >>>>>> - "iops": limit total I/O operations per second (json-int) >>>>>> - "iops_rd": limit read operations per second (json-int) >>>>>> - "iops_wr": limit write operations per second (json-int) >>>>>> + - "image": the detail of the image, it is a json-object >>>>>> containing >>>>>> + the following: >>>>>> + - "filename": image file name (json-string) >>>>>> + - "format": image format (json-string) >>>>>> + - "virtual-size": image capacity in bytes (json-int) >>>>>> + - "dirty-flag": true if image is not cleanly closed, not >>>>>> present >>>>>> + means clean (json-bool, optional) >>>>>> + - "actual-size": actual size on disk in bytes of the image, not >>>>>> + present when image does not support thin >>>>>> + provision (json-int, optional) >>>>>> + - "cluster-size": size of a cluster in bytes, not present if image >>>>>> + format does not support it (json-int, optional) >>>>>> + - "encrypted": true if the image is encrypted, not present >>>>>> means >>>>>> + false or the image format does not support >>>>>> + encryption (json-bool, optional) >>>>>> + - "backing_file": backing file name, not present means no backing >>>>>> + file is used or the image format does not >>>>>> + support backing file chain >>>>>> + (json-string, optional) >>>>>> + - "full-backing-filename": full path of the backing file, not >>>>>> + present if it equals backing_file or no >>>>>> + backing file is used >>>>>> + (json-string, optional) >>>>>> + - "backing-filename-format": the format of the backing file, >>>>>> not >>>>>> + present means unknown or no backing >>>>>> + file (json-string, optional) >>>>>> + - "snapshots": the internal snapshot info, it is an optional list >>>>>> + of json-object containing the following: >>>>>> + - "id": unique snapshot id (json-string) >>>>>> + - "name": snapshot name (json-string) >>>>>> + - "vm-state-size": size of the VM state in bytes (json-int) >>>>>> + - "date-sec": UTC date of the snapshot in seconds (json-int) >>>>>> + - "date-nsec": fractional part in nanoseconds to be used with >>>>>> + date-sec(json-int) >>>>>> + - "vm-clock-sec": VM clock relative to boot in seconds >>>>>> + (json-int) >>>>>> + - "vm-clock-nsec": fractional part in nanoseconds to be used >>>>>> + with vm-clock-sec (json-int) >>>>>> + - "backing-image": the detail of the backing image, it is an >>>>>> + optional json-object only present when a >>>>>> + backing image present for this image >>>>> >>>>> Please don't duplicate the ImageInfo documentation from >>>>> qapi-schema.json. >>>> >>>> No, this is actually how it still needs to be done. >>>> >>>> qmp-commands.hx predates qapi-schema.json. We still generate >>>> QMP/qmp-commands.txt from qmp-commands.hx, not from qapi-schema.json. >>> >>> Unfortunately, yes. However, as there are just a few commands missing >>> to be converted to the qapi, we could start generating the docs from >>> qapi-schema.json and avoid the duplication. >>> >>> There's a problem though. qapi-schema.json is not tied to the QMP protocol >>> as qmp-commands.hx is, so I'm not sure it's a good place for the examples, >> I agree that example should not get mixed with qapi-schema.json, which >> faces developer instead of user. Personally I think a standalone example >> file is better(only call in and out, no text for the structure defines). > > How do we ensure the examples stay up-to-date? > > Crazy idea: generate them as part of "make check". > > [...] > Generate example from qapi-schema.json is cool, maybe do it in "make". -- Best Regards Wenchao Xia