From 4a39181db284167111ff1b27bffe7599543e930f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Sat, 4 Apr 2020 17:33:40 +0200 Subject: qom/object: Fix object_child_foreach_recursive() return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When recursing, the return value of do_object_child_foreach() is not taken into account. Cc: Peter Crosthwaite Fixes: d714b8de7747 ("qom: Add recursive version of object_child_for_each") Signed-off-by: Cédric Le Goater Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200404153340.164861-1-clg@kaod.org> Signed-off-by: Paolo Bonzini --- qom/object.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qom') diff --git a/qom/object.c b/qom/object.c index d0be42c..484465f 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; + } } } } -- cgit v1.1