From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzU4L-00019m-BV for qemu-devel@nongnu.org; Wed, 17 Jul 2013 11:55:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UzU4J-0001Zr-OC for qemu-devel@nongnu.org; Wed, 17 Jul 2013 11:55:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzU4J-0001ZZ-GC for qemu-devel@nongnu.org; Wed, 17 Jul 2013 11:55:07 -0400 Message-ID: <51E6BE28.2060701@redhat.com> Date: Wed, 17 Jul 2013 17:54:16 +0200 From: Paolo Bonzini 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> <51E6AB34.3090908@redhat.com> <51E6ADC3.5010203@redhat.com> <51E6B73C.4060003@redhat.com> <51E6B79C.4040909@redhat.com> <51E6BC21.9020701@redhat.com> In-Reply-To: <51E6BC21.9020701@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: Laszlo Ersek 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 Il 17/07/2013 17:45, Laszlo Ersek ha scritto: >> Yes, though I guess Wanlong could do this by himself. A more >> interesting prototype is "how to add code to OptsVisitor that parses >> intervals when it sees ['int']", and this where you can help the most. > > Do you want each element of the range present in the flat list, or just > the boundaries? (The above example, ie [3..4]U[9..10] doesn't > distinguish between these two.) It should be a real list. > If the list contains the boundaries only, that's more frugal but > requires smarter code. If the list contains all elements, then big > ranges will result in huge lists (which are then easy to handle piecewise). Huge lists wouldn't be a problem, I think. > Do you also want a<=b checking for [a,b]? (That would imply "inclusive" > on both sides and not allow empty sets easily.) > > This is going to be a huge hack, but I can already express the condition > "I'm in a list and looking for the next element as int" in the code. So > maybe I could force some more state into OptsVisitor (specifically > opts_type_int()/opts_type_uint64() and lookup_scalar()) and fake extra > elements. Yeah, I guessed something like that. > Better: I could pop "a-b" off "ov->repeated_opts", return "a" (after > parsing), and push back "b". Then "b" would not differ from the current > "individual int" case, and I wouldn't have to add extra state to > maintain between calls. > > You just torpedoed planned review efforts for today / tomorrow :) :) Paolo