From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCKeP-0001Y4-6e for qemu-devel@nongnu.org; Wed, 21 Aug 2013 22:29:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VCKeJ-0002pf-N2 for qemu-devel@nongnu.org; Wed, 21 Aug 2013 22:29:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VCKeJ-0002oQ-FL for qemu-devel@nongnu.org; Wed, 21 Aug 2013 22:29:23 -0400 Message-ID: <52157770.7030803@redhat.com> Date: Wed, 21 Aug 2013 20:29:04 -0600 From: Eric Blake MIME-Version: 1.0 References: <1376960839-13033-1-git-send-email-gaowanlong@cn.fujitsu.com> <1376960839-13033-2-git-send-email-gaowanlong@cn.fujitsu.com> <52152A36.80705@redhat.com> <52156592.1000905@cn.fujitsu.com> In-Reply-To: <52156592.1000905@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vAuevVG3TPfQqBINbIMwBwMuFqmN4TCcK" Subject: Re: [Qemu-devel] [PATCH V8 01/11] NUMA: add NumaOptions, NumaNodeOptions and NumaMemOptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: gaowanlong@cn.fujitsu.com Cc: aliguori@us.ibm.com, ehabkost@redhat.com, hutao@cn.fujitsu.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, bsd@redhat.com, pbonzini@redhat.com, y-goto@jp.fujitsu.com, peter.huangpeng@huawei.com, lersek@redhat.com, afaerber@suse.de This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vAuevVG3TPfQqBINbIMwBwMuFqmN4TCcK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/21/2013 07:12 PM, Wanlong Gao wrote: >>> + '*mem': 'str' }} >> >> Why is size passed as a 'str' instead of an integral type? If anythin= g, >> at the QMP layer, it should be an integer representing size in bytes >> (the command line and HMP are already capable of converting shorthand >> like 1G into proper byte counts for use in QAPI). >=20 > Since the original "mem" options is MB default, but "size" type is byte= default, > so we should pass a "str" first to be consistent with original option. No. HMP is human-friendly - it can default to M. QMP is machine-friendly - it should default to bytes and take an 'int' rather than a 'str'. Part of the glue between HMP and QMP is converting from human-friendly to machine-friendly, so that QMP doesn't have to carry cru= ft. >>> +# >>> +# @nodeid: #optional NUMA node ID >>> +# >>> +# @size: #optional memory size of this node >> >> If everything is optional, then what defaults are used if I specify >> nothing? Should nodeid be mandatory (here, and in NumaNodeOptions)? >=20 > The defaults are all consistent with original behaviour. If nodeid is > omitted, the option will be assigned node by node from node0. What will be assigned? If I omit both nodeid and size, there's nothing left in the object I'm passing. Just because HMP can do sane defaults doesn't mean that QMP needs to mark all fields as optional. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --vAuevVG3TPfQqBINbIMwBwMuFqmN4TCcK 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.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSFXdwAAoJEKeha0olJ0NqP5wH+gO3/e0Yog0ldSm1OOw8Omo0 4mot8OPp+uYqEkCOuhERUm3GEneWgYc49PhZN/1hDVF5oDFquIlW97F/mZkNsUwN Urrm+/IAwpZh1/DsbLve8M5Kh/u8wKOZuwhqfbEpvmnogar3GAbOlpRY0da3Dyt8 +zgRiFWEXx2Xw1SvWB3g1MWiBhyTLsMxfjpEwp80dgz6hYCMw4ZW6rjocZCPvBil Rnff5jk+Zc24MH0xn4xi/wV5BoNsdiTlwtr63+QNdH/sIXnkvzKpdZbH2jB5SYz3 /sjV8LN8E1Uy17ve7WkkvoaxiFjAPVK0ZOLZVHct3ZCnHzKqU14BokyWrjSkV6U= =EJx0 -----END PGP SIGNATURE----- --vAuevVG3TPfQqBINbIMwBwMuFqmN4TCcK--