From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu3Ag-0005z3-AX for qemu-devel@nongnu.org; Mon, 09 Jun 2014 13:15:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wu3Aa-0005gn-An for qemu-devel@nongnu.org; Mon, 09 Jun 2014 13:15:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu3AZ-0005gR-Uu for qemu-devel@nongnu.org; Mon, 09 Jun 2014 13:15:40 -0400 Message-ID: <5395EBB3.6080804@redhat.com> Date: Mon, 09 Jun 2014 11:15:31 -0600 From: Eric Blake MIME-Version: 1.0 References: <66e17e32ccb10ca0ae262103fcf170b84511c3f8.1402299637.git.hutao@cn.fujitsu.com> <20140609143622.44fa7006@thinkpad> <5395AF7F.7000403@redhat.com> <20140609153257.49d4460f@thinkpad> <5395B968.6020300@redhat.com> In-Reply-To: <5395B968.6020300@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hueo2nXr2l7oXUMrsSc4wJGhQMJaOCAXj" Subject: Re: [Qemu-devel] [PATCH v4 28/29] qmp: add query-memdev List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Igor Mammedov Cc: Yasunori Goto , Hu Tao , qemu-devel@nongnu.org, Eduardo Habkost , "Michael S. Tsirkin" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hueo2nXr2l7oXUMrsSc4wJGhQMJaOCAXj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/09/2014 07:40 AM, Paolo Bonzini wrote: > Il 09/06/2014 15:32, Igor Mammedov ha scritto: >>>>>> > >> > +{ 'command': 'query-memdev', 'returns': ['Memdev'] } >>>> > > Could we make it union, that returns MemdevRam + MemdevFile >>>> > > >>>> > > MemdevFile will have additional file-only specific properties. >>>> > > >>> > >>> > Which are the file-only properties (in the current definition of >>> Memdev)? >> in current none, but for file backend exposing 'path' property might >> be useful >> alternatively instead of union we could add 'type' and optional 'path'= >> fields >> to Memdev >> >=20 > Yes, I agree. I think the latest additions to QAPI actually let you do= > that with a QAPI union while keeping backwards-compatible output for > other fields. Ok to do this later? It should be acceptable for soft > freeze. Correct, use of a discriminated union can add a new 'type' parameter, which in turn controls what other parameters are also present as a group, all within the same dictionary passed over the wire, so it is a back-compat friendly change to convert from a single struct to a QAPI union, and can be deferred to the point where you need such a change. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hueo2nXr2l7oXUMrsSc4wJGhQMJaOCAXj 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTleuzAAoJEKeha0olJ0Nq67kIAKel4kLG0Khp9+C+eLDdbyAR BVMIMD8vypCwI9sq29xrllYayDr86Ii2oxuthrb9FRfN0VMAlIuxAZKLgMO2FLhy IcwpLMOiVMJJlVTvVN3/6LttuJjCj13lrg+YrbDjCn4L+0VqVpPvthH/nxG7rgEP imcnVm0SKaQyaDZN/jV38Mafgc4NjsprWwbrnYrHe/502wUu6VeStt+7zRbnpF9U Z6rV+ceZ9/KRYztvTtmzVzjTPlzYIA2MovBoLSIT9/aDU0KW5KIHdDU7KIbvWDZk eBZ2yKKkvQJ7H0WAI+MtG45VrtjPyM/GyNOikfNoqFugIJcODtLgnHhAwKTGOoI= =HaVh -----END PGP SIGNATURE----- --hueo2nXr2l7oXUMrsSc4wJGhQMJaOCAXj--