From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrH09-0000Ud-A7 for qemu-devel@nongnu.org; Fri, 04 Jan 2013 18:48:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TrH08-0002ry-4V for qemu-devel@nongnu.org; Fri, 04 Jan 2013 18:48:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:18100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TrH07-0002ro-So for qemu-devel@nongnu.org; Fri, 04 Jan 2013 18:48:36 -0500 Message-ID: <50E76A4E.9020706@redhat.com> Date: Fri, 04 Jan 2013 16:48:30 -0700 From: Eric Blake MIME-Version: 1.0 References: <1356770725-4804-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1356770725-4804-7-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1356770725-4804-7-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig575CD6D94E10C68D0A47ADCA" Subject: Re: [Qemu-devel] [PATCH 06/11] qmp: add interface query-image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, aliguori@us.ibm.com, phrdina@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig575CD6D94E10C68D0A47ADCA Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/29/2012 01:45 AM, Wenchao Xia wrote: > This mirror function will return all image info including > snapshots. Now Qemu have both query-image and query-block > interfaces, and qemu-img share the code for image info > retrieving with qemu emulator. >=20 > Signed-off-by: Wenchao Xia > --- > block.c | 16 ++++++++++++++++ > qapi-schema.json | 11 +++++++++++ > 2 files changed, 27 insertions(+), 0 deletions(-) Should there be a counterpart change to qmp-commands.hx, demonstrating the type of output expected? > =20 > ## > +# @query-image: > +# > +# Get a list of BlockImage for all virtual block devices. > +# > +# Returns: a list of @BlockImage describing each virtual block device Here, you use BlockImage twice, > +# > +# Since: 1.4 > +## > +{ 'command': 'query-image', 'returns': ['ImageInfo'] } but here, the type is named ImageInfo. This interface is weak - it tells me a list of filenames that are in use, but doesn't tell me which element of the array is tied to which devi= ce. Also, this command is singular, but returns a plural listing; elsewhere, we have used plurals (think query-commands). I'd rather see something like: { 'type': 'DeviceImageInfo', 'data': {'device': 'str', 'info': 'ImageInfo' } } { 'command': 'query-images', 'returns': ['DeviceImageInfo'] } so that I can get the pairings between [{ 'device':'virtio0', 'info':{ 'filename':'/path1', ...} }, { 'device':'virtio1', 'info':{ 'filename':'/path2', ...} }] --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig575CD6D94E10C68D0A47ADCA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with undefined - http://www.enigmail.net/ iQEcBAEBCAAGBQJQ52pOAAoJEKeha0olJ0NqKh0H/i8f7MFp6kadh+FCCBCvFWPL 1WgfQVP3KunjHxaNXeYWrLKRtJFd+4JGmTLWCDx4l7HAcPtfp7+QXRHkfuVX2zq1 1ojNHgWfUkuKPyGcOrK754hE3tmbiAPw/R/WUpdBF8Ui1K+8OrZmAyXnNtYLKDyD w/5f7u9OBWu9WJHERaaiEkknTc8UuuCovEDAlJ445naMykzxahGfJgrzE6bB3q7k S1bmtJ76pLwb3dqUTlhpP+byfQ4seAYXZW/DMHJec+eKqwmYjrK9NYaJ4eIWBW0Z EtHBDzu0i7uV6B5wEvDYPUK/vsZ7sPaDnQyWXdwY1BsiBqbX5bbDOjJcPK3XMO4= =aOwo -----END PGP SIGNATURE----- --------------enig575CD6D94E10C68D0A47ADCA--