[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 19/36] qdev: Move array property creation/registration to sep
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH 19/36] qdev: Move array property creation/registration to separate functions |
Date: |
Fri, 30 Oct 2020 07:20:05 -0400 |
On Fri, Oct 30, 2020 at 02:03:07PM +0400, Marc-André Lureau wrote:
> On Fri, Oct 30, 2020 at 2:17 AM Eduardo Habkost <ehabkost@redhat.com> wrote:
>
> > The array property registration code is hard to follow. Move the
> > two steps into separate functions that have clear
> > responsibilities.
> >
> > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> > ---
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> > Cc: Eduardo Habkost <ehabkost@redhat.com>
> > Cc: qemu-devel@nongnu.org
> > ---
> > hw/core/qdev-properties.c | 60 ++++++++++++++++++++++++++-------------
> > 1 file changed, 41 insertions(+), 19 deletions(-)
> >
> > diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> > index 27c09255d7..1f06dfb5d5 100644
> > --- a/hw/core/qdev-properties.c
> > +++ b/hw/core/qdev-properties.c
> > @@ -588,6 +588,32 @@ typedef struct {
> > ObjectPropertyRelease *release;
> > } ArrayElementProperty;
> >
> > +/**
> > + * Create ArrayElementProperty based on array length property
> > + * @array_len_prop (which was previously defined using
> > DEFINE_PROP_ARRAY()).
> > + */
> >
>
> (some day we will have to clarify our API doc style, but not now ;)
In this specific case, this one was not supposed to be a real doc
comment. My first version of this commit had a full doc comment,
then I decided it was overkill for an internal static function
and I made it a plain paragraph. The "/**" and
"@array_len_prop" are leftovers from the old doc comment and I
will remove them if respinning the series.
>
> +static ArrayElementProperty *array_element_new(Object *obj,
--
Eduardo
- Re: [PATCH 12/36] qdev: Make error_set_from_qdev_prop_error() get Object* argument, (continued)
- [PATCH 20/36] qdev: Reuse object_property_add_static() when adding array elements, Eduardo Habkost, 2020/10/29
- [PATCH 21/36] qom: Add allow_set callback to ObjectProperty, Eduardo Habkost, 2020/10/29
- [PATCH 14/36] qdev: Move dev->realized check to qdev_property_set(), Eduardo Habkost, 2020/10/29
- [PATCH 18/36] qdev: Avoid unnecessary DeviceState* variable at set_prop_arraylen(), Eduardo Habkost, 2020/10/29
- [PATCH 22/36] qdev: Make qdev_prop_allow_set() a property allow_set callback, Eduardo Habkost, 2020/10/29