From nobody Sun Nov 9 21:21:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552181921810117.88653905955698; Sat, 9 Mar 2019 17:38:41 -0800 (PST) Received: from localhost ([127.0.0.1]:38602 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2nQ2-0002Iq-Ow for importer@patchew.org; Sat, 09 Mar 2019 20:38:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2nP8-0001x9-7M for qemu-devel@nongnu.org; Sat, 09 Mar 2019 20:37:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2nP7-0008If-BZ for qemu-devel@nongnu.org; Sat, 09 Mar 2019 20:37:30 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:51622) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h2nP7-0008Hp-4K for qemu-devel@nongnu.org; Sat, 09 Mar 2019 20:37:29 -0500 Received: by mail-wm1-x332.google.com with SMTP id n19so1099689wmi.1 for ; Sat, 09 Mar 2019 17:37:28 -0800 (PST) Received: from erokenlabserver ([41.203.78.181]) by smtp.gmail.com with ESMTPSA id o12sm6363741wre.0.2019.03.09.17.37.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 09 Mar 2019 17:37:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=scHyABYa0iOmsI8g8k7bylFRqJy1sKWPEFrA2cxYnP4=; b=HNiM0HJ+MObEPgTdj74Ka1XRQkDMNL1SDyR/tLJiMFmBd5A5iKtgQWJ2j+27CcY4bH HYciHoq1tiP62f4/nH2wiz58qDS61/Wd0kuBMypqKeyk1EVpZjVOyBqwmjxrttEiPPH6 pv+r1hrnHdvNNELDfAB1JgVTMNIwEBHAMSLxmCiioV+HB+ZxSmzA26q+7Jf0G0ImEREG hSZ3iT5cg/xlBdbdmiHSW6nysPKoTpCaYgYFt3TN33/TWoqLlDXMyP4uQWAVvEPY/3TA Ea9IulFQDip87CROOjjimzZNjoPzrL7uKRZj+F/1J501zhu7MjG+y7ExOulxBmaL8hGb lf5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=scHyABYa0iOmsI8g8k7bylFRqJy1sKWPEFrA2cxYnP4=; b=srmhKbAvYbZEaFIjOzpMiSDyWFKmJTSO5RLyuXFHFc9n0piP7ifk30vWlSYoc4i3/3 UR3TBPF45d9ZuH8R0/DQ9dlmjo9kL2yD/O7yxIh9u6m2GAYpDT7DKoOG6TCz3prrQnEt q8rN/wupQsAsQRjEo+3G+VPQUg7+MgRDH+q3yoOpQLy+MjdzXbJwB0k9iPc0CP+277kw x7gWwc1Ljwya+EVpeZ1bvDLWeZTBtlCQFVVWvwdyYTYSXtC6uZtk9a6tfZzBgWsZ4KGy nR4O1L4ekJIw+tpMJxnLWf4RsVlXB43yPUM78enEdCIKnpGBVNxLkQinigY3ZUNK+yMm xvBg== X-Gm-Message-State: APjAAAVAKA63NIWt6LyGk/c6f+cba+0Jy1IxZHsD4RUUPrFa5Vw2DX5n QNJwJ8ZnprAEIaPioIx3sjd5FoMV X-Google-Smtp-Source: APXvYqyEFIE9437mJDG5sh2lfjXy1K2cF0ZbuZyxSVcR3FGN9WMZc7Jsen93qLi3uNA6Vnp8eBMVgw== X-Received: by 2002:a1c:1b4e:: with SMTP id b75mr13852259wmb.88.1552181846701; Sat, 09 Mar 2019 17:37:26 -0800 (PST) Date: Sun, 10 Mar 2019 02:39:13 +0100 From: Ernest Esene To: qemu-devel@nongnu.org Message-ID: <20190310013913.GA16519@erokenlabserver> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.11.1 (2018-12-01) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 Subject: [Qemu-devel] [PATCH] Replace calls to object_child_foreach() with object_child_foreach_recursive() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stefanha@gmail.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Replace calls to object_child_foreach() with object_child_foreach_recursive= () when applicable: nvdimm_device_list, nmi_monitor_handle, find_sysbus_device, pc_dimm_slot2bitmap, build_dimm_list. Signed-off-by: Ernest Esene --- hw/acpi/nvdimm.c | 5 +++-- hw/core/sysbus.c | 2 +- hw/mem/pc-dimm.c | 5 +++-- hw/virtio/virtio-balloon.c | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index e53b2cb..846f44b 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -41,7 +41,7 @@ static int nvdimm_device_list(Object *obj, void *opaque) *list =3D g_slist_append(*list, DEVICE(obj)); } =20 - object_child_foreach(obj, nvdimm_device_list, opaque); + object_child_foreach_recursive(obj, nvdimm_device_list, opaque); return 0; } =20 @@ -56,7 +56,8 @@ static GSList *nvdimm_get_device_list(void) { GSList *list =3D NULL; =20 - object_child_foreach(qdev_get_machine(), nvdimm_device_list, &list); + object_child_foreach_recursive(qdev_get_machine(), + nvdimm_device_list, &list); return list; } =20 diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 9f9edbc..c16d57c 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -43,7 +43,7 @@ static int find_sysbus_device(Object *obj, void *opaque) =20 if (!sbdev) { /* Container, traverse it for children */ - return object_child_foreach(obj, find_sysbus_device, opaque); + return object_child_foreach_recursive(obj, find_sysbus_device, opa= que); } =20 find->func(sbdev, find->opaque); diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 152400b..844c8ac 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -84,7 +84,7 @@ static int pc_dimm_slot2bitmap(Object *obj, void *opaque) } } =20 - object_child_foreach(obj, pc_dimm_slot2bitmap, opaque); + object_child_foreach_recursive(obj, pc_dimm_slot2bitmap, opaque); return 0; } =20 @@ -100,7 +100,8 @@ static int pc_dimm_get_free_slot(const int *hint, int m= ax_slots, Error **errp) } =20 bitmap =3D bitmap_new(max_slots); - object_child_foreach(qdev_get_machine(), pc_dimm_slot2bitmap, bitmap); + object_child_foreach_recursive(qdev_get_machine(), + pc_dimm_slot2bitmap, bitmap); =20 /* check if requested slot is not occupied */ if (hint) { diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index e3a6594..ce4b8a5 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -591,7 +591,7 @@ static int build_dimm_list(Object *obj, void *opaque) } } =20 - object_child_foreach(obj, build_dimm_list, opaque); + object_child_foreach_recursive(obj, build_dimm_list, opaque); return 0; } =20 --=20 2.14.2