On Tue, 25 Jun 2013 17:34:44 -0300 Eduardo Habkost <ehabk...@redhat.com> wrote:
> On Tue, Jun 25, 2013 at 05:30:50PM -0300, Eduardo Habkost wrote: > > On Wed, Jun 05, 2013 at 03:18:41PM +0200, Igor Mammedov wrote: > > > Signed-off-by: Igor Mammedov <imamm...@redhat.com> > > > --- > > [...] > > > @@ -1632,6 +1677,7 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, > > > char *features, Error **errp) > > > } else if (!strcmp(featurestr, "hv-spinlocks")) { > > > char *err; > > > const int min = 0xFFF; > > > + char num[32]; > > > numvalue = strtoul(val, &err, 0); > > > if (!*val || *err) { > > > error_setg(errp, "bad numerical value %s", val); > > > @@ -1643,7 +1689,8 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, > > > char *features, Error **errp) > > > min); > > > numvalue = min; > > > } > > > - env->hyperv_spinlock_attempts = numvalue; > > > + snprintf(num, sizeof(num), "%" PRId32, numvalue); > > > + object_property_parse(OBJECT(cpu), num, featurestr, > > > errp); > > > > Why not use object_property_set_int()? > > Oh, I believe I have asked that before and you have already explained > it: you are using strings to allow the existing object_property_parse() > calls to be easily converted to qdev_prop_register_global() calls later. > Correct? > Yep, this will be used later to consolidate code.