From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVd9b-0006N9-C4 for qemu-devel@nongnu.org; Fri, 26 Apr 2013 03:33:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVd9a-0000fK-AR for qemu-devel@nongnu.org; Fri, 26 Apr 2013 03:33:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVd9a-0000fB-3M for qemu-devel@nongnu.org; Fri, 26 Apr 2013 03:33:10 -0400 Date: Fri, 26 Apr 2013 09:32:59 +0200 From: Igor Mammedov Message-ID: <20130426093259.03d73216@thinkpad> In-Reply-To: <20130425203645.GH11821@otherpad.lan.raisama.net> References: <1366898737-6201-1-git-send-email-imammedo@redhat.com> <1366898737-6201-5-git-send-email-imammedo@redhat.com> <20130425203645.GH11821@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/15] target-i386: introduce apic-id property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, quintela@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de, stefano.stabellini@eu.citrix.com On Thu, 25 Apr 2013 17:36:45 -0300 Eduardo Habkost wrote: > On Thu, Apr 25, 2013 at 04:05:26PM +0200, Igor Mammedov wrote: > [...] > > +static void x86_cpuid_set_apic_id(Object *obj, Visitor *v, void *opaque, > > + const char *name, Error **errp) > > +{ > > + X86CPU *cpu = X86_CPU(obj); > > + const int64_t min = 0; > > + const int64_t max = UINT32_MAX; > > + Error *error = NULL; > > + int64_t value; > > + > > + visit_type_int(v, &value, name, &error); > > + if (error) { > > + error_propagate(errp, error); > > + return; > > + } > > + if (value < min || value > max) { > > + error_setg(&error, "Property %s.%s doesn't take value %" PRId64 > > + " (minimum: %" PRId64 ", maximum: %" PRId64 ")" , > > + object_get_typename(obj), name, value, min, max); > > + error_propagate(errp, error); > > + return; > > + } > > Why you copied and pasted the string from > QERR_PROPERTY_VALUE_OUT_OF_RANGE, instead of simply using the define > like in the other property setters? it's designed to work with error_set(), not with error_setg(). > > The rest of the patch looks good to me. > > -- > Eduardo > -- Regards, Igor