From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfyTM-0000bW-PJ for qemu-devel@nongnu.org; Tue, 04 Dec 2012 14:48:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfyTK-0001pv-0J for qemu-devel@nongnu.org; Tue, 04 Dec 2012 14:48:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfyTJ-0001pr-Ov for qemu-devel@nongnu.org; Tue, 04 Dec 2012 14:48:01 -0500 Date: Tue, 4 Dec 2012 20:47:56 +0100 From: Igor Mammedov Message-ID: <20121204204756.6b94843e@thinkpad.mammed.net> In-Reply-To: <1354649683-9078-3-git-send-email-ehabkost@redhat.com> References: <1354649683-9078-1-git-send-email-ehabkost@redhat.com> <1354649683-9078-3-git-send-email-ehabkost@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/6] target-i386: cpu: separate feature string parsing from CPU model lookup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Don Slutz , qemu-devel@nongnu.org, Andreas =?UTF-8?B?RsOkcmJlcg==?= On Tue, 4 Dec 2012 17:34:39 -0200 Eduardo Habkost wrote: > Instead of using parsing the whole cpu_model string inside > cpu_x86_find_by_name(), first split it into the CPU model name and the > full feature string, then parse the feature string into pieces. > > When using CPU model classes, those two pieces of information will be > used at different moments (CPU model name will be used to find CPU > class, feature string will be used after CPU object was created), so > making the split in two steps will make it easier to refactor the code > later. > > This should also help on the CPU properties work, that will just need to > replace the cpu_x86_parse_featurestr() logic (and can keep the CPU model > lookup code as-is). > > Signed-off-by: Eduardo Habkost > --- > Changes v1 -> v2: > - Coding style changes > - Replace "goto error" with "return -1" > > Changes v2 -> v3: > - Fix memory leak on handling of errors form object_property_set_str() > --- Reviewed-by: Igor Mammedov -- Regards, Igor