From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54133) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzSlA-00035d-NI for qemu-devel@nongnu.org; Wed, 17 Jul 2013 10:31:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzSl4-0004Hj-Aw for qemu-devel@nongnu.org; Wed, 17 Jul 2013 10:31:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzSl4-0004Hb-1W for qemu-devel@nongnu.org; Wed, 17 Jul 2013 10:31:10 -0400 Message-ID: <51E6AB34.3090908@redhat.com> Date: Wed, 17 Jul 2013 16:33:24 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1374053373-30499-1-git-send-email-gaowanlong@cn.fujitsu.com> <1374053373-30499-2-git-send-email-gaowanlong@cn.fujitsu.com> <51E67368.3000003@redhat.com> <51E68D0F.4040503@redhat.com> <51E6A2D9.5040202@redhat.com> <51E6A826.4010003@redhat.com> In-Reply-To: <51E6A826.4010003@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V5 01/12] NUMA: add NumaOptions, NumaNodeOptions and NumaMemOptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, ehabkost@redhat.com, peter.huangpeng@huawei.com, qemu-devel@nongnu.org, bsd@redhat.com, y-goto@jp.fujitsu.com, lcapitulino@redhat.com, afaerber@suse.de, Wanlong Gao On 07/17/13 16:20, Paolo Bonzini wrote: > Il 17/07/2013 15:57, Laszlo Ersek ha scritto: >>>> Not only that, but is this even the right representation? The fact that >>>> you are requiring the receiver to further parse this string means you >>>> probably represented it at the wrong level in JSON. That is, a JSON >>>> string "1,2,4" requires post-processing to turn it into 3 processor ids, >>>> while a JSON array [1, 2, 4] does not, so you should probably consider >>>> '*cpus':['int'] as your preferred datatype. >> opts-visitor can handle lists of simple scalar types. Ie. it can do >> -numa node,nodeid=3,cpus=3-4,cpus=9-10. It can't save the parsing of >> intervals (eg. 3-4). > > Saving the parsing of intervals is not necessary for this use case. So > if we can make it '*cpus':['int'], we should. > > But is it the opts-visitor "can handle" lists of integers, or does code > have to be written? If the latter, can you whip up a prototype? No extra code needs to be written. The current use case is NetdevUserOptions.{dnssearch,hostfwd,guestfwd}; see commit 094f15c5, and (by Klaus Stengel) commit 63d2960b. Laszlo