On Tue, 4 Dec 2012 17:34:39 -0200 Eduardo Habkost <ehabk...@redhat.com> 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 <ehabk...@redhat.com> > --- > 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 <imamm...@redhat.com> -- Regards, Igor