From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tn8eD-0000yV-O7 for qemu-devel@nongnu.org; Mon, 24 Dec 2012 09:04:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tn8eC-0008BV-9s for qemu-devel@nongnu.org; Mon, 24 Dec 2012 09:04:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tn8eC-0008BP-26 for qemu-devel@nongnu.org; Mon, 24 Dec 2012 09:04:52 -0500 Date: Mon, 24 Dec 2012 15:03:43 +0100 From: Igor Mammedov Message-ID: <20121224150343.13289002@thinkpad.mammed.net> In-Reply-To: <87mwx4tsmq.fsf@codemonkey.ws> References: <1355175187-11470-1-git-send-email-imammedo@redhat.com> <87mwx4tsmq.fsf@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 0/2 v2] introduce visitor for parsing suffixed integer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: afaerber@suse.de, qemu-devel@nongnu.org, ehabkost@redhat.com, mdroth@linux.vnet.ibm.com On Sun, 23 Dec 2012 14:34:21 -0600 Anthony Liguori wrote: > Igor Mammedov writes: > > > v2: > > * Naming changes: > > - s/visit_type_uint_suffixed_int/visit_type_suffixed_int/ > > - use 'suffix_factor' instead of 'unit' > > * Added documentation to visit_type_suffixed_int() > > * Fixed errp check. > > * Style fixes > > This is not how visitors are supposed to be used. We were trying to generalize and make code more reusable. Later could be used as a common base for specialized size and Hz visitors. > Just treat tsc_freq as a string property and parse it in the setter. Would http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg03835.html be better or you suggest just abandon generalization idea and parse it locally in target-i386/cpu.c? > > Regards, > > Anthony Liguori > > > > > Reference to previous version dicussion: > > http://lists.gnu.org/archive/html/qemu-devel/2012-12/msg00758.html > > > > Git tree for testing: > > https://github.com/imammedo/qemu/tree/type_suffixed_int_v2 > > > > Igor Mammedov (2): > > add visitor for parsing int[KMGT] input string > > target-i386: use visit_type_suffixed_int() to parse tsc_freq property > > value > > > > qapi/qapi-dealloc-visitor.c | 8 ++++++++ > > qapi/qapi-visit-core.c | 35 +++++++++++++++++++++++++++++++++++ > > qapi/qapi-visit-core.h | 4 ++++ > > qapi/string-input-visitor.c | 25 +++++++++++++++++++++++++ > > target-i386/cpu.c | 3 ++- > > 5 files changed, 74 insertions(+), 1 deletion(-) > > > > -- > > 1.7.11.7 -- Regards, Igor