From patchwork Thu Jan 2 15:12:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 854657 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7822328wrq; Thu, 2 Jan 2025 07:15:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXhVH3jNHk/lgxVNsGAVeFNaFOTnuvgRFHQ8FTL8vDYsTTcfdnlTyDs5pP1crcHrhCe4/OV3w==@linaro.org X-Google-Smtp-Source: AGHT+IFal7gnQzn1N6SupBHlcuasYPEJ19ax0A3RYMWntcgCI97Z+qfaj63oDvVwwGMHZDHjuDMU X-Received: by 2002:a05:620a:29d3:b0:7b1:4a2a:9ae0 with SMTP id af79cd13be357-7b9aa934631mr8085613585a.9.1735830918705; Thu, 02 Jan 2025 07:15:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735830918; cv=none; d=google.com; s=arc-20240605; b=AAzSQjFCBCcka4bDz/oHgOfYD3B0T7mZKpJrMjpSSn4ffFY6HZ4WoMfIfY1dQafoE6 w7g9Gd8sqDRCE4nNVlmxNq9NgTXnlGO+VCZyitq3SC3Lnt8Ljb0pJVSJHv8Kehm0RrDi dIrtjQjw5praoXa4gJjzXau4R3MJdndUaO6jcjYPgujZIyq6T1zU1tfbBdBRvPu5cdfu OclUENYNexYX+Xln7xyTl1JZ+7fY9GWIEqQ4tgg+6Q6HFDXwHCJeIZMSZquD5N+C79Aj JP4uZydX+Oc3wR7FXXwahGqT3NSlrBijEE33A9ekOlgZQvs7yXGUSqAMD2pVsDmMiF2H 97cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4ko8bxyqNd4qTqbyGca0rSHQuh29/RSksetMq0xif/o=; fh=PTspa9wvhkaR6hEChXR5orGauuRbRK309fOYTYlWOh4=; b=hcUbfH8i2X6nxp7jADaLIRSSopZc4V0BBjg2fc7nbD7+deSAdellXdeB4Ue+nfD7vc QT8PT4bcYzXiT8f8pYkT9MSsDp6XKKXnwTfvXDom+FyuuCvoh+z6onYHWX4uyrAQoCK6 v+K64EPynjfXJeREj4l9eH7QuBRLnAL0k//recoHar6EOuJruHFSuxPd3FrF+GIhT8Zp 93HLGJ7a3YrTz+ZcE3+/gbOTj5PiwZO39TfSEx9AdLh934fFdIY91vkL8Jlu69IEaQ/+ zCE5ZvQGKb7DU2eox7p/Dd5TCzIeXmidCKi4cPdOhDgH0eqzqZUrmaVFyFloikv4lhfP KHyw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EYKHu2Wx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b9ac2d0db1si3548018885a.204.2025.01.02.07.15.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jan 2025 07:15:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EYKHu2Wx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTMtJ-0007oK-77; Thu, 02 Jan 2025 10:13:41 -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 1tTMtC-0007fi-36 for qemu-devel@nongnu.org; Thu, 02 Jan 2025 10:13:34 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTMt8-0006ae-2J for qemu-devel@nongnu.org; Thu, 02 Jan 2025 10:13:33 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-38633b5dbcfso11058474f8f.2 for ; Thu, 02 Jan 2025 07:13:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735830808; x=1736435608; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4ko8bxyqNd4qTqbyGca0rSHQuh29/RSksetMq0xif/o=; b=EYKHu2WxyvQERoJCzsYT0RM3yejwYlDs2KSJtcwpbEJ3ESvXME5vUXBT2IOfAKyvZx EKw4h5aZQei74DREPtk/okV2D+IOikJKV9CfAeIr4ealghlukWnooss1uFsOtpIlaekd ciswDD0NvkntWeOvDI6pXXeMK1ljjwozUL7HL3yQ9ktZipdYoEXS8772rwBOo6TGOlJY J+mniYdfs7MLVhXNMAg4BDBZ4me6wL5ZcMxZyg1GnA7eDeE/7t/+6Npf1ABuBy0TG+Wf OxndqBJQ78T1h35YATkAPySglxf3T+PPMTRMKql5mjSVMS8pVwYgyswj0OZyibkjsvWt YIFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735830808; x=1736435608; 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=4ko8bxyqNd4qTqbyGca0rSHQuh29/RSksetMq0xif/o=; b=NajY4iKO1Hv8iRDOfRdhcEIPMAnIMI+y9scUkhyLsCZ+UI5VdNOWoctfhvhuzH3AkW kNNVPl8BTNx0CxhB+ng/0k/F0+5st4X09RxWXk2AYYbg7aL46rJ4oh47FXucU3QVGPtW Wt1We4+GQe+AtQOzGrB/XfrAupLKXzXDHnWWKuuzx3LHAKRsD1sEt1+FjIkESKx1pH4V GX6O3sCgJr75ceLO4AVYgw39ca8TcNf1EO5FxpOcSfvoP5DgM/abZRKy55Mu27RscohR FslqI8K6br0JBFSmXu80kxM6FaxuhVVDJRBvxcMhinth748tPmjreFBWpyxpyq63SEX/ ah6g== X-Gm-Message-State: AOJu0YwLz3xPdBckAE0LHoat01wepETvg+3MULg6OGijXndmwjvpCvjP TLw/R9CXCCEWGXU8C+i+KIoTgBC5FF6D8TJ1rC2fLf25mXN0AzvEW7XRUiKDWHkekwNvae6qWcT 9IsrNjA== X-Gm-Gg: ASbGncvVGmBdWC7hKfqrMj5/gbDuWssaGIBTe5td8c55pJe1Vm3dPsT+yfIJuxgyy9p 5XpEOK3Ds4240heVE4B2OXURrsWsRMOGIzAuWvfls5d0X558oKGwFOuAEZEAWIreKVCDtGbTU+d RR1lBp4xrjT76ueiInudNfGEgU+t9jWP9dVgpa/hUCajsTlakJ8gmw7etqYn3NqXJxKQDeTFkS6 TqAyUQrhp6ZOTUovdoMbYgzgrVkyc8Tz4d9IremACxG8Z+iRjRLdHERpVtmh2LTuLlwzYSZ+wRE rz/Q7EDZpXHUa1E79c6GFgCRbPq/VA8= X-Received: by 2002:a05:6000:18a9:b0:386:3835:9fff with SMTP id ffacd0b85a97d-38a22406d43mr41647964f8f.59.1735830807887; Thu, 02 Jan 2025 07:13:27 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4365c08afcbsm464912745e9.21.2025.01.02.07.13.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 02 Jan 2025 07:13:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu-block@nongnu.org, Marcel Apfelbaum , David Hildenbrand , "Michael S. Tsirkin" , Zhenwei Pi , Fam Zheng , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Peter Xu , Richard Henderson , Paolo Bonzini , "Gonglei (Arei)" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 08/10] qom: Use object_get_container() Date: Thu, 2 Jan 2025 16:12:42 +0100 Message-ID: <20250102151244.59357-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250102151244.59357-1-philmd@linaro.org> References: <20250102151244.59357-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Peter Xu Use object_get_container() whenever applicable across the tree. Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20241121192202.4155849-13-peterx@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- 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 1157a149d02..1187b08dacf 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 = NULL; - Object *objs = container_get(object_get_root(), "/objects"); + Object *objs = object_get_container("objects"); object_child_foreach(objs, qmp_query_cryptodev_foreach, &list); @@ -557,7 +557,7 @@ static void cryptodev_backend_stats_cb(StatsResultList **result, switch (target) { case STATS_TARGET_CRYPTODEV: { - Object *objs = container_get(object_get_root(), "/objects"); + Object *objs = object_get_container("objects"); StatsArgs stats_args; stats_args.result.stats = result; stats_args.names = names; diff --git a/chardev/char.c b/chardev/char.c index 44ff116fcda..7705da5ad02 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -48,7 +48,7 @@ Object *get_chardevs_root(void) { - return container_get(object_get_root(), "/chardevs"); + return object_get_container("chardevs"); } static void chr_be_event(Chardev *s, QEMUChrEvent event) diff --git a/qom/object.c b/qom/object.c index 81c06906d30..58897a79a76 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1774,7 +1774,7 @@ Object *object_get_root(void) Object *object_get_objects_root(void) { - return container_get(object_get_root(), "/objects"); + return object_get_container("objects"); } Object *object_get_internal_root(void) diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c index fb5fc297309..1977d99ce0d 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" -#define PR_MANAGER_PATH "/objects" +#define PR_MANAGER_PATH "objects" typedef struct PRManagerData { PRManager *pr_mgr; @@ -135,7 +135,7 @@ PRManagerInfoList *qmp_query_pr_managers(Error **errp) { PRManagerInfoList *head = NULL; PRManagerInfoList **prev = &head; - Object *container = container_get(object_get_root(), PR_MANAGER_PATH); + Object *container = object_get_container(PR_MANAGER_PATH); object_child_foreach(container, query_one_pr_manager, &prev); return head; diff --git a/ui/console.c b/ui/console.c index 5165f171257..914ed2cc76b 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 = g_strdup_printf("console[%d]", con->index); - object_property_add_child(container_get(object_get_root(), "/backend"), + 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 1d3a7122a11..bf061cbc930 100644 --- a/ui/dbus-chardev.c +++ b/ui/dbus-chardev.c @@ -106,7 +106,7 @@ dbus_chardev_init(DBusDisplay *dpy) dpy->notifier.notify = dbus_display_on_notify; dbus_display_notifier_add(&dpy->notifier); - object_child_foreach(container_get(object_get_root(), "/chardevs"), + object_child_foreach(object_get_container("chardevs"), dbus_display_chardev_foreach, dpy); }