From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKljE-0004xQ-Fd for qemu-devel@nongnu.org; Tue, 04 Mar 2014 04:33:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKlj8-0007xf-Hd for qemu-devel@nongnu.org; Tue, 04 Mar 2014 04:33:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:8812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKlj8-0007xa-9Y for qemu-devel@nongnu.org; Tue, 04 Mar 2014 04:33:30 -0500 Message-ID: <53159DDE.6010101@redhat.com> Date: Tue, 04 Mar 2014 10:33:18 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <531596F5.3070001@redhat.com> <20140304092336.GA664@G08FNSTD100614.fnst.cn.fujitsu.com> In-Reply-To: <20140304092336.GA664@G08FNSTD100614.fnst.cn.fujitsu.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v19 07/11] qapi: make string output visitor parse int list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: imammedo@redhat.com, Hu Tao , qemu-devel@nongnu.org, gaowanlong@cn.fujitsu.com Il 04/03/2014 10:23, Hu Tao ha scritto: >> > >>> > >+ } else { >>> > >+ out = g_strdup_printf("%lld-%lld", >>> > >+ (long long) sov->range_start.s, >>> > >+ (long long) sov->range_end.s); >>> > >+ } >>> > >+ } >> > >> > This looks wrong. You do not insert any separator, and you do not >> > handle things like "0-3,8-11". You probably should use a GString >> > instead of string_output_set. > > Right. We should also handle "0-3,8-11"-like lists in string input > visitor and opts visitor. Ok, no big deal; let's do one thing at a time. Regarding string input visitor, I believe we can avoid the code duplication by: (1) using Qmp input/output visitors in query-memdev (2) using OptsVisitor in -object The string output visitor becomes more important than the string input visitor, but it is only needed for HMP so it is not urgent. We can then work on making OptsVisitor use the string input visitor internally. But I'm already applying patches 1-5, 8, 9, 10 (the latter with the above changes) to the numa tree. Paolo