From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQHFc-0006cK-2G for qemu-devel@nongnu.org; Thu, 11 Apr 2013 09:09:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQHFV-0005mj-QK for qemu-devel@nongnu.org; Thu, 11 Apr 2013 09:09:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQHFV-0005mV-C1 for qemu-devel@nongnu.org; Thu, 11 Apr 2013 09:09:09 -0400 Message-ID: <5166B5D9.1010906@redhat.com> Date: Thu, 11 Apr 2013 07:08:41 -0600 From: Eric Blake MIME-Version: 1.0 References: <1364903250-10429-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1364903250-10429-10-git-send-email-xiawenc@linux.vnet.ibm.com> <878v4qxu1z.fsf@blackfin.pond.sub.org> <5166521E.8060201@linux.vnet.ibm.com> <87bo9lfes4.fsf@blackfin.pond.sub.org> <20130411084401.47405e80@redhat.com> In-Reply-To: <20130411084401.47405e80@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2TENWBGBDONRDMADKVQLC" Subject: Re: [Qemu-devel] [PATCH V11 09/17] qmp: add interface query-snapshots List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: kwolf@redhat.com, stefanha@gmail.com, Markus Armbruster , qemu-devel@nongnu.org, pbonzini@redhat.com, Wenchao Xia This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TENWBGBDONRDMADKVQLC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/11/2013 06:44 AM, Luiz Capitulino wrote: >>>>> +-> { "execute": "query-snapshots" } >>>>> +<- { >>>>> + "return":[ >>>>> + { >>>>> + "id": "1", >>>>> + "name": "snapshot1", >>>>> + "vm-state-size": 0, >>>>> + "date-sec": 10000200, >>>>> + "date-nsec": 12, >>>>> + "vm-clock-sec": 206, >>>>> + "vm-clock-nsec": 30 >>>> >>>> Not your patch's fault, but here goes anyway: I dislike this >>>> representation of time. >>>> >>>> QMP has time in seconds, milliseconds, nanoseconds, (seconds, > Are you saying you're going to drop vm-clock-sec? >=20 >> Before you do that, let's get Luiz's blessing. >=20 > Fine with me if I got it right. Problem. Let's go back to the original definition that we are talking about modifying: +# +# Since: 1.5 +## +{ 'command': 'query-snapshots', + 'returns': ['SnapshotInfo'] } + Now let's look for that type: # @vm-clock-sec: VM clock relative to boot in seconds # # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec # # Since: 1.3 # ## { 'type': 'SnapshotInfo', 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int', 'date-sec': 'int', 'date-nsec': 'int', 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } } And that type is already used in 'ImageInfo'. In other words, we're stuck. We've already cemented the mistake. You _can't_ drop vm-clock-sec, without breaking the behavior of management apps written against the 1.3 interface when dealing with ImageInfo. If you want to avoid a (sec/nsec) pair, you would have to invent a new type instead of reusing the already-existing SnapshotInfo. Hmm, as I typed that, I did another search of qemu-schema.json - we have the type 'ImageInfo' defined, but none of the existing 'command's ever call out the use of that type. Is it a type we are only using internally to date, and where this is the first QMP command that would actually expose SnapshotInfo or ImageInfo to a management app? Then maybe we _CAN_ modify SnapshotInfo, clean up all the internal code, and provide a saner type for the first time that QMP can actually use it. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2TENWBGBDONRDMADKVQLC 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.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRZrXZAAoJEKeha0olJ0NqBDcH+wcNa6VDwH7CVKfFQjjFn1sY 5rYwOz8iqfJuZsTysfDO+zAp678JQdJcrnhDvTgY7sduAlwedZJg9aIfyY/I/gWG sNtU3I0wQ+eOvY2SODFhaH5X/y9dCrI0mgO83syxTsClYMnYJ/J4aGiZBZ2G0kTd r8ZX4k+S2BbjVs+otxjR7Xnr4+s+EOln5ydUXAyMyEc1PgjmLNuzlP9VqNcpBXvn cZNXlXRXf11jBJzIa5JTt6rV+h53qSOoSy6uUc49v3P0AMQ0J8dfD3zl5ydiaFZE zXEV21W4b5LX9bPy31LSherPTCJp6ivGe/FdDice+HYRIBp3PcNOrtHi8DLMUcU= =lWU4 -----END PGP SIGNATURE----- ------enig2TENWBGBDONRDMADKVQLC--