diff mbox series

[v2,05/12] qom/object: fix iterating properties over a class

Message ID 20180907075948.26917-6-marcandre.lureau@redhat.com
State New
Headers show
Series Various qemu command line options help improvements | expand

Commit Message

Marc-André Lureau Sept. 7, 2018, 7:59 a.m. UTC
object_class_property_iter_init() starts from the given class, so the
next class should continue with the parent class.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paolo Bonzini Oct. 3, 2018, 12:58 p.m. UTC | #1
On 07/09/2018 09:59, Marc-André Lureau wrote:
> object_class_property_iter_init() starts from the given class, so the
> next class should continue with the parent class.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  qom/object.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qom/object.c b/qom/object.c
> index 75d1d48944..d8666de3f2 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -1108,7 +1108,7 @@ void object_class_property_iter_init(ObjectPropertyIterator *iter,
>                                       ObjectClass *klass)
>  {
>      g_hash_table_iter_init(&iter->iter, klass->properties);
> -    iter->nextclass = klass;
> +    iter->nextclass = object_class_get_parent(klass);
>  }
>  
>  ObjectProperty *object_class_property_find(ObjectClass *klass, const char *name,
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
diff mbox series

Patch

diff --git a/qom/object.c b/qom/object.c
index 75d1d48944..d8666de3f2 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1108,7 +1108,7 @@  void object_class_property_iter_init(ObjectPropertyIterator *iter,
                                      ObjectClass *klass)
 {
     g_hash_table_iter_init(&iter->iter, klass->properties);
-    iter->nextclass = klass;
+    iter->nextclass = object_class_get_parent(klass);
 }
 
 ObjectProperty *object_class_property_find(ObjectClass *klass, const char *name,