From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVf3W-0003Ik-0A for qemu-devel@nongnu.org; Fri, 26 Apr 2013 05:35:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVf3U-0007ri-Q4 for qemu-devel@nongnu.org; Fri, 26 Apr 2013 05:35:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25655) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVf3U-0007rV-Gt for qemu-devel@nongnu.org; Fri, 26 Apr 2013 05:35:00 -0400 Date: Fri, 26 Apr 2013 11:34:51 +0200 From: Igor Mammedov Message-ID: <20130426113451.2d0aa25f@thinkpad> In-Reply-To: <20130426085355.GV2900@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> <20130426093259.03d73216@thinkpad> <20130426085355.GV2900@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, mst@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org, anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de, stefano.stabellini@eu.citrix.com On Fri, 26 Apr 2013 05:53:55 -0300 Eduardo Habkost wrote: > On Fri, Apr 26, 2013 at 09:32:59AM +0200, Igor Mammedov wrote: > > 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(). > > So why you didn't use error_set()? :-) in short, QERR_* is depricated and error_set() shouldn't be used anymore. http://lists.gnu.org/archive/html/qemu-devel/2012-10/msg02520.html > > -- > Eduardo > -- Regards, Igor