summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2020-04-04 17:33:40 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-06-10 12:09:35 -0400
commit4a39181db284167111ff1b27bffe7599543e930f (patch)
tree30f7ad3cdada3bc1e278bcba0006d5621ed8a58c
parentb8164e68e5f91325821d413fec84b9a0956e95bb (diff)
downloadfocaccia-qemu-4a39181db284167111ff1b27bffe7599543e930f.tar.gz
focaccia-qemu-4a39181db284167111ff1b27bffe7599543e930f.zip
qom/object: Fix object_child_foreach_recursive() return value
When recursing, the return value of do_object_child_foreach() is not
taken into account.

Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Fixes: d714b8de7747 ("qom: Add recursive version of object_child_for_each")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200404153340.164861-1-clg@kaod.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--qom/object.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/qom/object.c b/qom/object.c
index d0be42c8d6..484465f1c8 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1051,7 +1051,10 @@ static int do_object_child_foreach(Object *obj,
                 break;
             }
             if (recurse) {
-                do_object_child_foreach(child, fn, opaque, true);
+                ret = do_object_child_foreach(child, fn, opaque, true);
+                if (ret != 0) {
+                    break;
+                }
             }
         }
     }