From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFbrv-0002oK-5O for qemu-devel@nongnu.org; Tue, 12 Mar 2013 22:56:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFbrs-0007HT-M0 for qemu-devel@nongnu.org; Tue, 12 Mar 2013 22:56:43 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:41460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFbrs-0007Gg-5e for qemu-devel@nongnu.org; Tue, 12 Mar 2013 22:56:40 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Mar 2013 08:23:06 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 281F6125804E for ; Wed, 13 Mar 2013 08:27:32 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r2D2uOoX27983878 for ; Wed, 13 Mar 2013 08:26:24 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r2D2uSS3005316 for ; Wed, 13 Mar 2013 02:56:28 GMT Message-ID: <513FEA7A.7000102@linux.vnet.ibm.com> Date: Wed, 13 Mar 2013 10:54:50 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1363000996-13221-1-git-send-email-xiawenc@linux.vnet.ibm.com> <20130312100754.GC19624@stefanha-thinkpad.redhat.com> <513F54EE.1050205@redhat.com> In-Reply-To: <513F54EE.1050205@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V9 00/14] qmp/hmp interfaces for internal snapshot info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, Stefan Hajnoczi , qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com, armbru@redhat.com 于 2013-3-13 0:16, Eric Blake 写道: > On 03/12/2013 04:07 AM, Stefan Hajnoczi wrote: >> On Mon, Mar 11, 2013 at 07:23:02PM +0800, Wenchao Xia wrote: >>> In the use of snapshot a way to retrieve related info at runtime is needed, >>> so this serial of patches will merge some code for qemu and qemu-img, and add >>> following interfaces for qemu: >>> > >> Is there a reason you added the new query-images command instead of >> extending BlockDeviceInfo with an ImageInfo field? Then query-block, >> which is already used today, just provides ImageInfo as well. >> >> I suggest this because it makes life easier for clients - they can issue >> a single command to extract all image information. If we have two >> commands they may have to invoke both and then match the results >> together. > > Indeed, from the libvirt perspective, I would much prefer that a single > command gives me everything, instead of having to call two commands to > build up the complete picture. > I have no special reason for new interface query-images, it just show up during the work, and I am pretty OK to merge the information into query-block especially when the user of it, Eric hope so. Then the qmp interface need to designed carefully, my idea is adding an item in BlockDeviceInfo: { 'type': 'BlockDeviceInfo', 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str', '*backing_file': 'str', 'backing_file_depth': 'int', 'encrypted': 'bool', 'encryption_key_missing': 'bool', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int', 'images': ['ImageInfo']} }} In this way, new define of structure is not needed, and no break of API I guess, but disadvantage is there will be some duplicated info in ImageInfo and other structure in BlockInfo, such as "file, encrypted". -- Best Regards Wenchao Xia