[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
- [Qemu-devel] [PATCH 00/10] globals: Clean up validation and error checking, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 03/10] vl: Reject invalid class names on -global, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 01/10] qdev: Don't stop applying globals on first error, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 05/10] qdev: GlobalProperty.errp field, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 02/10] qdev: Eliminate qemu_add_globals() function, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 07/10] vl: Set errp to &error_abort on machine compat_props, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 08/10] qdev: Eliminate "global not used" warning, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 04/10] qdev: Use error_prepend() for errors applying globals, Eduardo Habkost, 2016/06/15
- [Qemu-devel] [PATCH 06/10] machine: Add machine_register_compat_props() function, Eduardo Habkost, 2016/06/15