qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 4/7] ppc: convert spapr code to use object pr


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v4 4/7] ppc: convert spapr code to use object property iterators
Date: Thu, 5 Nov 2015 18:16:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Am 13.10.2015 um 14:37 schrieb Daniel P. Berrange:
> Stop directly accessing the Object "properties" field data

Object::properties data structure for short.

> structure and instead use the formal object property iterator
> APIs. This insulates the code from future data structure
> changes in the Object struct.
> 
> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
>  hw/ppc/spapr_drc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
> index 5d6ea7c..f34bc04 100644
> --- a/hw/ppc/spapr_drc.c
> +++ b/hw/ppc/spapr_drc.c
> @@ -657,6 +657,7 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, 
> Object *owner,
>  {
>      Object *root_container;
>      ObjectProperty *prop;
> +    ObjectPropertyIterator *iter;
>      uint32_t drc_count = 0;
>      GArray *drc_indexes, *drc_power_domains;
>      GString *drc_names, *drc_types;
> @@ -680,7 +681,8 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, 
> Object *owner,
>       */
>      root_container = container_get(object_get_root(), DRC_CONTAINER_PATH);
>  
> -    QTAILQ_FOREACH(prop, &root_container->properties, node) {
> +    iter = object_property_iter_init(root_container);
> +    while ((prop = object_property_iter_next(iter))) {
>          Object *obj;
>          sPAPRDRConnector *drc;
>          sPAPRDRConnectorClass *drck;
> @@ -721,6 +723,7 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, 
> Object *owner,
>                                      spapr_drc_get_type_str(drc->type));
>          drc_types = g_string_insert_len(drc_types, -1, "\0", 1);
>      }
> +    object_property_iter_free(iter);
>  
>      /* now write the drc count into the space we reserved at the
>       * beginning of the arrays previously

Reviewed-by: Andreas Färber <address@hidden>

CC'ing PPC for ack.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton; HRB 21284 (AG Nürnberg)



reply via email to

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