]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qom/object: Fix object_child_foreach_recursive() return value
authorCédric Le Goater <clg@kaod.org>
Sat, 4 Apr 2020 15:33:40 +0000 (17:33 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Jun 2020 16:09:35 +0000 (12:09 -0400)
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>
qom/object.c

index d0be42c8d682397f0eaf98d2de8c1ce19f9588be..484465f1c85f1a4f054c6290d3059a3914a5d04e 100644 (file)
@@ -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;
+                }
             }
         }
     }