qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 05/10] qdev: GlobalProperty.errp field


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH 05/10] qdev: GlobalProperty.errp field
Date: Mon, 20 Jun 2016 10:45:58 -0300
User-agent: Mutt/1.6.1 (2016-04-27)

On Mon, Jun 20, 2016 at 10:14:55AM +0200, Markus Armbruster wrote:
> Eduardo Habkost <address@hidden> writes:
[...]
> > diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
> > index 24aa0a7..16e7cc0 100644
> > --- a/include/hw/qdev-core.h
> > +++ b/include/hw/qdev-core.h
> > @@ -256,6 +256,9 @@ struct PropertyInfo {
> >  
> >  /**
> >   * GlobalProperty:
> > + * @errp: If set, error_propagate() will be called on errors when applying
> > + *        the property. &error_abort or &error_fatal may be used to make
> > + *        errors automatically abort or exit QEMU.
> 
> "If set" is awkward, because it's not what we usually mean when we talk
> about an error being set.  Suggest "If non-null".

Agreed.

> 
> But what makes null special isn't that errors won't be propagated.  In
> fact, the code behaves as if they were (propagating to null frees the
> error, which is exactly what the code does), *except* for one thing that
> isn't mentioned here, but should be: we print a warning.
> 
> What about:
> 
>  * @errp: Error destination, used like a first argument of error_setg(),
>  * except with null @errp, we print warnings instead of ignoring errors
>  * silently.

Perfect. I will use it. Thanks!

-- 
Eduardo



reply via email to

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