From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Url7m-00028J-V1 for qemu-devel@nongnu.org; Wed, 26 Jun 2013 04:30:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Url7k-0004aD-Jc for qemu-devel@nongnu.org; Wed, 26 Jun 2013 04:30:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Url7k-0004a3-At for qemu-devel@nongnu.org; Wed, 26 Jun 2013 04:30:44 -0400 Date: Wed, 26 Jun 2013 10:30:40 +0200 From: Igor Mammedov Message-ID: <20130626103040.5b0a8a96@nial.usersys.redhat.com> In-Reply-To: <20130625203444.GO13956@otherpad.lan.raisama.net> References: <1370438326-27054-1-git-send-email-imammedo@redhat.com> <1370438326-27054-11-git-send-email-imammedo@redhat.com> <20130625203050.GC7707@otherpad.lan.raisama.net> <20130625203444.GO13956@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 10/15] target-i386: convert 'hv_spinlocks' to static property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, afaerber@suse.de On Tue, 25 Jun 2013 17:34:44 -0300 Eduardo Habkost 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 > > > --- > > [...] > > > @@ -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.