From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwGvH-0002U1-Kp for qemu-devel@nongnu.org; Mon, 08 Jul 2013 15:16:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwGvF-0007gv-Iw for qemu-devel@nongnu.org; Mon, 08 Jul 2013 15:16:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:30942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwGvF-0007gd-Bk for qemu-devel@nongnu.org; Mon, 08 Jul 2013 15:16:29 -0400 Message-ID: <51DB1006.3050101@redhat.com> Date: Mon, 08 Jul 2013 13:16:22 -0600 From: Eric Blake MIME-Version: 1.0 References: <1372931597-28115-1-git-send-email-gaowanlong@cn.fujitsu.com> <1372931597-28115-9-git-send-email-gaowanlong@cn.fujitsu.com> In-Reply-To: <1372931597-28115-9-git-send-email-gaowanlong@cn.fujitsu.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2VBNKMWEFSMMBEXHVWWJE" Subject: Re: [Qemu-devel] [PATCH V4 08/10] NUMA: add qmp command set-mpol to set memory policy for NUMA node List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wanlong Gao Cc: aliguori@us.ibm.com, ehabkost@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, bsd@redhat.com, y-goto@jp.fujitsu.com, pbonzini@redhat.com, afaerber@suse.de This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2VBNKMWEFSMMBEXHVWWJE Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/04/2013 03:53 AM, Wanlong Gao wrote: > The QMP command let it be able to set node's memory policy s/let it be able/allows users/ > through the QMP protocol. The qmp-shell command is like: > set-mpol nodeid=3D0 mem-policy=3Dmembind mem-hostnode=3D0-1 >=20 > Signed-off-by: Wanlong Gao > --- Just an interface review: > +++ b/qapi-schema.json > @@ -3712,3 +3712,18 @@ > '*cpuid-input-ecx': 'int', > 'cpuid-register': 'X86CPURegister32', > 'features': 'int' } } > + > +# @set-mpol: I agree with other requests in this thread to make the name closer to English words (set-memory-policy). Also, I hate write-only interfaces; what is the corresponding query-* command that lets me learn the policy that is currently in effect? I'm expecting that this series either modifies an existing command or adds a new query command as the counterpart to this set command. > +# > +# Set the host memory binding policy for guest NUMA node. > +# > +# @nodeid: The node ID of guest NUMA node to set memory policy to. > +# > +# @mem-policy: The memory policy string to set. > +# > +# @mem-hostnode: The host node or node range for memory policy. > +# > +# Since: 1.6.0 > +## > +{ 'command': 'set-mpol', 'data': {'nodeid': 'int', '*mem-policy': 'str= ', > + '*mem-hostnode': 'str'} } Make mem-policy an enum, not an open-coded string. Also, make mem-hostnode an array of nodes - a general rule of thumb is that if the receiver (here, qemu) has to do further parsing of the data (such as scraping out integer vs. dash to decide if it is one node or a range), then the JSON was too high-level. Using ['int'] instead of 'str' will let the data be available already parsed into an integer list by the visitor code, so you aren't having to write your own ad hoc parser on the receiving end. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2VBNKMWEFSMMBEXHVWWJE 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/ iQEcBAEBCAAGBQJR2xAGAAoJEKeha0olJ0Nq2UMH/2omIT0v0gcoCiYYP1uj1Aid 7QWG023TCckM3LQHbNdrgzuv1kIj7VFNw/MlL06zMEhfeua/wyK9h9CI18sRIwyV 7dY+sbyFQgtXX74dSSsMGFddYWRKsikF5REX8nDodGkhDkHTyjwrcOksesKMXaJC F6Ps+EMUY6cJqvxYD6Uoju2Bpk35sggbcF/UywgPMOe4TH1DQnpnxBxgjoS17DSR C+Q1AHdKPv3PDyVgIFNHvWAjo74V0wjLkv+aD1Ey/85MlKELwejMIoauIjY4rnx0 O8MiDCllc3ksyCmXqEaYpo3KXy15vjmSvWpBg1uNMDVw9KevWUBp3Hzzq1IQNkM= =YyXV -----END PGP SIGNATURE----- ------enig2VBNKMWEFSMMBEXHVWWJE--