From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vlgzi-0006Fn-Ti for qemu-devel@nongnu.org; Wed, 27 Nov 2013 10:25:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vlgzd-0002vn-Ie for qemu-devel@nongnu.org; Wed, 27 Nov 2013 10:25:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vlgzd-0002va-0y for qemu-devel@nongnu.org; Wed, 27 Nov 2013 10:25:33 -0500 Message-ID: <52960EE2.9010201@redhat.com> Date: Wed, 27 Nov 2013 08:25:22 -0700 From: Eric Blake MIME-Version: 1.0 References: <1385001528-12003-1-git-send-email-imammedo@redhat.com> <1385001528-12003-8-git-send-email-imammedo@redhat.com> In-Reply-To: <1385001528-12003-8-git-send-email-imammedo@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hlkV33m38Lq79qLH6W3qIvioihgeW9MeE" Subject: Re: [Qemu-devel] [PATCH 07/27] add memdev backend infrastructure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, stefanha@redhat.com, stefanb@linux.vnet.ibm.com, hutao@cn.fujitsu.com, mst@redhat.com, mjt@tls.msk.ru, mdroth@linux.vnet.ibm.com, armbru@redhat.com, vasilis.liaskovitis@profitbricks.com, quintela@redhat.com, kraxel@redhat.com, aliguori@amazon.com, pbonzini@redhat.com, marcel.a@redhat.com, lcapitulino@redhat.com, chegu_vinod@hp.com, afaerber@suse.de This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --hlkV33m38Lq79qLH6W3qIvioihgeW9MeE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11/20/2013 07:38 PM, Igor Mammedov wrote: > Provides framework for splitting host RAM allocation/ > policies into a separate backend that could be used > by devices. It would allow to separate host specific > options from device model like it's done for netdev & co. Just an interface review: > +++ b/hmp-commands.hx > @@ -1719,3 +1719,16 @@ ETEXI > STEXI > @end table > ETEXI > + > + { > + .name =3D "memdev-add", Typically, we've been naming HMP commands with underscore: memdev_add > +++ b/qapi-schema.json > @@ -4212,3 +4212,21 @@ > # Since: 1.7 > ## > { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } = } > + > +## > +# @memdev_add: Whereas QMP commands have a dash: memdev-add > +# > +# Add a host memory backend. > +# > +# @id: the name of the new memory backend > +# @size: amount of memory backend should allocate Maybe add "in bytes" somewhere in the phrase to make it clear > +# @type: backend type. [default: compat-ram-host-memory] That's the default, but what other types are valid? I'd much rather have an enum of valid types than an open-coded string. > +# > +# Since: 1.8 > +# > +# Returns: Nothing on success > +## > +{ 'command': 'memdev-add', Ah, you did name the QMP command with dash, so it's the docs above that are wrong. > + 'data': {'id': 'str', 'size': 'size', '*type': 'str'}, > + 'gen': 'no' > +} > +Arguments: > + > +- "id": the device's ID, must be unique (json-string) > +- "size": amount of memory backend should allocate (json-int) > +- "type": backend type (json-string, optional), default: compat-ram-ho= st-memory > + > +Example: > =20 > +-> { "execute": "memdev-add", > + "arguments": { "id": "memdev1", > + "size": "1G", I don't think this is valid QMP; you want to be passing sizes in bytes as an integer, not as a string that requires further parsing. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --hlkV33m38Lq79qLH6W3qIvioihgeW9MeE 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.15 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSlg7iAAoJEKeha0olJ0NqvWkH/RtB71IfbGJ7CgeMXiupe14P WVRHFbCtqNilnYkmo2dK5yAdiyMWzcTqz7NTrXHqMmProN/Xawa5ODVegDMGnKyC HfZxDwuauuaJYsvimkl4A8X8pvidJ3KesKU0EG73sI7Ykvhodzm0TBwGOJHXY46R IL9uz87w6XLXQEAaRJeNAbcibPmyNCJIr5BQxfAjz0figcWJL1TloWBylJTVfLys PHGbKz71BjAEKQOu322elWLyNw1jBd0gbkiIJn8UwSyfWfJvIiZ2drlxhq6I+BMo xjofk+6oGd2beMl0YSrwLPBrnYMqkOTkfmL1ppe87UjyHQIMtDtGTFgkG2+1Mu0= =aNZj -----END PGP SIGNATURE----- --hlkV33m38Lq79qLH6W3qIvioihgeW9MeE--