From patchwork Fri Feb 3 21:16:22 2023 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: 650114 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp1057250pva; Fri, 3 Feb 2023 13:18:21 -0800 (PST) X-Google-Smtp-Source: AK7set88eH8Sxmw64fFI3tY+X69sgsJAg8+4Giwq9S2KG8mU0+FZJpl0oQVhNYxB9drf4jwTU7Ze X-Received: by 2002:a05:6214:4018:b0:56b:1f26:abe7 with SMTP id kd24-20020a056214401800b0056b1f26abe7mr2492500qvb.9.1675459101719; Fri, 03 Feb 2023 13:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675459101; cv=none; d=google.com; s=arc-20160816; b=J5Z8xFrwk1oqKTH5g0fYjN+cr2Slrypjq3swDV+Ndco7vfdcI5Tx8QTUM+vEr923Mv h6z1p+l2we1Zj+wtwIvuuHA6QF+1uRHU7fa1O/56P1q7zSEZ699rlr550KWmDFaJcPJT DI4wqOzyZiZbyDieiS9CYqgikYgl+UdwZt80zEMApliT/Ga21/oHl/cPSSrxCdIz81WU bp2xgRdjHP4temlo2T3TMwMehCMrbZinG8HRJ7EP0sIJxFJT6xv1xfLrLQUNkUoB+RFl r6ksVuOudoc7IRblwYf6pqrviG9HUbTmnScqVpiWcbqW0wC7IifvZZZ6p9SaxSuiGAgu HyMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=OGeZapY/+C7Q5wAbzvpGBnzexpb2nnt8dwv3yaH3OYo=; b=POAr/MctmSE+YS+urXn/082nT/XNNbapvmyVkE1qvT429Gu8T7HbtN+ex6z8AVORJa 8mJ6xr2TpQdu5npd++7pLef6gYUujiCsj17VW/iUdAMBOcCk5HrR/aeo4+TjTTCWjX+i 4FVmgkJ0/vXR8foCO7hL5F+CWlGqVxw8gTIFr2d8RtK+hyFyN19FCCYDRXnTzlKAgXLn 1/BXOq8lJquVpt3/0F04y2zIQR7zGfz8AdA9WdACpRMvXohB+3zKpIHxpen2d9T4LjSv wG64tSMabbF1NvEm2mTx9l5MIO+qfY6+SQd1h3BPSpHQdcWfC/IWc2NkzfevEiwlMlQu nxAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yZD4WbyR; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j14-20020a05621419ce00b0053c4eefc11esi2885872qvc.475.2023.02.03.13.18.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 13:18:21 -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=yZD4WbyR; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pO3Qd-0000NK-U4; Fri, 03 Feb 2023 16:17:03 -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 1pO3Qb-0000Jt-BS for qemu-devel@nongnu.org; Fri, 03 Feb 2023 16:17:01 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO3QY-0006EE-BA for qemu-devel@nongnu.org; Fri, 03 Feb 2023 16:17:01 -0500 Received: by mail-ej1-x633.google.com with SMTP id dr8so18780093ejc.12 for ; Fri, 03 Feb 2023 13:16:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=OGeZapY/+C7Q5wAbzvpGBnzexpb2nnt8dwv3yaH3OYo=; b=yZD4WbyRB9GnmCAL2FqlWZQ7PakW67Mrh6lNIX0qKn5eouPe2n1LqLXa149nMCKF4n sEaFzQ79HkwnIW2EHXqQJgpAwcoXAjetlnXXioWejffMmHhNY7hDpcv4qcAmKoZqZz+P e/vbOOdFGoD8f3Z2qNlrKsZayb/7BeJ+CKGcMSDTficIXntFl9cnc2IRgJpFr368IKx+ vqRCBaTPooTF30z4AWFsRQNdgMZ+24nFFo7Sglir2hEu92I6oer6C2kiIkbc6bkCn46A f6kfCtGpSjBGiiD35YX0sWjFZSAvd/7SmfgvZ7Fq6gtY8xmj6vJLwSwjmY9ZWaOV8Bnz tfIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=OGeZapY/+C7Q5wAbzvpGBnzexpb2nnt8dwv3yaH3OYo=; b=J/6j3DwgzpEIGkJyB0h5p1pJeuqYdG3nq1ddNFKnSmk0bzZi5IFL9K8oTk1ygBzv6c Q/jYztd6CinAsCLQrbJ2i0iY7fkZ6Flvz1OgyPyCzcyU3RONOZGPamV4MwBN/IjXtDyw Z50H3vw3mp1qHBWo8IBSUVyLfYHLm3W9dEh2waYRYQPdujIeOsoBzlq2T4D07l/XBJ6h rEeOonoj4Sql4FoMIjjv8Szq2ur0hqKtXzyuH/OxNxJAv/1wYlM6OfKTFbevVvHiz7Kp Xb3xBcvU6UiMq77V/y34FWRTL4n6s9HA6wFJ5WRnbNQNd6gXe+XHp1BKIuAHjPkJUZvu b3BQ== X-Gm-Message-State: AO0yUKVayCO2WroiiNuQCCw68C97rtUmQzeBjbyjKcazt8LbcRXxfeSO HDlM6i031KEfqlQCfH2FgmkH/roXzyY1sMqj X-Received: by 2002:a17:906:24c1:b0:87f:5d0a:c610 with SMTP id f1-20020a17090624c100b0087f5d0ac610mr10152218ejb.32.1675459014917; Fri, 03 Feb 2023 13:16:54 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id x26-20020a1709064bda00b00886c1a02d20sm1885320ejv.47.2023.02.03.13.16.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 13:16:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: BALATON Zoltan , Mark Cave-Ayland , qemu-ppc@nongnu.org, =?utf-8?q?Herv=C3=A9_Poussineau?= , =?utf-8?q?C=C3=A9?= =?utf-8?q?dric_Le_Goater?= , Daniel Henrique Barboza , Markus Armbruster , David Gibson , Greg Kurz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 4/5] hw/ppc/spapr: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 22:16:22 +0100 Message-Id: <20230203211623.50930-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203211623.50930-1-philmd@linaro.org> References: <20230203211623.50930-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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=unavailable 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 No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. All calls use either errp=&error_abort or &error_fatal, so converting to the QDev API is almost a no-op (QDev API always uses &error_abort). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Reviewed-by: Cédric Le Goater --- hw/intc/spapr_xive.c | 11 ++++------- hw/intc/xics.c | 4 ++-- hw/intc/xive.c | 4 ++-- hw/ppc/spapr_irq.c | 8 +++----- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c index dc641cc604..213c4cac44 100644 --- a/hw/intc/spapr_xive.c +++ b/hw/intc/spapr_xive.c @@ -310,9 +310,8 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp) /* * Initialize the internal sources, for IPIs and virtual devices. */ - object_property_set_int(OBJECT(xsrc), "nr-irqs", xive->nr_irqs, - &error_fatal); - object_property_set_link(OBJECT(xsrc), "xive", OBJECT(xive), &error_abort); + qdev_prop_set_uint32(DEVICE(xsrc), "nr-irqs", xive->nr_irqs); + qdev_prop_set_link(DEVICE(xsrc), "xive", OBJECT(xive)); if (!qdev_realize(DEVICE(xsrc), NULL, errp)) { return; } @@ -321,10 +320,8 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp) /* * Initialize the END ESB source */ - object_property_set_int(OBJECT(end_xsrc), "nr-ends", xive->nr_irqs, - &error_fatal); - object_property_set_link(OBJECT(end_xsrc), "xive", OBJECT(xive), - &error_abort); + qdev_prop_set_uint32(DEVICE(end_xsrc), "nr-ends", xive->nr_irqs); + qdev_prop_set_link(DEVICE(end_xsrc), "xive", OBJECT(xive)); if (!qdev_realize(DEVICE(end_xsrc), NULL, errp)) { return; } diff --git a/hw/intc/xics.c b/hw/intc/xics.c index c7f8abd71e..2fd1a15153 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -382,8 +382,8 @@ Object *icp_create(Object *cpu, const char *type, XICSFabric *xi, Error **errp) obj = object_new(type); object_property_add_child(cpu, type, obj); object_unref(obj); - object_property_set_link(obj, ICP_PROP_XICS, OBJECT(xi), &error_abort); - object_property_set_link(obj, ICP_PROP_CPU, cpu, &error_abort); + qdev_prop_set_link(DEVICE(obj), ICP_PROP_XICS, OBJECT(xi)); + qdev_prop_set_link(DEVICE(obj), ICP_PROP_CPU, cpu); if (!qdev_realize(DEVICE(obj), NULL, errp)) { object_unparent(obj); obj = NULL; diff --git a/hw/intc/xive.c b/hw/intc/xive.c index a986b96843..0e34035bc6 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -799,8 +799,8 @@ Object *xive_tctx_create(Object *cpu, XivePresenter *xptr, Error **errp) obj = object_new(TYPE_XIVE_TCTX); object_property_add_child(cpu, TYPE_XIVE_TCTX, obj); object_unref(obj); - object_property_set_link(obj, "cpu", cpu, &error_abort); - object_property_set_link(obj, "presenter", OBJECT(xptr), &error_abort); + qdev_prop_set_link(DEVICE(obj), "cpu", cpu); + qdev_prop_set_link(DEVICE(obj), "presenter", OBJECT(xptr)); if (!qdev_realize(DEVICE(obj), NULL, errp)) { object_unparent(obj); return NULL; diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c index a0d1e1298e..283769c074 100644 --- a/hw/ppc/spapr_irq.c +++ b/hw/ppc/spapr_irq.c @@ -313,9 +313,8 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp) obj = object_new(TYPE_ICS_SPAPR); object_property_add_child(OBJECT(spapr), "ics", obj); - object_property_set_link(obj, ICS_PROP_XICS, OBJECT(spapr), - &error_abort); - object_property_set_int(obj, "nr-irqs", smc->nr_xirqs, &error_abort); + qdev_prop_set_link(DEVICE(obj), ICS_PROP_XICS, OBJECT(spapr)); + qdev_prop_set_uint32(DEVICE(obj), "nr-irqs", smc->nr_xirqs); if (!qdev_realize(DEVICE(obj), NULL, errp)) { return; } @@ -335,8 +334,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp) * priority */ qdev_prop_set_uint32(dev, "nr-ends", nr_servers << 3); - object_property_set_link(OBJECT(dev), "xive-fabric", OBJECT(spapr), - &error_abort); + qdev_prop_set_link(dev, "xive-fabric", OBJECT(spapr)); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); spapr->xive = SPAPR_XIVE(dev);