qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [Qemu-devel] [PATCH v2 1/6] target-i386: cpu: consolidate


From: Igor Mammedov
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH v2 1/6] target-i386: cpu: consolidate calls of object_property_parse() in x86_cpu_parse_featurestr
Date: Fri, 10 Jun 2016 09:23:15 +0200

On Thu, 9 Jun 2016 13:39:34 -0600
Eric Blake <address@hidden> wrote:

> On 06/09/2016 11:29 AM, Eduardo Habkost wrote:
> > On Thu, Jun 09, 2016 at 07:10:58PM +0200, Igor Mammedov wrote:
> > [...]  
> >> +
> >> +    if (local_err) {
> >> +        error_propagate(errp, local_err);
> >>      }  
> > 
> > error_propagate() already ignores local_err==NULL so you don't
> > need to check it first.  
> 
> In fact, if the ONLY reason you are doing an 'if (local_err)'
> conditional is to decide if an error was set, then you don't care about
> the error locally, and could have passed errp instead of &local_err in
> the first place.
errp might be NULL, so we won't do parsing at all.
considering it's more or less generic API hook it's safer
to follow error handling pattern used in properties
i.e. use local_error internally and then propagate error
if caller cares about it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]