From nobody Sat Nov 23 18:15:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1732217038; cv=none; d=zohomail.com; s=zohoarc; b=YMDam6AgJyQg9VhGhu+5frsmwd9g9yfI3ZXTtGTKCv5RU+hNKL6MmxUku2eQtsfAfzHszebFlRbf1AdAv4fMRSf0znotCs/7C1WS6xOMzWQD4d7+Fa9+GFp02GtL8NSH8a+AfNGPCd9il+fL+Cq9XvSRdOtZAK3VEmTEFUS2M6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732217038; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KlCjmMhOsETnaTyXAbRHACVEqc3kQ0Zh/uAJpxK1nFM=; b=k+yohl+Kdce2TRHeuY0fh+eebxzn7WT/jQGOmo6Rf3lAx2kHsWpGmx5KIy9ZuYQy7S6o6C3h5PPjtb54nI72XsaBVO/5IdGAdGjFUsGIbeBnoEzpe/UqL9pSknE5RulXEc1oscOe9wvikDg+rU9C4vUYvpmJ5Yf8zHaFNYPcK6E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732217038905478.59776826234975; Thu, 21 Nov 2024 11:23:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tECl5-0006SK-Jm; Thu, 21 Nov 2024 14:22:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tECl3-0006Rg-Uz for qemu-devel@nongnu.org; Thu, 21 Nov 2024 14:22:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tECl2-0002YU-FH for qemu-devel@nongnu.org; Thu, 21 Nov 2024 14:22:29 -0500 Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-As8xvxmPOMGDG9TgWiYVRQ-1; Thu, 21 Nov 2024 14:22:26 -0500 Received: by mail-io1-f70.google.com with SMTP id ca18e2360f4ac-83acaa1f819so139143839f.3 for ; Thu, 21 Nov 2024 11:22:26 -0800 (PST) Received: from x1n.redhat.com (pool-99-254-114-190.cpe.net.cable.rogers.com. [99.254.114.190]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4e1cfe345f0sm102939173.45.2024.11.21.11.22.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 11:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732216947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KlCjmMhOsETnaTyXAbRHACVEqc3kQ0Zh/uAJpxK1nFM=; b=ZshSu66os53hV1RdyuLeHLHNBos8h/ALnBVOhdIaa1Kl+tL2rvHRmmYl3RXw5qz6fugHHA T+Iy7dLU1Zzm0Mwx2ffs82tBEEJHMS+x0HguHILqeWU+kAhy173jazpHeGtGofFGYbqF4T L7uPam8u8sXLnSr0CxlWTeIfGQpMv4c= X-MC-Unique: As8xvxmPOMGDG9TgWiYVRQ-1 X-Mimecast-MFC-AGG-ID: As8xvxmPOMGDG9TgWiYVRQ X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732216945; x=1732821745; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KlCjmMhOsETnaTyXAbRHACVEqc3kQ0Zh/uAJpxK1nFM=; b=aPEjh0Oc1eucaAgmmUlfApHPLSF4opQTFATyvlRoQvphNWuFX/OBo8WtPGvtD3WNte vHyhjeJd8Y0/p9Ca8p216nLygMXVQlKjw/OH2EDbwFfeCwHN/vq1aeJNCq5aOAIk2P9R dmDdUsYEukxgR0F/xwHsnPFUAcMc4zddD66uv0iChPYzui0cU3eL8XSzYxnrqk1K/x3y nwdFtokM00HCzAVcW2QV82Vl3Wn4mRjtEtWD9Eo/S3DAi3b4UDjXf6MH8z2ZkC+7T+yB 277dMwRH5wg8BQxMd7AvQ3at0c8nrBXaYRENjUmNOAkoKPVApToyw+1fKjkgRWzLctVu 1fUA== X-Gm-Message-State: AOJu0Yywmmbg+SafsNtZiqCtHi4QkjON1rIizpj6rqAsJdRDIb88SNzH 4MGJYzKu4iG1vkVXpCOt0tXGhm/gD0jgKaY0EjEXLGRZqJ9HX5N+PUx6FY1mxU5XbSk7Izsg/Af yBDwXAW+WgRtwmoTRMkiw33qc4Z/vEGrj1TwXAdBcaYWj01GwubKc+/V/wT5PPlBPI74etonX2W h5SGA2+1LXYoxm9Hj2ZM+rhCbbv2NJDPvv4A== X-Gm-Gg: ASbGnctc9B/0JlCjSqi58AqKCLtB+q3c9LygkJ6zPFtF6SJGMDeYEWG0hSiMGxXAIxE OaJr2gsPcIB4R0gX22Q3y1c7Y4kKO5e2yT9brjY68FLp+StM0Lg5sMI+yL8yGda46rSV/d4BABc JVQZBXbtPfFhnvRI2yu0ghPFnZd9kO+i2hUpvGuzBHvdb8H1/9WaO8CdU2x6x4LXUqHn9qtvq3w 94HwATcwluoaL61iZgMKjkSq+96Ime8XEXXUsu0QmDM95KPig3ezWaIsmmSPH8k1scahXtzqhp5 TmZnApMga5d3ozo8un3GkONdRw== X-Received: by 2002:a05:6602:6c0a:b0:837:7d54:acf1 with SMTP id ca18e2360f4ac-83ecdc5165fmr9753539f.2.1732216945552; Thu, 21 Nov 2024 11:22:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEcrz4gsR2FCel784ZzHiMIHEQa6Iq+lDIdERLixZPsbyuVSNez3p4F297s/6ql0Xdi1xWIA== X-Received: by 2002:a05:6602:6c0a:b0:837:7d54:acf1 with SMTP id ca18e2360f4ac-83ecdc5165fmr9750639f.2.1732216945208; Thu, 21 Nov 2024 11:22:25 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster , Peter Maydell , Juraj Marcin , peterx@redhat.com, =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , Fabiano Rosas , Paolo Bonzini , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Eduardo Habkost Subject: [PATCH v2 12/13] qom: Use object_get_container() Date: Thu, 21 Nov 2024 14:22:01 -0500 Message-ID: <20241121192202.4155849-13-peterx@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241121192202.4155849-1-peterx@redhat.com> References: <20241121192202.4155849-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.14, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1732217041199116600 Content-Type: text/plain; charset="utf-8" Use object_get_container() whenever applicable across the tree. Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- backends/cryptodev.c | 4 ++-- chardev/char.c | 2 +- qom/object.c | 2 +- scsi/pr-manager.c | 4 ++-- ui/console.c | 2 +- ui/dbus-chardev.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backends/cryptodev.c b/backends/cryptodev.c index d8bd2a1ae6..263de4913b 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -97,7 +97,7 @@ static int qmp_query_cryptodev_foreach(Object *obj, void = *data) QCryptodevInfoList *qmp_query_cryptodev(Error **errp) { QCryptodevInfoList *list =3D NULL; - Object *objs =3D container_get(object_get_root(), "/objects"); + Object *objs =3D object_get_container("objects"); =20 object_child_foreach(objs, qmp_query_cryptodev_foreach, &list); =20 @@ -557,7 +557,7 @@ static void cryptodev_backend_stats_cb(StatsResultList = **result, switch (target) { case STATS_TARGET_CRYPTODEV: { - Object *objs =3D container_get(object_get_root(), "/objects"); + Object *objs =3D object_get_container("objects"); StatsArgs stats_args; stats_args.result.stats =3D result; stats_args.names =3D names; diff --git a/chardev/char.c b/chardev/char.c index a1722aa076..22fc5f7f76 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -48,7 +48,7 @@ =20 Object *get_chardevs_root(void) { - return container_get(object_get_root(), "/chardevs"); + return object_get_container("chardevs"); } =20 static void chr_be_event(Chardev *s, QEMUChrEvent event) diff --git a/qom/object.c b/qom/object.c index 25316b9536..c9e53ed92c 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1779,7 +1779,7 @@ Object *object_get_root(void) =20 Object *object_get_objects_root(void) { - return container_get(object_get_root(), "/objects"); + return object_get_container("objects"); } =20 Object *object_get_internal_root(void) diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c index fb5fc29730..1977d99ce0 100644 --- a/scsi/pr-manager.c +++ b/scsi/pr-manager.c @@ -21,7 +21,7 @@ #include "qemu/module.h" #include "qapi/qapi-commands-block.h" =20 -#define PR_MANAGER_PATH "/objects" +#define PR_MANAGER_PATH "objects" =20 typedef struct PRManagerData { PRManager *pr_mgr; @@ -135,7 +135,7 @@ PRManagerInfoList *qmp_query_pr_managers(Error **errp) { PRManagerInfoList *head =3D NULL; PRManagerInfoList **prev =3D &head; - Object *container =3D container_get(object_get_root(), PR_MANAGER_PATH= ); + Object *container =3D object_get_container(PR_MANAGER_PATH); =20 object_child_foreach(container, query_one_pr_manager, &prev); return head; diff --git a/ui/console.c b/ui/console.c index 5165f17125..914ed2cc76 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1160,7 +1160,7 @@ DisplayState *init_displaystate(void) * all QemuConsoles are created and the order / numbering * doesn't change any more */ name =3D g_strdup_printf("console[%d]", con->index); - object_property_add_child(container_get(object_get_root(), "/backe= nd"), + object_property_add_child(object_get_container("backend"), name, OBJECT(con)); g_free(name); } diff --git a/ui/dbus-chardev.c b/ui/dbus-chardev.c index 1d3a7122a1..bf061cbc93 100644 --- a/ui/dbus-chardev.c +++ b/ui/dbus-chardev.c @@ -106,7 +106,7 @@ dbus_chardev_init(DBusDisplay *dpy) dpy->notifier.notify =3D dbus_display_on_notify; dbus_display_notifier_add(&dpy->notifier); =20 - object_child_foreach(container_get(object_get_root(), "/chardevs"), + object_child_foreach(object_get_container("chardevs"), dbus_display_chardev_foreach, dpy); } =20 --=20 2.45.0