From patchwork Fri Feb 3 18:08:56 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: 650107 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972874pva; Fri, 3 Feb 2023 10:13:19 -0800 (PST) X-Google-Smtp-Source: AK7set/5jIsP6ieqWnUM96uZsKfqCTVEU5ScfdMuR6EENhJE0TSLliPkOqDL+X0MH2yqxXb17hH3 X-Received: by 2002:a05:622a:1789:b0:3b3:b92f:3650 with SMTP id s9-20020a05622a178900b003b3b92f3650mr20295762qtk.62.1675447998864; Fri, 03 Feb 2023 10:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447998; cv=none; d=google.com; s=arc-20160816; b=rM8dfoLlVM/4LitPPicKkPXpBmy2iDwBG3+8Kfht3+PhSoioIQRrKalzPp5uDH1c5t NuOrHbk51gZwBk075zkK7Da/xSELKL46J913i/rizc2J4UPYsUelH7CyWGprrT19bl82 oJT34QX7hAIo3uLSVDR9NmT5oUzZsw2Zu0UufxonX2fvNlvGD9W1Oeu+c6ZiejdXu1DV kfnje1agMwDYuMYDI6V1noiG6hX+xooMU/xnPzsz6AzBmk9MAgKJ6ZuJ2MGfiKNfc7ML NhhQ9QZ1yPV+egNT5ejADysWiaNBRjb64eMa6Q3c796HJ65CNX0IRZdALGirpzljAbc4 kLfg== 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=aWOXT8kEVLd1z9ooQiF6EcLH2zq0UxcZKoFli6u89Ts=; b=RKUR0ZgtV3GLef0PO2cZncjgngnqX7Hbj++QHG/Huz/B4+CuRb1R4++SuqLFxL+1Rx 1ynoy22BnVtPZLe53kW4CjJm/PQlIn90SGileH9lXBrB2R+6uxwLIEf0kdPpMYSonwOQ xlh6sLBA4Vj5e7MeM/SxUDLsLyYDCoZ+n/4Q4cAT9qmE3QdTENZnshK/kHj1wuu6NfbF Vdsgvo2Nnt2YNIsts+gdn5Hy5btHESw6LUtQsc1dyZzCZfH+hDW/8o2P86P7rLLh8sRf u0xkFm2UL1PUE+ZgQNgAZn3P4+QAp3HKTiJUJ5SbQUlcpfT1MNxM+SC/wNcc15WJjk01 LjpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gPkZFkbj; 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 p75-20020a37424e000000b0070696d43a76si2347040qka.6.2023.02.03.10.13.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:13: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=gPkZFkbj; 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 1pO0V6-00071z-5K; Fri, 03 Feb 2023 13:09:28 -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 1pO0V4-00070e-DR for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:26 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0V0-00089k-U8 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:25 -0500 Received: by mail-wr1-x434.google.com with SMTP id q5so5440121wrv.0 for ; Fri, 03 Feb 2023 10:09:22 -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=aWOXT8kEVLd1z9ooQiF6EcLH2zq0UxcZKoFli6u89Ts=; b=gPkZFkbjBPKkz+Lji5ycmEN0K85IEZZIw2q6gtgnPP63BgwKuk/tCW51t36CDwFan0 9XIRHgs7IcwxKJE6Hh5WSOlR3O+FmAiAxwHQ5z2eVUEjoL/5HGaQwGb5UGfdd0gy1LLS 3T57/PRV6YsGTcUJxXG4LOkVsYakxjXsnjXtNBUVG/nXgzyhrldM9fTJXbJZNMQ9Xhnz 3AsgbteWSP7p2lwiFi5f/mKleV0uSkfL95cP9KABfYn1JFAYh00Kz2jNDFkcVGOYdA3F rlYrTm2GhUzlSjGDwdOsMlc/9K5xJ7cBYt+LifPSsYGYyRXrYeOwjSkhkyb7+0FSqYgl VHTA== 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=aWOXT8kEVLd1z9ooQiF6EcLH2zq0UxcZKoFli6u89Ts=; b=RQX26DI744HzLRyAjy38IHkMO+qpP3uQLGsOzweP24puuh9wfMqwTWggLAWvM0NQT3 WI/OUf9QW2R38K/iDD94R9BbTsSEtw9sM8m6an1PGIykx81EPYgKCbArA+4+Ooewm8Ra EDt250sDA7WCE53ltNdFLwOlCon2UQpkVyh6Ip9+DU52TrQ1OM6QxQOAm7IuXbTwj9Vh 1D0Gimx3AkL1x1HMG+GXsXjfl+i1B2uxbCM0O75gTBU+HWoSbnBqHXUVkibgiYeEDfWJ a+OtSWNrjoJOZj3y3tZYtn1uZSzwGd3OY+UFj+w9147v7DAXFu224IexEyRIhKna1IiP BKHA== X-Gm-Message-State: AO0yUKWcoJXnkLSgte0R/HSRnpbWCPd72kRTyBz3Vh1uhP3SZTJeeJn8 vQRdwMHtBEYrXhew8uuOXXWwG/cACcYaHZMb X-Received: by 2002:adf:c713:0:b0:2bf:e05f:53ac with SMTP id k19-20020adfc713000000b002bfe05f53acmr10227055wrg.45.1675447760909; Fri, 03 Feb 2023 10:09:20 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x14-20020a5d60ce000000b002bc7f64efa3sm2501936wrt.29.2023.02.03.10.09.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 01/19] NOTFORMERGE scripts/coccinelle: Add qom-qdev-prop.cocci Date: Fri, 3 Feb 2023 19:08:56 +0100 Message-Id: <20230203180914.49112-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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 Script I used to generate the following patches. This is not an automatic conversion as object_property_set_[u]int() does not specify the type size. Each integer property must then be converted manually. Therefore this script doesn't seem relevant to be committed in the repository. Signed-off-by: Philippe Mathieu-Daudé --- scripts/coccinelle/qom-qdev-prop.cocci | 259 +++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 scripts/coccinelle/qom-qdev-prop.cocci diff --git a/scripts/coccinelle/qom-qdev-prop.cocci b/scripts/coccinelle/qom-qdev-prop.cocci new file mode 100644 index 0000000000..21e6ed2b33 --- /dev/null +++ b/scripts/coccinelle/qom-qdev-prop.cocci @@ -0,0 +1,259 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +// SPDX-FileCopyrightText: Linaro Limited 2023 +// +// Convert QOM set_property() API to QDev set_prop() API equivalent +// +// Only bool / string / link properties are automatically converted. +// Integer properties must be converted manually, since the QOM +// object_property_set_[u]int() helpers don't specify the type size. + + +// +// bool +// + +// bool OBJECT +@@ +typedef DeviceState; +identifier dev; +expression prop, val; +@@ + DeviceState *dev; + ... +- object_property_set_bool(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_bit(dev, prop, val); + +// bool dev +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_bool(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_bit(dev, prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(dev, ...); +| + qdev_realize_and_unref(dev, ...); +) + +// bool DEVICE(dev) +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_bool(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_bit(DEVICE(dev), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(DEVICE(dev), ...); +| + qdev_realize_and_unref(DEVICE(dev), ...); +) + +// bool DEVICE(obj) +@@ +expression obj; +expression prop, val; +@@ +- object_property_set_bool(obj, prop, val, ... /* &error_abort */); ++ qdev_prop_set_bit(DEVICE(obj), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(obj), ...); +| + qdev_realize(DEVICE(obj), ...); +| + qdev_realize_and_unref(DEVICE(obj), ...); +) + + +// +// str +// + +// str OBJECT +@@ +typedef DeviceState; +identifier dev; +expression prop, val; +@@ + DeviceState *dev; + ... +- object_property_set_str(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_string(dev, prop, val); + +// str dev +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_str(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_string(dev, prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(dev, ...); +| + qdev_realize_and_unref(dev, ...); +) + +// str DEVICE(dev) +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_str(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_string(DEVICE(dev), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(DEVICE(dev), ...); +| + qdev_realize_and_unref(DEVICE(dev), ...); +) + +// str DEVICE(obj) +@@ +expression obj; +expression prop, val; +@@ +- object_property_set_str(obj, prop, val, ... /* &error_abort */); ++ qdev_prop_set_string(DEVICE(obj), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(obj), ...); +| + qdev_realize(DEVICE(obj), ...); +| + qdev_realize_and_unref(DEVICE(obj), ...); +) + + +// int OBJECT +@@ +typedef DeviceState; +identifier dev; +expression prop, val; +@@ + DeviceState *dev; + ... +- object_property_set_int(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_XintXX(dev, prop, val); + +// int dev +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_int(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_XintXX(dev, prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(dev, ...); +| + qdev_realize_and_unref(dev, ...); +) + +// int DEVICE(dev) +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_int(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_XintXX(DEVICE(dev), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(DEVICE(dev), ...); +| + qdev_realize_and_unref(DEVICE(dev), ...); +) + +// int DEVICE(obj) +@@ +expression obj; +expression prop, val; +@@ +- object_property_set_int(obj, prop, val, ... /* &error_abort */); ++ qdev_prop_set_XintXX(DEVICE(obj), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(obj), ...); +| + qdev_realize(DEVICE(obj), ...); +| + qdev_realize_and_unref(DEVICE(obj), ...); +) + +// +// link +// + +// link OBJECT +@@ +typedef DeviceState; +identifier dev; +expression prop, val; +@@ + DeviceState *dev; + ... +- object_property_set_link(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_link(dev, prop, val); + +// link dev +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_link(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_link(dev, prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(dev, ...); +| + qdev_realize_and_unref(dev, ...); +) + +// link DEVICE(dev) +@@ +expression dev; +expression prop, val; +@@ +- object_property_set_link(OBJECT(dev), prop, val, ... /* &error_abort */); ++ qdev_prop_set_link(DEVICE(dev), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(dev), ...); +| + qdev_realize(DEVICE(dev), ...); +| + qdev_realize_and_unref(DEVICE(dev), ...); +) + +// link DEVICE(obj) +@@ +expression obj; +expression prop, val; +@@ +- object_property_set_link(obj, prop, val, ... /* &error_abort */); ++ qdev_prop_set_link(DEVICE(obj), prop, val); + ... +( + sysbus_realize(SYS_BUS_DEVICE(obj), ...); +| + qdev_realize(DEVICE(obj), ...); +| + qdev_realize_and_unref(DEVICE(obj), ...); +) From patchwork Fri Feb 3 18:08:57 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: 650088 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971283pva; Fri, 3 Feb 2023 10:10:16 -0800 (PST) X-Google-Smtp-Source: AK7set9CDmliFDyt6nAezSct2WpHCRhePd2y22/bQGcxs0T7K/2U3ICE8+iRYvL7R6YxHQk7ybaZ X-Received: by 2002:a05:6102:370b:b0:3fd:e5b9:bd94 with SMTP id s11-20020a056102370b00b003fde5b9bd94mr7873744vst.1.1675447816385; Fri, 03 Feb 2023 10:10:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447816; cv=none; d=google.com; s=arc-20160816; b=TbXwGqH+ikvDNP0LZiFtEwQGKiVOcABFW+JqAQeqWEll+zqpTJDIU075RhbjaO15qd onMa31jl/O0bKCla98CpvSoqzZxu1BLDlw6F7iAlresOVpdhOJjv3Pb5sSAsFiCo+BJa 977QNAXUVeNIx4Gtx/Dx77Yf7uBUWMeSAmZdwvED7JXkCNblC58ftN1W84FNdhWubXSr zo0tkd8pKbKN8DyyHaDhmjOngn5dNzt+Uz102+mlIo5r4iXOnHAO4u0NxwcddjU3oIwm q10gBYSag5F1wCoRb0ionsTPge6AJEP8v3IrO6oqRI9Xgw9iwpojAp7x9n4Tx9BDJoGP N7ww== 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=LAfKidwXqMyl+hQg1D5zpybmHVz62NdxFnrC9ga08Jw=; b=TBJqYpjQZVB3dEbKRcBqooT4DJ3UETdRPm7cV5rKug9FGuPWWNnmQptYrVZGYmxPDZ omqBZ4o4iyZR5OYsjhXMN/C9zLnH9Eh7AumInrGpe2EqPixJ5ERaQns2GW4qiWQ8fwOn He04gEvzqWwAxe2AJDxy1cirxNXeDqA4RH62vqevXi5hr+O1uPAi0pJoamnhTUSti3AJ fcZLidjNquwLenjbtOeDhaUftBcKA9dfm3+lBhCS6DEOXfnmqv+U/VHn6dMuEDjchYy0 pH5Gw8eYnpzz9OddHN96RbY96LJZeJ4kLbP5VUdbhjSVTnrG7lo/x5BOKSLyynKZw1KP CWEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fCrQpY/B"; 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 h9-20020a67ec89000000b003d3cb342f81si874002vsp.142.2023.02.03.10.10.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:10:16 -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="fCrQpY/B"; 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 1pO0VB-000747-Rd; Fri, 03 Feb 2023 13:09:33 -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 1pO0V7-00072O-Fs for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:29 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0V5-0008Ac-Ok for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:29 -0500 Received: by mail-wr1-x433.google.com with SMTP id h12so5377610wrv.10 for ; Fri, 03 Feb 2023 10:09:27 -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=LAfKidwXqMyl+hQg1D5zpybmHVz62NdxFnrC9ga08Jw=; b=fCrQpY/B0WPvykR/ypTqqefxBK8DwNly0OXMnU2qMfqW5gm4/NtKE1gcc2kOGS4G+R K0K98fG/kenQ8SY4vt9EQKVU8myl/Ab48UmBjG1uu+m6hNrnsZ3vput7UHGf0EAcVMcK ZrcqGBUr6r24pN6eaPDMmy32xkEljZXdb2MpbWO/axaZrpYFGo0TrB+ALPAlLHmffVwh DvLJg0xdWHJOktZltFeByL2u7BYs1idlLzJjzWWdU3nHSXMOYyg97O6uEQuDL8juZWGO CVYtXvMXm89e7Z3onE50xKaZIToE9DDReA4m+Zaw6uC94zBpngm2DlSV9KM2J84TN4Yd rGmA== 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=LAfKidwXqMyl+hQg1D5zpybmHVz62NdxFnrC9ga08Jw=; b=OykUf59fXfz1tvQm1YYG6BsxqNlUTx9H3iiKSdf41b8g7Ojl1RjcI7hayqSXgmys+Y xBbsGAE3KFDxFnAV9EE5wf3FS8wPFal+pIwC1p+ug26RsplgGiHjjb0+VcxnQT+ciO2h xtT6qOto0O5T6iCAxXHcuWUjWrgB/V/pDqWnjJFhEy6CpVaw1A1hhJ42k2isAAPzbohL FE6huRdFRqLsJBnG8D2ke/SNzJgOtm9jYka8cu1uJMUl4hP4N61QVu+DiQD+bhnOFdvP HgaXpLof9S7ZnyTue3rN+0y4kkWfZ7cj0ayvV3zeZ7gYyTL6Un/A33xw5S4eTbaoW1s0 jxJA== X-Gm-Message-State: AO0yUKW1eQF9iyIg3/N/jKBfCrqjDiCXPfhwmxK/uWj5s73n0t8o7HqN Z06Pn7YRtPza/Mo1klLuiEUNGDeAxbywb+d6 X-Received: by 2002:a05:6000:144f:b0:2c3:be89:7c22 with SMTP id v15-20020a056000144f00b002c3be897c22mr5197083wrx.5.1675447766299; Fri, 03 Feb 2023 10:09:26 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p12-20020a5d48cc000000b00241fab5a296sm2474545wrs.40.2023.02.03.10.09.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:25 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH 02/19] hw/qdev: Introduce qdev_prop_set_link() Date: Fri, 3 Feb 2023 19:08:57 +0100 Message-Id: <20230203180914.49112-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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 Introduce qdev_prop_set_link(), equivalent of object_property_set_link() for QDev objects. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/qdev-properties.c | 5 +++++ include/hw/qdev-properties.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 9789a2f5de..46236b1542 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -694,6 +694,11 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj, } } +void qdev_prop_set_link(DeviceState *dev, const char *name, Object *value) +{ + object_property_set_link(OBJECT(dev), name, value, &error_abort); +} + void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value) { object_property_set_bool(OBJECT(dev), name, value, &error_abort); diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 21f399e9a3..c16dbefb2f 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -191,6 +191,7 @@ bool qdev_prop_set_drive_err(DeviceState *dev, const char *name, * Set properties between creation and realization. * @value must be valid. Each property may be set at most once. */ +void qdev_prop_set_link(DeviceState *dev, const char *name, Object *value); void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value); void qdev_prop_set_uint8(DeviceState *dev, const char *name, uint8_t value); void qdev_prop_set_uint16(DeviceState *dev, const char *name, uint16_t value); From patchwork Fri Feb 3 18:08:58 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: 650097 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971955pva; Fri, 3 Feb 2023 10:11:29 -0800 (PST) X-Google-Smtp-Source: AK7set8L4gO3XFatqX12k4vpJQ8wh1s0dZnQ/0Esm+xYwOeHvEesDUeM34s6+4cImvj52WFyOmaS X-Received: by 2002:a05:622a:60c:b0:3b8:6bef:61de with SMTP id z12-20020a05622a060c00b003b86bef61demr17541809qta.34.1675447889197; Fri, 03 Feb 2023 10:11:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447889; cv=none; d=google.com; s=arc-20160816; b=Q0UbeR6zUEMi6VYvuxiLzfi7K8VPMDE1jmK3DyOQlYmaHH6h5ldlSWIvPHHuAXH+KT wx5oL/aNMrJaRh2XQ47c3ucqeJAMOhSy/4I56KsR7V98NJM2oDiPKkHfh7JI1KMQ/XYT UeqfpJaom4zBlxxa+6SdEdjdI1DVdKOYLAbqliZEeCiLY/pi/Wrl+xsTJGrAvMUUOFXv cz7n/5y5+Hs36msWyBCZ/vtVB9WbuQ52B68bZ+XqOOc6lcIfHpbrLAk207M3aCQ0uoDr og2M3vc33H1ycL6RxAhNKkOWobcsjQ3vuSwu8xRyxDamu3C+q9LppvbCAAY3J6l6krQA W8eA== 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=AFuCwAlq5IxtAXriS8uiMD+6Isqin7gOtT5GKermJKY=; b=gNcj3XzEgL3QUKx0TtqFZEvKAOkSXZcF195m+KjPGWyOA2pE75k+GggzE6xOdvoyyk wwR77XUDcPhdAVlmKjx8Tsf3Tq/uiec7wUqE5ubpqQ3M50FdMAU7LyevhDp9QLQqGQ8c YdYoOHEyHzPFrpAHLDTdXQzAa0Af38c1rArhCwlAYzxmJ0wvYp6xiDkBkgY6Ukf0kYFJ 1kvQrtpbBu9HOa/0lXQwaPM1t9EvGJZATp5HAdkRtzoQXn75KZaA6vP6/fo13Oi2I5S7 dE1UKYLqXMvyd4AF8ERaDN1CoWtyu8GFgf1D3b3daZqcgQwNq2FoR+wsM7NBytfIetsA 7M2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QrILnDg5; 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 y18-20020a05622a165200b003b86c95a9d1si429404qtj.346.2023.02.03.10.11.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:11:29 -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=QrILnDg5; 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 1pO0VH-00075T-2Y; Fri, 03 Feb 2023 13:09:39 -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 1pO0VD-00074o-SU for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:37 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0VA-00089h-Vk for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:35 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ba1so1327376wrb.5 for ; Fri, 03 Feb 2023 10:09:31 -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=AFuCwAlq5IxtAXriS8uiMD+6Isqin7gOtT5GKermJKY=; b=QrILnDg56AYQyjEsqvz1V4zQmAKFgde/UZhM1brl+P8lHr3EOHfpF0nLW45Xx6teUB SZIxzh0F0FLcpXB98KbuHykNPHAoMa0d0WEQwWjJhRRwSfQbV58W8pIaqkAulN+uQWMg 2KGfZfL7tLxHNWKTidZYW0F3AHNUkEumd1oNj0tfE0Nv/pI/+ff/lvnPkI4JuQF7C2WX edAeQn3kPLDHxORkSmz7waKWnRWjfCeYsJr+aQ9eg6XZTEC0SwMIvjDV3kXYmvBo0ehE Z5bhqfic2FqyY3SKLpVp9ULWGPWiJRUttecUaWDGm9INJyzFnUlGLRHT0kbF56vgSlss pKkg== 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=AFuCwAlq5IxtAXriS8uiMD+6Isqin7gOtT5GKermJKY=; b=UQwVd45ixoNPIG+gRf8Dsic3tpIiSjKfEM7+XeaIMx/6x/MbgNlAtoOekJiXgwKrn2 +1mwJqC6Ac8j1zeR93LX8pe3SoN7sjNLw78z0zc1yVj0bMWbs4qbJTHWhWvvcmV8upCu daTMHwyJcfm5kGOtUQcvBNb9xmqum/2OK2JQ7DXA5i7xqGbnGdWf2er7y8QykcMRisoz jVyDC2kPnbMKAJbm5s/239E3El4G8NH5pd1yIVi9IPWoGDWGk2CIC7be0rwelugFg+fW NKXm1bIyVU/MjYvIPSaSqaAB2jaztktTGFoZvqNLICiOw32vGlEUzH9IxFzt90t2hmgL Y4Iw== X-Gm-Message-State: AO0yUKWZjsJ2cjGyTBaBc5D0ULq2FchqMImn4NhqUD0UhVJMIMsnTV6c 3aeeUF35nBXtLkp6+1oh6yhPHVCUAxxvxwei X-Received: by 2002:adf:fbc8:0:b0:2bf:ae2f:576f with SMTP id d8-20020adffbc8000000b002bfae2f576fmr9212591wrs.14.1675447771318; Fri, 03 Feb 2023 10:09:31 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e2-20020a5d5002000000b002c3be6ae0b1sm2517659wrt.65.2023.02.03.10.09.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Marcel Apfelbaum , Aurelien Jarno Subject: [PATCH 03/19] hw/acpi: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:08:58 +0100 Message-Id: <20230203180914.49112-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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 No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/acpi/cpu_hotplug.c | 7 +++---- hw/acpi/ich9.c | 4 ++-- hw/acpi/piix4.c | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/acpi/cpu_hotplug.c b/hw/acpi/cpu_hotplug.c index b8c9081738..5bc5f435f4 100644 --- a/hw/acpi/cpu_hotplug.c +++ b/hw/acpi/cpu_hotplug.c @@ -10,6 +10,7 @@ * See the COPYING file in the top-level directory. */ #include "qemu/osdep.h" +#include "hw/qdev-properties.h" #include "hw/acpi/cpu_hotplug.h" #include "qapi/error.h" #include "hw/core/cpu.h" @@ -41,8 +42,7 @@ static void cpu_status_write(void *opaque, hwaddr addr, uint64_t data, */ if (addr == 0 && data == 0) { AcpiCpuHotplug *gpe = opaque; - object_property_set_bool(OBJECT(gpe->parent), "cpu-hotplug-legacy", - false, &error_abort); + qdev_prop_set_bit(gpe->parent, "cpu-hotplug-legacy", false); } } @@ -66,8 +66,7 @@ static void acpi_set_cpu_present_bit(AcpiCpuHotplug *gpe, CPUState *cpu) cpu_id = k->get_arch_id(cpu); if ((cpu_id / 8) >= ACPI_GPE_PROC_LEN) { - object_property_set_bool(OBJECT(gpe->parent), "cpu-hotplug-legacy", - false, &error_abort); + qdev_prop_set_bit(gpe->parent, "cpu-hotplug-legacy", false); return; } diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 6c9a737479..9759119b32 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -30,6 +30,7 @@ #include "hw/pci/pci.h" #include "migration/vmstate.h" #include "qemu/timer.h" +#include "hw/qdev-properties.h" #include "hw/core/cpu.h" #include "sysemu/reset.h" #include "sysemu/runstate.h" @@ -197,8 +198,7 @@ static bool vmstate_test_use_cpuhp(void *opaque) static int vmstate_cpuhp_pre_load(void *opaque) { ICH9LPCPMRegs *s = opaque; - Object *obj = OBJECT(s->gpe.parent); - object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort); + qdev_prop_set_bit(s->gpe.parent, "cpu-hotplug-legacy", false); return 0; } diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 3a61d89f92..9a86d506de 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -206,8 +206,8 @@ static bool vmstate_test_use_cpuhp(void *opaque) static int vmstate_cpuhp_pre_load(void *opaque) { - Object *obj = OBJECT(opaque); - object_property_set_bool(obj, "cpu-hotplug-legacy", false, &error_abort); + PIIX4PMState *s = opaque; + qdev_prop_set_bit(DEVICE(s), "cpu-hotplug-legacy", false); return 0; } From patchwork Fri Feb 3 18:08:59 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: 650093 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971505pva; Fri, 3 Feb 2023 10:10:41 -0800 (PST) X-Google-Smtp-Source: AK7set+O9PofSZN0Wob0YI+oXJUVyYvdSNNyRtIAyxvVsQHgsrCHu2Plk+uF36kJZJm1LW6bBXGT X-Received: by 2002:ac8:5911:0:b0:3b6:2f0d:1925 with SMTP id 17-20020ac85911000000b003b62f0d1925mr21453930qty.64.1675447841315; Fri, 03 Feb 2023 10:10:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447841; cv=none; d=google.com; s=arc-20160816; b=tkWKAuSuIAFJSJHiNjWPwD7tZtXAeiDg+h2er5upAMeA6hV5zlTlP2rEPp7o69aC9I PHd++5/ezFfEIo3atAtQbEULRe8GrTRGWiq/08Y+7O04ZzW1rZQvAiWce0orMq/QgAiA EUPuCplXi0AMhK8tmxSBRk3mQ16slYdDGNoOc64Gn4EYOxlQ6ApWFBMfbCc9dGnph8L4 hf6i1z/jEq/tZsP0Cb2tjifmNU4Kep+YWdG3B1cf+5jdYoML7owc59ZVcoAEpEhCecfM bHHQo/FU82AkgDVxFj06G1zOkI9yXmWnN9hKJ4n3TfiAe60wgNw3s1kCpzzpq3iOLTAs s1kA== 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=oxYMqvC2WwLHgUmtCJqkqqMYVUSw0aYIth92XOROakI=; b=Bf61AfRyBKKpopXnNCNVx780yJWcFbWJgGq7Z4OfkctHnHIk4fbwPPVzRUyWaOhepT M4BYgBiWAbvz453nADChjWPC8W7NL9MV4sGE58u2Iqt+Aaq/CmXsXPgG9qbmKsLJkTer M0OYYQgRtDuoa0CkiF8X1TCR11kZeQOIcBZ1C5QHe3GZCPjvJYKqDD608r1mmUUt9y7S Nu3ZtD9bmC5sGy6wtEi4t8PJMBtjj1d/lcKx/eqpP1jd7FVqF7u0ugtV2m7zAZsdElYA PYyuNAxn/3pnYJmUs0+cmH/XyprV1R3DA/kN8eIm68BvURpVCL15DzS4/m+JMbvadF7t 4PZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AIxg0fdT; 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 d15-20020a05622a05cf00b003b9b1a173easi2226562qtb.740.2023.02.03.10.10.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:10:41 -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=AIxg0fdT; 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 1pO0VL-00077r-8v; Fri, 03 Feb 2023 13:09:43 -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 1pO0VI-00076Z-BZ for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:40 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0VG-0008Dg-E0 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:40 -0500 Received: by mail-wm1-x336.google.com with SMTP id d4-20020a05600c3ac400b003db1de2aef0so4518582wms.2 for ; Fri, 03 Feb 2023 10:09:38 -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=oxYMqvC2WwLHgUmtCJqkqqMYVUSw0aYIth92XOROakI=; b=AIxg0fdTM3g4GbWU+rbgaYy6MBg9x/HWSj4LwdVg6hkUN5Tk8cpDNIHMsJ18d+0rA5 DZprUxgdCUagbFoOEvwxiWh4gPNFsTDESYZ9/5V1kPRoFjLJ+CRsD+L+9tAMz0G80nif aG05M+Mk0aCLYSRRcxHNwiBuwhQuNeCzLnyVtzd9I5/fxQyS8hz4sSQ/xi8pW034Bi8m m31tIvor7j/KEwDqTUa6CvgSRnLo6eUVoo1h6oLhWVIJDcO3jEJu39wDJIg/dXWrMQzd +6EdkUOPcV/dhI/KhSZ+XDs5MPeB16cwsQ4su1HiebHuaA0DShpYCQt4AJzHIJb8cpfI uDcA== 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=oxYMqvC2WwLHgUmtCJqkqqMYVUSw0aYIth92XOROakI=; b=0KmboyBoa9ABtBcJ8dog+4qk064b2TDcH8o4rEGNdsNnqdiej6hZ1L8U8SJXyaDYgw p6Z4ZOlMeN+aQ5eUEFIP2gnvswliUY7YmCv8LG5fk08HL8W/F1TUrfkcEGeV4SjfPcat CxSHGqRGsHzZgdm/CP9f0ETvcsmpf8GmrrsdeCsme+bxAdKUhltjaqcLdcFdBWHkAaDx gpWXmyKrsOE/vM3YGWAizGVyBn+Ny669/9u8ErrPEooaUYSZnU7kI6mh20AXaWp9Kn6/ tHOBotEvGL1wLaFIh+D2BCTwu1eSfttXjO/7S8OZWyrLUAPgHrHZOGqKnYFBCaokx0Pe JhAA== X-Gm-Message-State: AO0yUKWdKYnWc358z1IIiL+y726aW4Th09E6uXSZTxdbh4fAaBing1f8 PIWZLngKvInCy8RVHBjlJ1n0qgPVCvyBu7xB X-Received: by 2002:a05:600c:225a:b0:3df:12ac:7cc9 with SMTP id a26-20020a05600c225a00b003df12ac7cc9mr9619906wmm.15.1675447776870; Fri, 03 Feb 2023 10:09:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t8-20020a05600c2ac800b003ddc781b1d4sm3126424wme.33.2023.02.03.10.09.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:36 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH 04/19] hw/audio: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:08:59 +0100 Message-Id: <20230203180914.49112-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/audio/pcspk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h index 9506179587..e18ca08fa0 100644 --- a/include/hw/audio/pcspk.h +++ b/include/hw/audio/pcspk.h @@ -33,7 +33,7 @@ static inline void pcspk_init(ISADevice *isadev, ISABus *bus, ISADevice *pit) { - object_property_set_link(OBJECT(isadev), "pit", OBJECT(pit), NULL); + qdev_prop_set_link(DEVICE(isadev), "pit", OBJECT(pit)); isa_realize_and_unref(isadev, bus, &error_fatal); } From patchwork Fri Feb 3 18:09:00 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: 650100 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972380pva; Fri, 3 Feb 2023 10:12:22 -0800 (PST) X-Google-Smtp-Source: AK7set9NyPJkgCmyztVuYfLx/PmgJicjHpI3a8gcG/yET0jaStRrHZbvpvwNjtxp9qYhfcQ5t73g X-Received: by 2002:a05:6102:559e:b0:3f1:1a46:6187 with SMTP id dc30-20020a056102559e00b003f11a466187mr7787376vsb.20.1675447941987; Fri, 03 Feb 2023 10:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447941; cv=none; d=google.com; s=arc-20160816; b=MF8UAsOdTJsIYdjEVw1J4j8Ou6BDOP+1zdx349VVBzIvNO3FWynHbxTE2YYMaWVBpt jw0N0VrsDwoxJTvPHYFHRt9lzRGvwlEQxXDznzyQzBBMCa39rTNnfRyStazZh9vaeKIK b6BDV7hEyvnoCQ57T+SO8g1wG9xQ4MioVKQCSbJuoU98GG5L1Z72kcAouicio8Dyhbxn 28IcIfVTUdvwm2lHBQtmKPGFUKGzDfZPc3YyPMp5Mrtwy/C5bjxfYhPiB8oPlvZWwbzN PTJZVwAQDTkudKUIxVgtxuXiJs+3wahToXRbClCBrOjfIBjwdLJCQMjVSRltLphublqB PkWQ== 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=i7hpzOoatAaR1sv90A1kGZcFCN2UpEoRoocI+6JRu0E=; b=uS9s4nQgokS/zf+6nYEBmt5ywSwEM1qEswiGq4LU1NWWEBFUJa2ziX1OCGLrduXdAl rYCVAIlGbrwXnwBn3fqd+U+ZBlLA7WHvX6Ty5uG+MUnTuHsZxPc48TZ2y/WF9Lsymmpa bzUHt9rC5sZp7skPGchsCmOdvuswpZNlyD0sWASLCZRI7cZfTvOoK9YkafnVppGa6EOe Q6zVkMYU7Pmd4fZBHXj+/1GPUerCzNtFW/F1Ma1rTF5kKcOq8FNrQrfkDCZHQZhp0X2L RG1aPb1j4xlcAQ1OlhQdngjRnhHPKDhh8SbARzyIUKdSBIGOQm5H67zfF1FgY0KkRPYr fBlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=z6eTEeWH; 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 n17-20020a0561023ed100b003f86b0c482asi989510vsv.508.2023.02.03.10.12.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12: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=z6eTEeWH; 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 1pO0VO-000796-8X; Fri, 03 Feb 2023 13:09:46 -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 1pO0VN-00078n-81 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:45 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0VL-0008Ed-Pe for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:45 -0500 Received: by mail-wr1-x436.google.com with SMTP id a2so5116401wrd.6 for ; Fri, 03 Feb 2023 10:09:43 -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=i7hpzOoatAaR1sv90A1kGZcFCN2UpEoRoocI+6JRu0E=; b=z6eTEeWHfQXgqllooKcV4N3zoNYO15jzWZdtIsI/zQXKfW4kKTCVtgnUybmZOXl1gw sB7bBMD5AcXW7wkfOyQNIJVWUR8/n8BSUvffXvYyH0yGiS5/axnZ2hCz+gkySmfTrdPZ S2hs6bu03Nq2hTPEmCqqVEbP1bgaXvk1NxfSaf//6Hs8E9ZTrHJewvdHsKuIQwUtNWTG PEdkuQyhc+7LritXI3ro0aO4hUQXNrfjkmJ+cqKEO05cjLQZN4sXmdQ0y8B0k5ndkJSE YVZO2yPPE1bHW1tofInIfuiT5KTWWpBhceySQSjmnBr76EuR8CDCn07FsVIYaCEE+nbE Qh4w== 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=i7hpzOoatAaR1sv90A1kGZcFCN2UpEoRoocI+6JRu0E=; b=z4AOcQAk9m/7snxuQ5ZuPH6oX1F6Kahfsc2bEzaKMSURrh5Tl/gNsl9hXo6n0LH+RS 2pwr1BUdmXMPiJoedY0LhfobmlV867lG1kwyAfNvdISa0XVNoUUmk8qTqDB6wt3WRcPb 6jjl9XCjHwAN2JuU2i5Cibp/5995mIaaMEEHSxdYeG4PGWfB5YPSVNgk1V3sELfaXkAi aB34mcv4MuqZiHn2m9OLCuAnJX2hXe1aZ699V1BnCOVyEOFbjHkwiFUOarFSb2oBxrKH mOrvo9BF1OZn6OUHjXsW0qIVtYX4QgKfSTKEBDSiWziu2ZmlwTKPnoqhYrnIA7kasWFN Aetg== X-Gm-Message-State: AO0yUKVcFk/w2QCxfB6H0YLmKMJj32GiCp/hWsNvEHQACNEHdaMfogwY F2cRZk9rt8/yrgbFmYAmI1x5O5xezC1QLKer X-Received: by 2002:adf:fc88:0:b0:2bf:d940:29b6 with SMTP id g8-20020adffc88000000b002bfd94029b6mr9838575wrr.54.1675447782284; Fri, 03 Feb 2023 10:09:42 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e15-20020a5d65cf000000b002bfc0558ecdsm2513920wrw.113.2023.02.03.10.09.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , Yanan Wang Subject: [RFC PATCH 05/19] hw/core/numa: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:00 +0100 Message-Id: <20230203180914.49112-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index d8d36b16d8..9b6f9848e3 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -34,6 +34,7 @@ #include "qapi/opts-visitor.h" #include "qapi/qapi-visit-machine.h" #include "sysemu/qtest.h" +#include "hw/qdev-properties.h" #include "hw/core/cpu.h" #include "hw/mem/pc-dimm.h" #include "migration/vmstate.h" @@ -740,8 +741,7 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp) /* due to bug in libvirt, it doesn't pass node-id from props on * device_add as expected, so we have to fix it up here */ if (slot->props.has_node_id) { - object_property_set_int(OBJECT(dev), "node-id", - slot->props.node_id, errp); + qdev_prop_set_int32(dev, "node-id", slot->props.node_id); } } else if (node_id != slot->props.node_id) { error_setg(errp, "invalid node-id, must be %"PRId64, From patchwork Fri Feb 3 18:09:01 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: 650090 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971404pva; Fri, 3 Feb 2023 10:10:31 -0800 (PST) X-Google-Smtp-Source: AK7set+XQvY8NLz3K3m/rZqQ6omwsJ/MmIlaFJ2Dh4lefqLYt2BBpdEQhTkz6OxmiY/zEDT6+2V6 X-Received: by 2002:a1f:ee49:0:b0:3df:d8a5:ab51 with SMTP id m70-20020a1fee49000000b003dfd8a5ab51mr5097808vkh.16.1675447830791; Fri, 03 Feb 2023 10:10:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447830; cv=none; d=google.com; s=arc-20160816; b=v4LPST0PUQ2Ud7jHPLTRfn3OIbgCQy+xyZvuINmLSJa0q4xjBMP88OdJZUYgS1MV41 JtVXL+NyGlWBJeY4IuYyBsVv9F0JWAscwyvf08Tsrt08of/FnlEmq9L7DK10WTngbU3I IgR/n9xa+/Fac7pZsFn2ObT9f5LuqAHu4A5oQ7AgHKb+HwTL1JO+cxWqvsxlN0wAalnZ v5h7I7hdm5s5C9OyP1DV4rkNDp8eUgJzz1jVkooyVnXfeDg5TURtwBlRy10H+u9EyX/k YLf5oahIbh4tNq2kEF4/TTPXIoG0LyUMMvB4ykgQs9cjxhXsAy6VtpXEr8wQarRWtB7O kkmA== 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=9NgUd8czy/KtDDSBdj4dPqj7LZDSjTfVH8TLfiduuJo=; b=nK6idzsQt7eYLCYXcFUFj69ORh+UNoO2eDVmnIFmfuY1+cg0jwb8CpB70NsSCJASZH 4oHrke1LCAJ98DYVetHS06r3z/Jztm66H7mrHovxiDeZYDhe5LXqGNq+ogTn5kA6aRZV Jf5/wpHbZUwD+hcnUuF0b5gSRXWCnOmfm7TZCwduHTCwZjNTagpu5pYpdW7JBCKq3qvk 1uPkp9Ol4l7DYLi63iD+hsUWvxFIULjOX838jUmgyyJo1Vj1GaofFWAHLwPFVwOOdDT2 CTVrL3xLr0KUyKj0+07m1VFeqeKzQXo0uGSF9ZLRyH7pwAoR8ulHrW3twlOs3L5xhYqF NFfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CU3fbR7l; 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 y2-20020ab025c2000000b0067ac7242e60si1045360uan.114.2023.02.03.10.10.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:10:30 -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=CU3fbR7l; 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 1pO0VT-0007KR-Cd; Fri, 03 Feb 2023 13:09:51 -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 1pO0VS-0007EI-MM for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:50 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0VQ-0008AZ-Pz for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:50 -0500 Received: by mail-wr1-x42e.google.com with SMTP id r2so5385000wrv.7 for ; Fri, 03 Feb 2023 10:09:48 -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=9NgUd8czy/KtDDSBdj4dPqj7LZDSjTfVH8TLfiduuJo=; b=CU3fbR7lJ21Zn2niwiaBP9zRXcde3Bp5hkgZKitC/NfkXXYKdnaY5J0YIFGwWchBkD PfBFF/550g9rH+CnIRr+cpZE85Qsg10BDkjRPbLiuJLFUak/uxStv2bzf3HnyfIrpCoP m0tnc1rcG+9kcc5RPtTTpenyE7v/d0IMMhihdPr5h2i6m+MLvZuCiQsAJHH7sf3rnhIk 2KdSGc+0HcOLcPiObSgclwwLbvKSP+VrynaV04kGTwsTGvlmNDsKnFZb1C/bTP+qSiRv UuPMh78uRUkdknby3TI78D/4oM3Swn48Is5V16I28dpw1KjT6nfkGklaxygI2r1/ACV+ EiCw== 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=9NgUd8czy/KtDDSBdj4dPqj7LZDSjTfVH8TLfiduuJo=; b=blBmkLDUAPH82K0Lt2SRAJghfnYzxVyxzpO8cd1S+Qa5/0MmiUlKJYSu8kN/U3qEr8 WGuzDrOi8+um1lisfOccCvEPceXJaulDvFJd4F4umgl01HLh0Ud3Zush6HH0bErlNwRL 5uRRfMQo+yGcpD8RUC+dnoih24twRpRexLv2RLAGydo3oa/8DY0LEk8WrVc9ECWg6TEC cAbqmguUiMVLv8EnyLZITiOb0gBgNJAsCdqFjOl6u9mndluZu0HmDlxFLUgipfTOluRs vSQRIJaXO6nZ39/clxSEqgt+Amz3xAIFS9CadHb5hbO3BlGOmmITZzt7TgF4UQ+4Iy8k J3wg== X-Gm-Message-State: AO0yUKVWFuSUyPxaj8dLIb6OaxHuNaIHw4+sj5AwVdfhVlCJ69B37Z+k Kp+rqOLNV2OzRPf1Ux5cDVSIBMINHJvr8hfL X-Received: by 2002:a05:6000:15c3:b0:2bf:e7c4:898a with SMTP id y3-20020a05600015c300b002bfe7c4898amr4916904wry.51.1675447787974; Fri, 03 Feb 2023 10:09:47 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p14-20020a5d68ce000000b002c3da499290sm1422762wrw.84.2023.02.03.10.09.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 06/19] hw/core/gpio: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:01 +0100 Message-Id: <20230203180914.49112-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/gpio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/core/gpio.c b/hw/core/gpio.c index 80d07a6ec9..ba05dfa92e 100644 --- a/hw/core/gpio.c +++ b/hw/core/gpio.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "hw/qdev-core.h" +#include "hw/qdev-properties.h" #include "hw/irq.h" #include "qapi/error.h" @@ -120,13 +121,12 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n, char *propname = g_strdup_printf("%s[%d]", name ? name : "unnamed-gpio-out", n); if (input_pin && !OBJECT(input_pin)->parent) { - /* We need a name for object_property_set_link to work */ + /* We need a name for qdev_prop_set_link to work */ object_property_add_child(container_get(qdev_get_machine(), "/unattached"), "non-qdev-gpio[*]", OBJECT(input_pin)); } - object_property_set_link(OBJECT(dev), propname, - OBJECT(input_pin), &error_abort); + qdev_prop_set_link(dev, propname, OBJECT(input_pin)); g_free(propname); } @@ -152,7 +152,7 @@ static qemu_irq qdev_disconnect_gpio_out_named(DeviceState *dev, qemu_irq ret = (qemu_irq)object_property_get_link(OBJECT(dev), propname, NULL); if (ret) { - object_property_set_link(OBJECT(dev), propname, NULL, NULL); + qdev_prop_set_link(dev, propname, NULL); } g_free(propname); return ret; From patchwork Fri Feb 3 18:09:02 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: 650092 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971470pva; Fri, 3 Feb 2023 10:10:38 -0800 (PST) X-Google-Smtp-Source: AK7set/AZq1on3+fOWB3oIMOT7I+1TWptxrhk5TWQxmEbh5WGjwiUXk/OocgiC5CfinrbollTlhG X-Received: by 2002:ad4:4e8a:0:b0:537:4d43:9c55 with SMTP id dy10-20020ad44e8a000000b005374d439c55mr16066502qvb.39.1675447837992; Fri, 03 Feb 2023 10:10:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447837; cv=none; d=google.com; s=arc-20160816; b=aaL0BTOyb6PJJqcf4neDx5yynLhRHqqVzFFZ5cmWRSvU2ETdssAvnlW9IWzwzoxVH7 qNU1Q0eoste9WCVpbrerYXDS4qLXhnJ2CtbozQ0kBiruzHu6ekB4eBobF6z1g3JQNABV +0GGpJzl318zSXoxa6+SDyZHwK5mhat+FyOm82fTuo6tSkNBxgIsXKf7rKBRFHa5lb1D 8nRc8n3N6Dm6/gwF/xx6TTcqh9v6D6v7A4J27j17cGC62Qwi60sNTkdDsCkAdNzxdXEj 5OXm8QduaG+sTzuQnH7kKHcSkfxXPLAf7QryNK8iH30VsS59ruAYuJrZDEZ120UheTB5 sH7A== 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=HN76CBKBfX1G0l+y+g6vAhVD6/TboUIvvYwPXW3Iexo=; b=j6umIntdIKh7Jogy18uFth59hQnqvOyp4GkDz3//m3NUjDNvKoZ9x5zXKCcK6GVyOV PoEm1lWQ6oVU67ZC6u85SZTQ4ziTE013BlySRqIUkkjmtRyxCfzTs779wXOT/C8zNaJy gsOtx3CgQelUA2b/Byhtxtgggc3IuTv7pBTp9yfiDV2AVSrP6YRGHuJTdJI7LXevVM7Z 6jEudZbHHvPQd3nEgAFYoYi2cZWAonPxccMG25G+2fN+vdRXRgtNBk0D0JS8zACLkKZ8 dvAyTWEYeBX/Vz4vTg+sYGYzZn8MIY/TfgDYbhalUSJ0a+VzPJdEevKjv+RrlF9cn9t+ gLww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m1WjmgwM; 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 o12-20020a05622a008c00b003b86a606052si2575852qtw.383.2023.02.03.10.10.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:10:37 -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=m1WjmgwM; 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 1pO0Vs-0007yJ-Uz; Fri, 03 Feb 2023 13:10:17 -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 1pO0Va-0007kc-8i for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:59 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0VW-0008GN-H9 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:56 -0500 Received: by mail-wm1-x331.google.com with SMTP id n28-20020a05600c3b9c00b003ddca7a2bcbso4506401wms.3 for ; Fri, 03 Feb 2023 10:09:54 -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=HN76CBKBfX1G0l+y+g6vAhVD6/TboUIvvYwPXW3Iexo=; b=m1WjmgwMPOsNtLA5YA0t19cIA3HGnEQVECoOhLU6AGpzzoZQbcGqpC0JvenMkr52s3 +nXpucNnq828lAZTK+n3yA3GMjt4hoBXVPrlEm8NOds3KrxM6x63NJxhDptUlqTEof2H 5Pv9svm6Qdyjxjr7FFrxZ1nUGGg6V2EOysUSqxPFc+SlY3JDuIsbW9K0ftIHSjOWo2Aj rAQv87SvACTrrEY82Ch7p3q9Dij2pnj6OQfJAUI0Wyo4cV9hc/bCA3j25ofvY9GVqEDV m375OaiEzlgiKCsxl/n5c5MDU5+Tc9HIYlEZ9iH8QtFK3YcukSCoVH5tWdwmnCyVnyar nezw== 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=HN76CBKBfX1G0l+y+g6vAhVD6/TboUIvvYwPXW3Iexo=; b=CFdS5j7GjiAPPul47O2tQSpVDPIbFSzStr+vzT3998aniwZ7y3W8wxKL5+sn47g2Ib P4qiuwXbXyG2foXXr0M7dq7FCE1kx7A4pQ7jaaooMzkUZcvXqj3Df0axrckLvigFU7KU W6WZa5lYcMpYfFAA72bz4ELr8YnVfT2hZrxUmcD7sVngm0ivRTEdUt9zmt/r3HNVphM+ prJd5+sYHlame2+zKn46KGHOedtsBi94DHrhJwEaY5Dj9EGONk2T/JtmQHpqRtyXzlu7 F6SDT2vQ0Q15djwVCPki0TN0txsti03CR8SI/EzRpWmnCMN4D8HWECfH/M0DUuIH1CM7 L8dg== X-Gm-Message-State: AO0yUKUwefJlQDacl45WK8EXypjo7ENyxGM2ipsYbhx9qYKOA3fihJF8 iPB9FyLZY5ha8hBpPNEr/MMP0ieHKXx4c36I X-Received: by 2002:a1c:f307:0:b0:3dc:50be:9206 with SMTP id q7-20020a1cf307000000b003dc50be9206mr11541740wmq.4.1675447792935; Fri, 03 Feb 2023 10:09:52 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id x9-20020a5d4449000000b002c3cf230b60sm2184162wrr.73.2023.02.03.10.09.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Fam Zheng Subject: [RFC PATCH 07/19] hw/scsi: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:02 +0100 Message-Id: <20230203180914.49112-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/scsi/scsi-bus.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index ceceafb2cd..a8003126c4 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -347,11 +347,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, object_unparent(OBJECT(dev)); return NULL; } - if (!object_property_set_bool(OBJECT(dev), "share-rw", share_rw, errp)) { - object_unparent(OBJECT(dev)); - return NULL; - } - + qdev_prop_set_bit(dev, "share-rw", share_rw); qdev_prop_set_enum(dev, "rerror", rerror); qdev_prop_set_enum(dev, "werror", werror); From patchwork Fri Feb 3 18:09:03 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: 650104 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972565pva; Fri, 3 Feb 2023 10:12:46 -0800 (PST) X-Google-Smtp-Source: AK7set8G5kWU/WV8M8z+ph6E/o5ff05hcPL5jDpL113tHOykNHWLL1CRP7ZTgExW95ahsFaPVJax X-Received: by 2002:a05:6102:3f12:b0:3fc:96e0:e868 with SMTP id k18-20020a0561023f1200b003fc96e0e868mr3604029vsv.12.1675447966518; Fri, 03 Feb 2023 10:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447966; cv=none; d=google.com; s=arc-20160816; b=OvAPnttk+Ck98IlyIitCQ2W1cRnWlXX2gS4IGDlrYwQZ8V5DG8JCA9iLSbcKcvGphN 6lqPWj1WaDW8WARhnDbXdG8yi/SdM8ONRyBQo8z+HP3DpGuFDAu22af1svhsTI9roQzX Lml235xnu+hKqWMCSHacogZEunkU28577bQecVBmkN5DlQnH2gu95EQ/eVC02PXKSNRr vd2Z/beDwiySvPlnQkL4tgZBO/FY9BFSRgde9yCGXXVQuJ8+2VuVGBRqFtn9/JP1LteS c9XzqffIIrAA5CPRu0loA5b7exYq7fcaxMVx0raQT+gFFOS8REmViUmm/7YSCwraSJBb 9QSw== 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=8vovJOcxBVU6DoLhiHtjRCI4bXKmNwzDO1xetqBbwJw=; b=cRNdL3L2fS3EDB56IhFwtury9aroyD4bFyLxJboac5iTMyUxc/ykH2YFIpr3uhc7nA 5FTC2Ylg9T1XUIUi9z33sg+eIa5vseXG8hMxv4jtOCFAALHRY3z2SQ6oHceDZVQYu+J1 mmMcm8dceDnF1cfLSOl89S12/SsHN2+abK6wj4cfxAmxsmKyKmkFRJBH5eQh9QAaapb9 3JzS7eeKuDWr3kSTApO84GxVL2lXH2KzZ6+KoDBDTZwaI+G2pbGkYoh1cQC9HUxVJoAU 3l7m4L/iAuFQ870uHNZuW4zyzHK9+QT/BNT33xjmATHdCWjIPgJjpyIjazzInZf+2pmb ykDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UOROVGJf; 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 o7-20020a67fbc7000000b003f698c6b2c0si840504vsr.494.2023.02.03.10.12.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12:46 -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=UOROVGJf; 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 1pO0Vt-00085b-Dd; Fri, 03 Feb 2023 13:10:17 -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 1pO0Vc-0007nH-43 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:02 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0Va-0008Ed-KT for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:09:59 -0500 Received: by mail-wr1-x436.google.com with SMTP id a2so5116955wrd.6 for ; Fri, 03 Feb 2023 10:09:58 -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=8vovJOcxBVU6DoLhiHtjRCI4bXKmNwzDO1xetqBbwJw=; b=UOROVGJf2LhPr752Dw/+I93w8jyObbZA3IhAvPk00odJTomcoFC44+VlywzefzTQBI 87UOdzz6xjb3/z/Ugj3dHNwazZt3412OTsoijUEPdpUp3MBFD7cH/6bhCR93Oimgr3gn hIhsa1QlaaC8RTcuQafvT4FTWWrinb1RaHh9Spr8Jw5wKNAitKVz2wLDnQ+e555kKLLv AqcGsxNra2OcpD6xxVviE4L0YwJ1GnLN2VGeyW0ylWgc7UCY607BbK7njSwVVNduiAoG 42IQvlighScOqCP5CeI0+K/sIHTT28zzDnBRXMZbFRHtSH9igpqtd/kIbuR+6dUT86Pd PAvw== 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=8vovJOcxBVU6DoLhiHtjRCI4bXKmNwzDO1xetqBbwJw=; b=P4ElLj7KdNouJyzPRFpRXBFOhSl1OIb2gG2BV3q7ypG6vQWpqm4BZ0ROYW/ABwhqj3 9aIIPoqvJeVQjxLlR2Zb1hHmoPlzhK8E109G2Mo9GzzNLx/GKmFpsRAlLEduiG84tBZv TkOiGUq6D7tuB5xvDHdjl9IovN01UNNFChwHzjmcKMyV1AMbp6mAMbPAIQdnEwX+hsnM L1PgVVnpjBuE3Qo59/bZ6vgZmPKLPUdz2IlE2FuqKrZoYLuBKQYwYX0sz8O5llqeIZ7Z 2TdWDatLNqPabqgdvcniYnfkEkgqhRrbFkoppPWqK/REZNWxkb9PuviTvacvQbYG1DhD /z4A== X-Gm-Message-State: AO0yUKWJD7e79CMTkaXOehu+j3axJC+ZvghWPa0K3hFc1JIF9D+wftIP IcQyeTdEJCt8zisrSzJaAdbb+tw9rBo1qfZi X-Received: by 2002:a5d:456e:0:b0:2c3:db61:20ec with SMTP id a14-20020a5d456e000000b002c3db6120ecmr719672wrc.23.1675447797782; Fri, 03 Feb 2023 10:09:57 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z16-20020a5d4d10000000b002bbed1388a5sm2528636wrt.15.2023.02.03.10.09.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:09:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH 08/19] hw/usb: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:03 +0100 Message-Id: <20230203180914.49112-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/hcd-xhci-pci.c | 2 +- hw/usb/hcd-xhci-sysbus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c index 643d4643e4..7511af4ce2 100644 --- a/hw/usb/hcd-xhci-pci.c +++ b/hw/usb/hcd-xhci-pci.c @@ -115,7 +115,7 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) dev->config[PCI_CACHE_LINE_SIZE] = 0x10; dev->config[0x60] = 0x30; /* release number */ - object_property_set_link(OBJECT(&s->xhci), "host", OBJECT(s), NULL); + qdev_prop_set_link(DEVICE(&s->xhci), "host", OBJECT(s)); s->xhci.intr_update = xhci_pci_intr_update; s->xhci.intr_raise = xhci_pci_intr_raise; if (!qdev_realize(DEVICE(&s->xhci), NULL, errp)) { diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c index faf57b4797..d73c71015b 100644 --- a/hw/usb/hcd-xhci-sysbus.c +++ b/hw/usb/hcd-xhci-sysbus.c @@ -36,7 +36,7 @@ static void xhci_sysbus_realize(DeviceState *dev, Error **errp) { XHCISysbusState *s = XHCI_SYSBUS(dev); - object_property_set_link(OBJECT(&s->xhci), "host", OBJECT(s), NULL); + qdev_prop_set_link(DEVICE(&s->xhci), "host", OBJECT(s)); if (!qdev_realize(DEVICE(&s->xhci), NULL, errp)) { return; } From patchwork Fri Feb 3 18:09:04 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: 650103 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972562pva; Fri, 3 Feb 2023 10:12:46 -0800 (PST) X-Google-Smtp-Source: AK7set8eAzK2Tylg/2I2TbERYvLvXghml7vK76ftykBkYOZ8+OBlqeALoqvO/qsdrI9NkaqPoAvM X-Received: by 2002:ac8:5c48:0:b0:3b9:a965:7af2 with SMTP id j8-20020ac85c48000000b003b9a9657af2mr21056510qtj.45.1675447966399; Fri, 03 Feb 2023 10:12:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447966; cv=none; d=google.com; s=arc-20160816; b=Pv0ykiQRHX1JKB3asDUgHWQsMJ+aSRjIVKjqKsDmcBKu2VOauSBDZSR1GPn9uAmueN N5FJ3sDrVoFXiKXqrJj0Y+1SWmBGwahQxWkzdT4J92iS48T9Y094O+Rr62u+zz6VEunF gcTsQAHY3N8FodFjFbfgfnfOiT8bU8Rc+09ro8MS+59+pmSh8bvHmwpX5okWdWatOTgZ yFJDcV5KrnRG44gGKCPCYe8G/BFPBwYi/fu/U+DriUsuAINykFW8VYP0bFNy/t71LWIF UmuxZxQ+P2acXZuznptHJ2nVzsECiR/YlsiJfl7025YHfaz6dGmtNwhh5v8hQByqp8K9 i9Qw== 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=V3znBLdxa21Tu18faQjYPm9R9046mIKBOmimiGYT9hQ=; b=Fz7pWIGROIjHsu3guHWqu0DEPxgeWuzLNsy6I0KXeSxdTqvUIWmOIGw7Mmuj9C8UBB Ivx9TulgZAFHlTYgN0hg1FlZDEWgVknsEAWxoR58+CTVhIpjGUNaRHhnRc7MetB6dTZL TZk1x1CTdZqcu3HOO/hhTJ8Ou5a7dVub/UJ2YSgzRqb9RW+79lDfD5PGg6Sk0iXJpr0y Oa+hJE3CQxPYbFxflsgEmJrRWIlP0fcJ8C2yorvuJqc33F9a5EjwBeZ3JtaffP1uE57x 1sWj4Wgd07WbhZrXuQWllNjMZ641AD3ZZOXonDs4iXWGYVacTrcnXuiMdQaf4BK2gk2U uaxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O9roaJhE; 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 l10-20020a05622a174a00b003a4fcbf5f9asi2337384qtk.460.2023.02.03.10.12.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12:46 -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=O9roaJhE; 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 1pO0Vv-0008Li-7Y; Fri, 03 Feb 2023 13:10:19 -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 1pO0Vl-0007vV-UO for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:13 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0Vh-0008KM-Bn for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:07 -0500 Received: by mail-wm1-x329.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso6580707wmp.3 for ; Fri, 03 Feb 2023 10:10:04 -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=V3znBLdxa21Tu18faQjYPm9R9046mIKBOmimiGYT9hQ=; b=O9roaJhEXXpqBmpuEROKq4byJ3gg9i32m9326CRmwk5Z2eMo+raTyxMmOce8qMDguv 8946eIACsPWOsgTQN22QNcIKWYdJtSiqjnoajHZS2CJ6+0NPbXQbyO/r5oviwbMXEMQd Ms/GBnz2HaMYwUzjGDvEoTs+dtB+eYaO/xCu3wVWWZBb7Uk+8xKFIyAPcwZoLaEGtvoF YbZTbqsBiyoyCdb4xsmL+8ERvhOz8msQsCWR5T1LMq++CJ6MtkR6u+RXcvVMHuZ95tEx TnPyFq4lyochTvrqdvSxRkyz7J/M6WKEbbmJ/bGKGAqkC0SrktWOp4431aMaSIe64wpz hKIA== 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=V3znBLdxa21Tu18faQjYPm9R9046mIKBOmimiGYT9hQ=; b=NVn07fpn1TT9/DtYib1EefXBIKJSrtEyw4aZ2yvOt5XukpclfyagC3vSz0i7imdwBA FOCG5WeLTl4bpd19E0ylKvMm0sXdYhp6kqJsmhAZ05T5tCk1+6CHO/S1o7OwA1A1P2lK MRSRmIO8HxHntfD3zEUeNdTYqmXVIgCtXzr00bfGG2A7JDh8MDQFhLqK3i9oHETwOUYu 8kQHRX+IA4GYGT9H/cm/o9xfISBdMOQlzxXltt9JZbQ5vvtx0EhUetMxYw9A3mcb6q5D 56aBBRN9qT0aQJ7w00xmvK5DDtffFxLwTyj/Tx6yEFWpMVOIG+yl3twni/iJJR+31wfT 8Wkg== X-Gm-Message-State: AO0yUKVIMqDUn2/VlU0N0wg+PIkPkzNdZ8dvkqodfnXXl1B2AJXZE1/r KBAjSy63cCMFFfOmDbqs661ySQmWvv9Ava4x X-Received: by 2002:a05:600c:474f:b0:3df:e57d:f4d0 with SMTP id w15-20020a05600c474f00b003dfe57df4d0mr3636532wmo.26.1675447802797; Fri, 03 Feb 2023 10:10:02 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r17-20020a05600c459100b003dee8c5d814sm8834578wmo.24.2023.02.03.10.10.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , "Michael S. Tsirkin" , Eric Auger , Laurent Vivier , Amit Shah Subject: [PATCH 09/19] hw/virtio: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:04 +0100 Message-Id: <20230203180914.49112-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/display/virtio-gpu-pci.c | 4 ++-- hw/display/virtio-vga.c | 4 ++-- hw/virtio/virtio-iommu-pci.c | 3 +-- hw/virtio/virtio-rng.c | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c index 93f214ff58..a2de06962b 100644 --- a/hw/display/virtio-gpu-pci.c +++ b/hw/display/virtio-gpu-pci.c @@ -39,8 +39,8 @@ static void virtio_gpu_pci_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp) } for (i = 0; i < g->conf.max_outputs; i++) { - object_property_set_link(OBJECT(g->scanout[i].con), "device", - OBJECT(vpci_dev), &error_abort); + qdev_prop_set_link(DEVICE(g->scanout[i].con), "device", + OBJECT(vpci_dev)); } } diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c index e6fb0aa876..1652d74657 100644 --- a/hw/display/virtio-vga.c +++ b/hw/display/virtio-vga.c @@ -160,8 +160,8 @@ static void virtio_vga_base_realize(VirtIOPCIProxy *vpci_dev, Error **errp) graphic_console_set_hwops(vga->con, &virtio_vga_base_ops, vvga); for (i = 0; i < g->conf.max_outputs; i++) { - object_property_set_link(OBJECT(g->scanout[i].con), "device", - OBJECT(vpci_dev), &error_abort); + qdev_prop_set_link(DEVICE(g->scanout[i].con), "device", + OBJECT(vpci_dev)); } } diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 7ef2f9dcdb..f7edcb39db 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -67,8 +67,7 @@ static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) return; } - object_property_set_link(OBJECT(dev), "primary-bus", - OBJECT(pbus), &error_abort); + qdev_prop_set_link(DEVICE(dev), "primary-bus", OBJECT(pbus)); virtio_pci_force_virtio_1(vpci_dev); qdev_realize(vdev, BUS(&vpci_dev->bus), errp); diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index 7e12fc03bf..6733e5b017 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -205,8 +205,7 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp) /* The child property took a reference, we can safely drop ours now */ object_unref(default_backend); - object_property_set_link(OBJECT(dev), "rng", default_backend, - &error_abort); + qdev_prop_set_link(dev, "rng", default_backend); } vrng->rng = vrng->conf.rng; From patchwork Fri Feb 3 18:09:05 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: 650091 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971416pva; Fri, 3 Feb 2023 10:10:32 -0800 (PST) X-Google-Smtp-Source: AK7set+TwRHhQHVSlKw/CULFtf/h+z6flyw4EHqpMWhJ1u73wEnpgQqakyDbPNWD7G+ejfxqXepb X-Received: by 2002:a0c:e9c9:0:b0:538:4c7b:fa9 with SMTP id q9-20020a0ce9c9000000b005384c7b0fa9mr15673847qvo.0.1675447832597; Fri, 03 Feb 2023 10:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447832; cv=none; d=google.com; s=arc-20160816; b=iCRLMzkDfv3lRzilIqG1cmRTd8A1ZOi6SN74iAHhu45ughrMAYhID2gBlxwbR71B4c ZKLVtDWn7ty7Ew5bql6Zn+tbp8PPVsxEoGSiUqiyyUWYfrzuIfCVjzIlt15sIevjEtZT yozk0TS6khyRLcK8RY3ayBpRul5bTefB2iMl/lK3jZcdr90RWiZlJ+xT4Iebqj63DgMG M7/DzeUCzv0KPGO2ObaupO69/kohBbeec2K9FON6xVPZGr3FSGhvd/ExYJ+sUhtryHvs SduSfSvlCGYn/Sv2zFhwmGZQPDO3ToIEVJbofbz6jZ+WE4jCSM55CT5zSac5EvebKWUm nnGw== 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=FNLse2ZcD75ram/6R7ZT7oCmOqU0RAt0KF/SNVgLID4=; b=MC/kuC08TfntzyFyJc/zgcyxUxHx5pRqsIjlZCjtz/s4OaDyYt9E6BWjZWMy2sCeYI ojka6IOxqjS9VYKw9bzYYryBr42JqIDWnNN3YOjJ/oaz1KxNhGQfJMu2akZrz5JHhXDw b2Dh0YkY3O4P+STjtEpoaKcY26DF4s6G7dkVCTeFHvz6pWX61KS62y2oFE1GZXLhPGfK 4g7vo9oQlbuMQYX4Cp1MXzM7abT9oU7YvfN1yJOncSq/Y4Chc3p+xsHElBLAyq4umbX3 X8sbHBCOesRoyp95NkLic56LDE5Byst1W0bcdQ5OxoT6cVRXz2s+vRRf727JwqmZm/MF W+Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F4kQFrxY; 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 x66-20020a37ae45000000b0072ce109a7d7si2218214qke.233.2023.02.03.10.10.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:10:32 -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=F4kQFrxY; 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 1pO0Vw-0008W3-Ly; Fri, 03 Feb 2023 13:10:20 -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 1pO0Vp-0007xk-0I for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:15 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0Vm-0008Aa-AQ for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:11 -0500 Received: by mail-wr1-x42a.google.com with SMTP id bk16so5374327wrb.11 for ; Fri, 03 Feb 2023 10:10:08 -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=FNLse2ZcD75ram/6R7ZT7oCmOqU0RAt0KF/SNVgLID4=; b=F4kQFrxYh5Svorw0WiId2px/Ova0AuG4RaY1y3WSjTYNqA7gqCiHiib3eQrx5f/xEs DI3sVEl872UBCplU8OR4dDLHMYVsppx65wuS7eM/p/GuMbfijnwuu1FEieOpOEQP0ZNT XWE1DNi+/PZHmGHqv36heCtjmLV/6XegC2N8Zet3rVHlpeHA6mSlVFiIbi55LBNGQqVU X1r2x/U5j+IdG5aUBLYxDpiZJbiquFn7IyvQgAdeb6Hesr3QkIrVZSHhcl5K0dqHjubt XNpZtV4LluNzeulDHfRXdNA2SErvOiriKDMVbRNi8BdN3QJSjApFth5E0xY+bw4UmpW9 FXkA== 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=FNLse2ZcD75ram/6R7ZT7oCmOqU0RAt0KF/SNVgLID4=; b=PUuPhfOAMf35B0VXBjmle7Eh06kJ/90EWuvshIAuKoY28nhexgwOTfBxQGxapreqJG PxCieMYMehajqHcX7HtFmsz/NUWq7oQrfwpjey6bzM4UWqm+Ku8AU94a42//CP9iZCzO 2upHrHYjUNHenHjHwlkYm/dhPIDc7DL6T3CVOXqTfr7X0Q+iRNW1697ME08zbnY4bQc7 xL+T4t+y9Nb5hTsOezbZdSpcWWV3q5SN0G0CmnS3VcxXtYG4m4ZsPQHVlGEeiRxqAfTf GdRw0IQ40LpNPz+aOEn+E0PIpdXs5OHCgQPc4SuAjSn0dv0IXEU3AGZviXuoYLoTSNCv X0kA== X-Gm-Message-State: AO0yUKUGzwSsaiV+MaPsd9jdwc9CAPRgLraYfxGAL/fgbQR5A2EIJiiz TaL6yV7Ft8J3ObxkbjpbgeF3EqjsgKBchArB X-Received: by 2002:a5d:4350:0:b0:2c3:6686:c7d5 with SMTP id u16-20020a5d4350000000b002c36686c7d5mr8980518wrr.18.1675447807755; Fri, 03 Feb 2023 10:10:07 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c16-20020a056000105000b002bbb2d43f65sm2533879wrx.14.2023.02.03.10.10.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Michael Rolnik Subject: [PATCH 10/19] hw/avr: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:05 +0100 Message-Id: <20230203180914.49112-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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 No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé --- hw/avr/arduino.c | 4 ++-- hw/avr/atmega.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/avr/arduino.c b/hw/avr/arduino.c index 48ef478346..428e6e1b2d 100644 --- a/hw/avr/arduino.c +++ b/hw/avr/arduino.c @@ -15,6 +15,7 @@ #include "atmega.h" #include "boot.h" #include "qom/object.h" +#include "hw/qdev-properties.h" struct ArduinoMachineState { /*< private >*/ @@ -44,8 +45,7 @@ static void arduino_machine_init(MachineState *machine) ArduinoMachineState *ams = ARDUINO_MACHINE(machine); object_initialize_child(OBJECT(machine), "mcu", &ams->mcu, amc->mcu_type); - object_property_set_uint(OBJECT(&ams->mcu), "xtal-frequency-hz", - amc->xtal_hz, &error_abort); + qdev_prop_set_uint64(DEVICE(&ams->mcu), "xtal-frequency-hz", amc->xtal_hz); sysbus_realize(SYS_BUS_DEVICE(&ams->mcu), &error_abort); if (machine->firmware) { diff --git a/hw/avr/atmega.c b/hw/avr/atmega.c index a34803e642..e6ebc7473a 100644 --- a/hw/avr/atmega.c +++ b/hw/avr/atmega.c @@ -327,8 +327,8 @@ static void atmega_realize(DeviceState *dev, Error **errp) devname = g_strdup_printf("timer%zu", i); object_initialize_child(OBJECT(dev), devname, &s->timer[i], TYPE_AVR_TIMER16); - object_property_set_uint(OBJECT(&s->timer[i]), "cpu-frequency-hz", - s->xtal_freq_hz, &error_abort); + qdev_prop_set_uint64(DEVICE(&s->timer[i]), "cpu-frequency-hz", + s->xtal_freq_hz); sbd = SYS_BUS_DEVICE(&s->timer[i]); sysbus_realize(sbd, &error_abort); sysbus_mmio_map(sbd, 0, OFFSET_DATA + mc->dev[idx].addr); From patchwork Fri Feb 3 18:09:06 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: 650089 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971385pva; Fri, 3 Feb 2023 10:10:29 -0800 (PST) X-Google-Smtp-Source: AK7set+To31u4bGtlpxm+VhLNfMRvKxOUl0pXw+RwBO7AKJmpm5tcZtpBAqMPIStyLjqq/KGLdF1 X-Received: by 2002:a1f:ad4c:0:b0:3e8:d54f:599d with SMTP id w73-20020a1fad4c000000b003e8d54f599dmr4443740vke.4.1675447828911; Fri, 03 Feb 2023 10:10:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447828; cv=none; d=google.com; s=arc-20160816; b=PE6oQsK/U1NkmjxggGog43SDMSzp3wGF+CWWo+BX7wrle0hI8iC4zhOdhISLG3ZYww 3Fv2/Tt7aAw4JipHIVMepfAP+5drYJMMCprYFKEkktqf83lLxL6Yuq60Y+7uBoKzZ881 VRCxTy+vaxvVKD1zpOr4Wpw8IBw+R0rAmaeuulzkytc25YL3ryoH23tJXCvL9ENvFLGo UlxSm949OZAop2dCwlJolUdOH9AHu5ZqOvQNO5gekrbzx+ZnsHhv+AexZrq0ckcLjTBi Af99Lv5ye/jZAjOWQ/P7EPFd1WYa/gAAk43vYga6K4pxpYHdIAwP+4Hqqaxbqp7BTy8w fpxg== 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=Ok2EOjmCsX5+0JFRDcAc0OAjSODkQVsQacDzbNlLsUU=; b=h3FXjJPcywrUugfm6FpwcQRUbOKcvd7cddQGjYiqw7TgFMkmE3o6WrZB4FbontGClG /qEe7EgZkU3+vLATyHtokA1EXG5Xzb8C9NR/kSNfQ/gHqk1A+A3zyIcf/TKjyqK5GxB6 Y7lmvNNcoXvpFW5tDxuaDUkm2yJgYOLOjY9c4StCn2siQYLGunB1DXTacYhLonTeGKkV wabYiCnzdqjm+4Vq1UghxpTxlrVNpFWuJ7aH2oZw9UyRPCDjt00imm0Xw9tU90tXkXV8 UM1mnceZtAeO6RmyKTbiRsDj2mjCH6aWk79FRprD6xUdb7H/jGA+BLzJFtOjLrs91VYu SrlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OOnbn6Jl; 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 o9-20020a056122142900b003e17b73c015si919415vkp.212.2023.02.03.10.10.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:10:28 -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=OOnbn6Jl; 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 1pO0Vx-000091-Jr; Fri, 03 Feb 2023 13:10:21 -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 1pO0Vu-0008EN-2J for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:18 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0Vr-0008VI-C1 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:17 -0500 Received: by mail-wm1-x32c.google.com with SMTP id n13so4494952wmr.4 for ; Fri, 03 Feb 2023 10:10:14 -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=Ok2EOjmCsX5+0JFRDcAc0OAjSODkQVsQacDzbNlLsUU=; b=OOnbn6JlbCfgbp0zvxoEEPom4S1zlra/nWKhZprQuQcB93S0slNfRCPfqQhtYlnw/o ziKsKkqNan8Vfv5imJgY4Jw7CasKv/EDzEQonEC2w8VtX91IqBkBrbQ3nP0k8ECdRZlx R/TfnZUhQJOkSzr+x0A3B2UVWfVOIo1cRc8D80NXPEI7HiRBmb3HwYbGF64FTMn00nhx skysicGeHnqJcEc8skdRheNE+blwx/89csVZX37Cd7NCnnbepduw21g3mxjtenVuvuRJ z9yKkyA1i85aXJb3NlBkYAJlgSEMOXGsCb0pplDWz+R59y/MZoiVH4xbL5Ma0YDBj7QY /DJA== 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=Ok2EOjmCsX5+0JFRDcAc0OAjSODkQVsQacDzbNlLsUU=; b=aovGCnrfiD/wF4yRNjS8bDxh7CXDAdPQ342Iuu7PYMdseVQRoC9GKgnkeh7VmYKQ/b hUV71UQt9Yo8bVZ7VJO3GSCGJO5H86ApCI8rpTTS7EUjIjr/cqSNFSOmNwQ0EVu8SPfX Q/2cHULZ7bY1IPiJQGPrM/6EElbH++vLgkTqot4GaxeYFFWSoyW/oqSUQxoodiE730ho GlA2+Onu7PlAG/tLd80UkEfyLfUEj9Zt0Vhbp9IGAmOINm0EoPXF0CtHDxuN9cR+oYzG 9NS9kCszUz1dK4qaBRNjexZQoQWEY4Sj0kI7uCq8pv1hlWpOLrFm1egWzV/oVLT3P2tI BrTg== X-Gm-Message-State: AO0yUKXXrYLQ571fxKpDPxF/vA2AkCiv2NI+zUZnDBP97xSwAu/QBsYx hqZl6pvNz6GVYNNEY/eHYKBLuH8PHvmzBEcQ X-Received: by 2002:a05:600c:3d1b:b0:3db:fc3:6de4 with SMTP id bh27-20020a05600c3d1b00b003db0fc36de4mr10822625wmb.35.1675447813544; Fri, 03 Feb 2023 10:10:13 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m5-20020a7bcb85000000b003de8a1b06c0sm8588291wmi.7.2023.02.03.10.10.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Helge Deller Subject: [PATCH 11/19] hw/hppa: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:06 +0100 Message-Id: <20230203180914.49112-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/hppa/machine.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index de1cc7ab71..6bd6a8d722 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -166,8 +166,7 @@ static DinoState *dino_init(MemoryRegion *addr_space) DeviceState *dev; dev = qdev_new(TYPE_DINO_PCI_HOST_BRIDGE); - object_property_set_link(OBJECT(dev), "memory-as", OBJECT(addr_space), - &error_fatal); + qdev_prop_set_link(dev, "memory-as", OBJECT(addr_space)); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); return DINO_PCI_HOST_BRIDGE(dev); From patchwork Fri Feb 3 18:09:07 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: 650106 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972780pva; Fri, 3 Feb 2023 10:13:09 -0800 (PST) X-Google-Smtp-Source: AK7set8SLKiQbOasPd8XkTHBIFnUfvMTVEaCrh+ME3oGyMwN9tFQiAoW7/SAj4fl/GqrNLrNzll5 X-Received: by 2002:a05:6214:3389:b0:539:cee8:198d with SMTP id mv9-20020a056214338900b00539cee8198dmr15801321qvb.14.1675447989436; Fri, 03 Feb 2023 10:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447989; cv=none; d=google.com; s=arc-20160816; b=GIWlnvgtPiusqctxwse8qMSB8fYfoJK3XTsZS3/oSU0CuqcOSz/XxPgdpF8aZZpbvK pwACvTX0f15iVpchUwoKg/WR0eq2DS9RpuE5uEBlTipWITwZu/0NNbm7omedJjpY3UFj egTjUEjeWpM7Gtxce11WlxDogByAUJWhrre125lJldduLXLQ5VwMTD8v3XjBJ7KJ+GeO qWwPaeHb9DaBb2YhHsZHI85zWQZU8B0h/rfIFXFZBzfRTmdFgx4jMqL4vzl55wBkSzoL GYON9dIzj2v2Z2Vj+KKbBDUQdNTv0Q7z8iHYzy2pnVu1jjMk/q8JWqx/Bolxnjvg6pYu BcsQ== 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=yfuxLaxqk4mVFu2bySSXnIQtU3kYxIWtg5zFBO+Mz50=; b=R2usaFPMS9LKO9tkRNEPOvzRHfFbNA9pCq6g6oWdBVq73ATds7E99C4uX47fEYSDmS uHPx+f8kGf+oMQ2Ijb4rOlhkN4jVX+017XZuB0K/kPvrRBGiSlinf3DNG08yMIHp8YoM gl0R7hqVUMeYsiMhPHkw7HvoozRMncDaH8JItbZTemhJlBqCx+q74NluqQ1knGn00pml wSsxzrlBhEOs8A60/yuBNfwOOJMjKZ7sjUmwxNM9MsAZ1EDVfjdM9s3bhNPXj4AkCDKU iqLGbJWP0lapWADFVZOfnNTcCTwPhotpRxHZLB9/1x8wupeqHc2ACx0vtdVka11UYkyq h82Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a2cDbtTf; 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 q10-20020ad45caa000000b0056206a0cb5fsi2606627qvh.353.2023.02.03.10.13.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:13:09 -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=a2cDbtTf; 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 1pO0W0-0000Ji-GD; Fri, 03 Feb 2023 13:10:24 -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 1pO0Vy-0000FT-Sd for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:22 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0Vw-00008H-Ho for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:22 -0500 Received: by mail-wm1-x335.google.com with SMTP id l21-20020a05600c1d1500b003dfe462b7e4so1953613wms.0 for ; Fri, 03 Feb 2023 10:10:20 -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=yfuxLaxqk4mVFu2bySSXnIQtU3kYxIWtg5zFBO+Mz50=; b=a2cDbtTf1yr0JSUgmzqfVrifho6NBGr2pv81vlACziRCKZCTMcADLVsZJDsq3vATV6 klOQ2aBUa1HXDnb8ozL6nsNUcfzLYATGpd3nVVsTG5JzygjH4Dp5MVkGMv7lci2uhe+4 bxlvmiKr7/Subg2UBF7qvFlHYLDghmwQch0p/eT/5w707ixfpZz/Aed+p9rZn7BME7iC e01GIBk0gIV/SN2xrETgiu51gAB/k4nQlMFPJkQad9MZLZt/zIXIUOUUHy+7SscZHlLX NyMH9k4cVzPi+f0HdK+Ja0CKviXmM6X4M+xWiIMwFCCDTHygdoqY/4EQvOfyQZVL89Hy s0NQ== 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=yfuxLaxqk4mVFu2bySSXnIQtU3kYxIWtg5zFBO+Mz50=; b=TZYxfITaoQDSpdQdXXa23pANQn/GcbWNX3QzwY7xMRMmIs8VF28xW30StugOvZJqHD uANmjm5IaGIOt7pfichzylyLUKjHRbYw+rxSS43dSqI37EZjRDxeoiUcCepRAivTgAcI NlCcFmxqAc8foveEosp57zKQXdXTEjqVghAWkZw9uMWt8jL6EkVfRgURMcy87jGnBNPj pUDcL5wIMkxBCr5ZQcV+jBDyiaFoSHK7bljIFaX1RumUwlBYtgNZSEii+8vGrffTsTgI Qzdd/GsbzMKegZ89sdtWzl3DqflVA/QHPROIJKL8/0vINCWRLS0/BtNjxkMDqJSxiyHF DUiQ== X-Gm-Message-State: AO0yUKX/vHKy4qYoSWf7FVnXwrWa2DAxkqKLXy8/HhsFzoylFbBL9mR1 ndygrT+gIAn0G8stxnO2YvG6pZTbmS6nop6K X-Received: by 2002:a05:600c:4fcb:b0:3dd:e38b:a12f with SMTP id o11-20020a05600c4fcb00b003dde38ba12fmr5088912wmq.40.1675447818832; Fri, 03 Feb 2023 10:10:18 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id u1-20020a05600c00c100b003a3442f1229sm8356415wmm.29.2023.02.03.10.10.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , "Michael S. Tsirkin" , Marcel Apfelbaum , David Hildenbrand , Igor Mammedov , Xiao Guangrong Subject: [RFC PATCH 12/19] hw/i386: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:07 +0100 Message-Id: <20230203180914.49112-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 8 +++----- hw/i386/pc_q35.c | 25 +++++++++++-------------- hw/i386/sgx.c | 3 +-- hw/i386/x86.c | 12 ++++-------- hw/mem/pc-dimm.c | 5 ++--- target/i386/cpu.c | 6 ++---- target/i386/host-cpu.c | 7 +++---- 7 files changed, 26 insertions(+), 40 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6e592bd969..700fdefa12 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1236,8 +1236,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, vmmouse = NULL; } if (vmmouse) { - object_property_set_link(OBJECT(vmmouse), TYPE_I8042, OBJECT(i8042), - &error_abort); + qdev_prop_set_link(DEVICE(vmmouse), TYPE_I8042, OBJECT(i8042)); isa_realize_and_unref(vmmouse, isa_bus, &error_fatal); } port92 = isa_create_simple(isa_bus, TYPE_PORT92); @@ -1538,9 +1537,8 @@ static void pc_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, char *resv_prop_str = g_strdup_printf("0xfee00000:0xfeefffff:%d", VIRTIO_IOMMU_RESV_MEM_T_MSI); - object_property_set_uint(OBJECT(dev), "len-reserved-regions", 1, errp); - object_property_set_str(OBJECT(dev), "reserved-regions[0]", - resv_prop_str, errp); + qdev_prop_set_uint32(dev, "len-reserved-regions", 1); + qdev_prop_set_string(dev, "reserved-regions[0]", resv_prop_str); g_free(resv_prop_str); } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 66cd718b70..760efa62ca 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -118,7 +118,7 @@ static void pc_q35_init(MachineState *machine) PCMachineState *pcms = PC_MACHINE(machine); PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); X86MachineState *x86ms = X86_MACHINE(machine); - Q35PCIHost *q35_host; + DeviceState *q35_host; PCIHostState *phb; PCIBus *host_bus; PCIDevice *lpc; @@ -206,7 +206,7 @@ static void pc_q35_init(MachineState *machine) } /* create pci host bus */ - q35_host = Q35_HOST_DEVICE(qdev_new(TYPE_Q35_HOST_DEVICE)); + q35_host = qdev_new(TYPE_Q35_HOST_DEVICE); if (pcmc->pci_enabled) { pci_hole64_size = object_property_get_uint(OBJECT(q35_host), @@ -219,18 +219,15 @@ static void pc_q35_init(MachineState *machine) pci_hole64_size); object_property_add_child(qdev_get_machine(), "q35", OBJECT(q35_host)); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_RAM_MEM, - OBJECT(ram_memory), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_PCI_MEM, - OBJECT(pci_memory), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_SYSTEM_MEM, - OBJECT(get_system_memory()), NULL); - object_property_set_link(OBJECT(q35_host), MCH_HOST_PROP_IO_MEM, - OBJECT(system_io), NULL); - object_property_set_int(OBJECT(q35_host), PCI_HOST_BELOW_4G_MEM_SIZE, - x86ms->below_4g_mem_size, NULL); - object_property_set_int(OBJECT(q35_host), PCI_HOST_ABOVE_4G_MEM_SIZE, - x86ms->above_4g_mem_size, NULL); + qdev_prop_set_link(q35_host, MCH_HOST_PROP_RAM_MEM, OBJECT(ram_memory)); + qdev_prop_set_link(q35_host, MCH_HOST_PROP_PCI_MEM, OBJECT(pci_memory)); + qdev_prop_set_link(q35_host, MCH_HOST_PROP_IO_MEM, OBJECT(system_io)); + qdev_prop_set_link(q35_host, MCH_HOST_PROP_SYSTEM_MEM, + OBJECT(get_system_memory())); + qdev_prop_set_uint64(q35_host, PCI_HOST_BELOW_4G_MEM_SIZE, + x86ms->below_4g_mem_size); + qdev_prop_set_uint64(q35_host, PCI_HOST_ABOVE_4G_MEM_SIZE, + x86ms->above_4g_mem_size); /* pci */ sysbus_realize_and_unref(SYS_BUS_DEVICE(q35_host), &error_fatal); phb = PCI_HOST_BRIDGE(q35_host); diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index 6a729bff94..196fa5afee 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -304,8 +304,7 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) object_property_parse(OBJECT(dev), SGX_EPC_MEMDEV_PROP, list->value->memdev, &error_fatal); /* set the numa node property for sgx epc object */ - object_property_set_uint(OBJECT(dev), SGX_EPC_NUMA_NODE_PROP, - list->value->node, &error_fatal); + qdev_prop_set_uint32(dev, SGX_EPC_NUMA_NODE_PROP, list->value->node); qdev_realize_and_unref(dev, NULL, &error_fatal); } diff --git a/hw/i386/x86.c b/hw/i386/x86.c index eaff4227bd..191a8c36ee 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -43,6 +43,7 @@ #include "sysemu/xen.h" #include "trace.h" +#include "hw/qdev-properties.h" #include "hw/i386/x86.h" #include "target/i386/cpu.h" #include "hw/i386/topology.h" @@ -96,15 +97,10 @@ uint32_t x86_cpu_apic_id_from_index(X86MachineState *x86ms, void x86_cpu_new(X86MachineState *x86ms, int64_t apic_id, Error **errp) { - Object *cpu = object_new(MACHINE(x86ms)->cpu_type); + DeviceState *cpu = DEVICE(object_new(MACHINE(x86ms)->cpu_type)); - if (!object_property_set_uint(cpu, "apic-id", apic_id, errp)) { - goto out; - } - qdev_realize(DEVICE(cpu), NULL, errp); - -out: - object_unref(cpu); + qdev_prop_set_uint32(cpu, "apic-id", apic_id); + qdev_realize(cpu, NULL, errp); } void x86_cpus_init(X86MachineState *x86ms, int default_cpu_version) diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index 50ef83215c..d6e0c8b680 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -66,8 +66,7 @@ void pc_dimm_pre_plug(PCDIMMDevice *dimm, MachineState *machine, error_propagate(errp, local_err); return; } - object_property_set_int(OBJECT(dimm), PC_DIMM_SLOT_PROP, slot, - &error_abort); + qdev_prop_set_int32(DEVICE(dimm), PC_DIMM_SLOT_PROP, slot); trace_mhp_pc_dimm_assigned_slot(slot); memory_device_pre_plug(MEMORY_DEVICE(dimm), machine, legacy_align, @@ -234,7 +233,7 @@ static uint64_t pc_dimm_md_get_addr(const MemoryDeviceState *md) static void pc_dimm_md_set_addr(MemoryDeviceState *md, uint64_t addr, Error **errp) { - object_property_set_uint(OBJECT(md), PC_DIMM_ADDR_PROP, addr, errp); + qdev_prop_set_uint64(DEVICE(md), PC_DIMM_ADDR_PROP, addr); } static MemoryRegion *pc_dimm_md_get_memory_region(MemoryDeviceState *md, diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 4d2b8d0444..5532cd42c5 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5073,10 +5073,8 @@ static void x86_cpu_load_model(X86CPU *cpu, X86CPUModel *model) */ /* CPU models only set _minimum_ values for level/xlevel: */ - object_property_set_uint(OBJECT(cpu), "min-level", def->level, - &error_abort); - object_property_set_uint(OBJECT(cpu), "min-xlevel", def->xlevel, - &error_abort); + qdev_prop_set_uint32(DEVICE(cpu), "min-level", def->level); + qdev_prop_set_uint32(DEVICE(cpu), "min-xlevel", def->xlevel); object_property_set_int(OBJECT(cpu), "family", def->family, &error_abort); object_property_set_int(OBJECT(cpu), "model", def->model, &error_abort); diff --git a/target/i386/host-cpu.c b/target/i386/host-cpu.c index 10f8aba86e..0307eaa208 100644 --- a/target/i386/host-cpu.c +++ b/target/i386/host-cpu.c @@ -158,7 +158,7 @@ void host_cpu_instance_init(X86CPU *cpu) host_cpuid(0, 0, NULL, &ebx, &ecx, &edx); x86_cpu_vendor_words2str(vendor, ebx, edx, ecx); - object_property_set_str(OBJECT(cpu), "vendor", vendor, &error_abort); + qdev_prop_set_string(DEVICE(cpu), "vendor", vendor); } } @@ -174,13 +174,12 @@ void host_cpu_max_instance_init(X86CPU *cpu) host_cpu_vendor_fms(vendor, &family, &model, &stepping); host_cpu_fill_model_id(model_id); - object_property_set_str(OBJECT(cpu), "vendor", vendor, &error_abort); + qdev_prop_set_string(DEVICE(cpu), "vendor", vendor); object_property_set_int(OBJECT(cpu), "family", family, &error_abort); object_property_set_int(OBJECT(cpu), "model", model, &error_abort); object_property_set_int(OBJECT(cpu), "stepping", stepping, &error_abort); - object_property_set_str(OBJECT(cpu), "model-id", model_id, - &error_abort); + qdev_prop_set_string(DEVICE(cpu), "model-id", model_id); } static void host_cpu_class_init(ObjectClass *oc, void *data) From patchwork Fri Feb 3 18:09:08 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: 650099 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972252pva; Fri, 3 Feb 2023 10:12:03 -0800 (PST) X-Google-Smtp-Source: AK7set/EV/zRcQxz67bnK4H3so0ztt3zoMGKIZUHqJ+YFdqSSo5FtAhHhIJ08U4uY0n7SwSo7VSl X-Received: by 2002:a0c:aa91:0:b0:539:6a0c:ae95 with SMTP id f17-20020a0caa91000000b005396a0cae95mr15044763qvb.7.1675447922993; Fri, 03 Feb 2023 10:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447922; cv=none; d=google.com; s=arc-20160816; b=LUAebzXrKBo1odrQpXZQYXDObvZ02a2VumAyTNUAaiLP9Tsl3glqwocPB5/YV6ptTi AFvxRtK35Ii54axLSld4QadAd8TGi2GDgkoxtrBcws5ZnDFiJA639iCGlGns+fwOssFC utiGtH4D00238/Edzs/l9Ks/PYKa3kuMbaCdllmMusJpubz54iLKYi0gsbhlflFCpXuI Pr/us0n4XGmY9VZTx5ZspbVBu/0ltNiVXEgljVcQY0axl+0MbGw3+EO9hOiMsh95aA3d ldf58G3mJmD2xymdMnVWeUxe+Us14653IROAYkI8A9R6AKoRdh0BalNQ0z7DWBLSbMYE rfEA== 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=P/I3al5seYLenPgGBRZSaVfmIjm7PcZ28M3YPTxSCx8=; b=V2uHQTNqSCexUYcqXvMQV3o4cZBIOVh38VI0VNpFICfkUy+nWdNEOySa1fgZGG/ZH/ IoZ3EtXfLWEYpOkv6N3mkguO6gDSYdPD0d6hMbIBnc1XDNyPwUcHBDtTS8ZJVgNXYpEM tA3fdoZ6lCVhNuZ3LHjvzAC7aJ/rhw/Jpft/lmGVzDhS1Wpj+IBiL//M4GrZ61G2dvIt T5pb7MbD/IyqY4CbU9FIOQQvD2+32hjhPRc2HHujPhkSpjHZNivgVOzEBwyIr1OZqIlV TnaVgIbxFxepmnZr4EeIYxcvQE+SRLs4afoRgnVnYt0iob/d6nqFS6acLHuglskXNxTb 4meA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="d/Ls8fK1"; 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 if5-20020a0562141c4500b0054ace222c06si2602557qvb.589.2023.02.03.10.12.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12:02 -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="d/Ls8fK1"; 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 1pO0W5-0000iP-69; Fri, 03 Feb 2023 13:10:29 -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 1pO0W2-0000W8-UX for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:27 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0W1-0008VF-5v for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:26 -0500 Received: by mail-wm1-x334.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so6605078wma.1 for ; Fri, 03 Feb 2023 10:10:24 -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=P/I3al5seYLenPgGBRZSaVfmIjm7PcZ28M3YPTxSCx8=; b=d/Ls8fK1E0DRDVhuJ+F4H2CDcQaF9fPPbMrilBLiBay3hEmtC0jjeYtWkvZ2oYjQqH zs9+FGspjQcDMz6h3n3TtrC02ByY49ucsvslNbfru0f6lfliWLTi2pHOwbeJdFcfzghR IeqsQj2szjrfjgIC+OQyFR41w9Uo2KsEQCrOGI9fPJjv4Tpb64jirxHRXYqG20hAEbpI vbmL80dCP4sYb2/ngcf/RJ/rWRd6nzAFKNbYREA1xLQ4V/I8Ic1S2S2HJAuJfD93d6Lt qRCE4SMLyOwdUw65f9vxOwHzltWyHXSC6jQt4Zq3goAh+6TUDUn2kvSJ1Lrk8H30ptnC 8z0Q== 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=P/I3al5seYLenPgGBRZSaVfmIjm7PcZ28M3YPTxSCx8=; b=rL28yB5g3XoFsqxFhUjuShcLxBnPXXZXvm12sQn+yRrQIptm1tdX0x2JARlsh/55Mm JvSwVW3bHiAJ0yCgxscsrXoImztFINxCmkPBUBhEDyhEi1mbtUOlNjUD5MGRnnhJr6fT g8VZdeRM1PEx+by5TgAP+tDCYL6z5Ls6xTBjh2V2MqfyN8nGS8gaiSawLK+0Wp3a5Bho 7qiWBnivMHZO5cmnYH98bN7dVNAVvqedN8RE9to0DT+WFvHKv6aOvCDn3r7Y+K2VOK7w +HHAhVMblm5Ts+tNYgjAwlQqALzUiPfbKAyH33k5wk1mc1ntC2V2FsNK+jaTN/X+kixK EAoA== X-Gm-Message-State: AO0yUKXcdU8xqg8mp5DMedigBJdoWoAPydnGzEiIyxm3pfBFrlltHUXd CS8jJ2aKCHHRvIxrYFFN+cjyP6XPCkl4Hp1v X-Received: by 2002:a05:600c:5113:b0:3d0:761b:f86 with SMTP id o19-20020a05600c511300b003d0761b0f86mr10859031wms.28.1675447824117; Fri, 03 Feb 2023 10:10:24 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n6-20020a05600c4f8600b003daf672a616sm3657304wmq.22.2023.02.03.10.10.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Laurent Vivier Subject: [PATCH 13/19] hw/m68k: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:08 +0100 Message-Id: <20230203180914.49112-14-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 No need to use the low-level QOM API when an object inherits from QDev. Directly use the QDev API to set its properties. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- hw/m68k/next-cube.c | 2 +- hw/m68k/q800.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index e0d4a94f9d..460b84c6e6 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -966,7 +966,7 @@ static void next_cube_init(MachineState *machine) /* Peripheral Controller */ pcdev = qdev_new(TYPE_NEXT_PC); - object_property_set_link(OBJECT(pcdev), "cpu", OBJECT(cpu), &error_abort); + qdev_prop_set_link(pcdev, "cpu", OBJECT(cpu)); sysbus_realize_and_unref(SYS_BUS_DEVICE(pcdev), &error_fatal); /* 64MB RAM starting at 0x04000000 */ diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 9d52ca6613..1f363a666c 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -427,7 +427,7 @@ static void q800_init(MachineState *machine) /* IRQ Glue */ glue = qdev_new(TYPE_GLUE); - object_property_set_link(OBJECT(glue), "cpu", OBJECT(cpu), &error_abort); + qdev_prop_set_link(glue, "cpu", OBJECT(cpu)); sysbus_realize_and_unref(SYS_BUS_DEVICE(glue), &error_fatal); /* VIA 1 */ @@ -483,8 +483,7 @@ static void q800_init(MachineState *machine) qdev_set_nic_properties(dev, &nd_table[0]); qdev_prop_set_uint8(dev, "it_shift", 2); qdev_prop_set_bit(dev, "big_endian", true); - object_property_set_link(OBJECT(dev), "dma_mr", - OBJECT(get_system_memory()), &error_abort); + qdev_prop_set_link(dev, "dma_mr", OBJECT(get_system_memory())); sysbus = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(sysbus, &error_fatal); sysbus_mmio_map(sysbus, 0, SONIC_BASE); @@ -520,7 +519,7 @@ static void q800_init(MachineState *machine) /* Logically OR both its IRQs together */ escc_orgate = DEVICE(object_new(TYPE_OR_IRQ)); - object_property_set_int(OBJECT(escc_orgate), "num-lines", 2, &error_fatal); + qdev_prop_set_uint16(escc_orgate, "num-lines", 2); qdev_realize_and_unref(escc_orgate, NULL, &error_fatal); sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(escc_orgate, 0)); sysbus_connect_irq(sysbus, 1, qdev_get_gpio_in(escc_orgate, 1)); From patchwork Fri Feb 3 18:09:09 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: 650095 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971694pva; Fri, 3 Feb 2023 10:11:01 -0800 (PST) X-Google-Smtp-Source: AK7set9QxmGzZ1C9GnDBdXAj6xmrTV+V+roZ/8iFhrC6K8PvfEj3FNmX5O6I/gjnJ7BKBYXTX3N0 X-Received: by 2002:a05:6102:ec2:b0:3e8:9391:a6aa with SMTP id m2-20020a0561020ec200b003e89391a6aamr7755307vst.18.1675447861570; Fri, 03 Feb 2023 10:11:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447861; cv=none; d=google.com; s=arc-20160816; b=pV7+E2jD2EhI0JSctshLfiUsRInBmdenkyB4qQwLDjsK/qJsEBFzQQ5SXTJX9J4T9s 1NpOywCm1W08c0AzAarHcv/jsFWJEAX4K6ZToqy5I/2cZPWN2NfAGC1iMxg9D5BiPrN+ v2u+4QctWMcGYbmUAB1jw3UdaSPlhawt/DpnC3gxwnqzzK+dTeb99Pr3CLxP5I6uQamq PIk9t7bF2qPh2UjsH9At6jf/QjZNmC4b+THgQrM31x4fqValXUKeGeRpT53I+xRaMEx1 PKmdCBKXxt85p/brpao+1NsKjlCca12dbfSA7BpqPKyGXkaQt36rKZK8L+1y6vrpO/v2 tROA== 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=hq0o8xFHFnAca4/TyyUs1kwk1RCOrbTiudwSIBAx5Y8=; b=wx6KrcDM5fSSF1FCfNeMQbXfKM56a+jOOEtUXO2RNF0qynSFsdCeuJO14jJ8CheYD6 yeIY3u8cKIeFOnKWCX8T6UGbTZ3HveWj1tyy/v+iBiYpMHx00d0sddPh0DLgZwrZcT/i fXBDkeLqz89oLX0j9uRb77QB5swj3/rRP/67yA2Ti2vftDXAfgdA2s9koeEciMfkQ5Ck 1V/FkTBpjyY5DOxDTADB4Fa+8U7qwSsRYrUxjCFEa2yHNzeSsD+ANcNchQTYB9HLHL1/ np9/bhCCaE6lsutWiveSdGCKc3vL4WjlRDmK80Ome3X3yrQQiCVLRTr/SqbkGfW9g3YC 7Imw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NkAe4NeS; 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 s12-20020a67df0c000000b003c88f788f4dsi881796vsk.67.2023.02.03.10.11.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:11:01 -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=NkAe4NeS; 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 1pO0WC-0001cX-HW; Fri, 03 Feb 2023 13:10:36 -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 1pO0WA-0001NU-KF for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:34 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0W6-0008VI-SL for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:34 -0500 Received: by mail-wm1-x32c.google.com with SMTP id n13so4495461wmr.4 for ; Fri, 03 Feb 2023 10:10:30 -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=hq0o8xFHFnAca4/TyyUs1kwk1RCOrbTiudwSIBAx5Y8=; b=NkAe4NeSByaQj/kWcPGd7EtgfdGSl5MNN5FjupRrVOyGbuKjHpzBNN/TOpZnZnItW1 /qTQdQUvQT0g3Pa9hpKVGqQy7++ySoZm0QAosN2EC9nAWHNCDNl/mFDQmkr3Lfd+9pFm jyrOB16kzUi9phWqZn/tswpB8jWmc6Evi5EIUUGylvtsoOIfMz55sdY1umBIkE1mBaQk XF6dvPk+omBlXhTwY2UBLOxdKIyWxNoL76oQ5L3SX3Fv/gI75akqXF6PuEY0JcwvtbIW ffCf6h8aCOpI3OL6RTr+apSE1WUDu6EkNX4sCzNk+PiCNqtgP3UoR75T3jsM9xI941fb H9rw== 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=hq0o8xFHFnAca4/TyyUs1kwk1RCOrbTiudwSIBAx5Y8=; b=UD8xQzePtE+XLjTVpPf6hGRXqQTky90tKvMW6Chi8ZYzPzFVs1OtAVRHdpWTrYNHhy tfJplG0C16DS1AdQBp5RRxXC7u2u4x+0EuQ+nV7GUB9P2rSx/VBW8imaA3GOH6YW81+E ZRjCrYNA3rS/Of78X9f+NUbrfELEDuWUl022KA4ciTJy9djQQG8H5RYOfM0x4q60p8Tn LCn8+YDIj0ho1chPuCaMxtm4g5jlxRL183YA4f4iOeMAkQwRmfmNdC/oWvCenaguk3cW hIxxdEhFWl41kt+IRWrvkOUzNT4FlREzGWs08hNeqZ8NcdWBT12bDoJKubMsjMypY0Dw 0G8g== X-Gm-Message-State: AO0yUKUrysRWI6XsvZNcmGs+QVjzh34pahBjt4Af4JlOu1eBADHSl6vY jUkDuRgY92FRwR3VHmpIH1rBHefcI+PVFyYY X-Received: by 2002:a05:600c:b8e:b0:3dc:405b:99b4 with SMTP id fl14-20020a05600c0b8e00b003dc405b99b4mr13095532wmb.25.1675447829817; Fri, 03 Feb 2023 10:10:29 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id 14-20020a05600c228e00b003dd9232f036sm5347442wmf.23.2023.02.03.10.10.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" , Alistair Francis , Peter Maydell Subject: [PATCH 14/19] hw/microblaze: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:09 +0100 Message-Id: <20230203180914.49112-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/microblaze/petalogix_ml605_mmu.c | 40 +++++++++++------------- hw/microblaze/petalogix_s3adsp1800_mmu.c | 2 +- hw/microblaze/xlnx-zynqmp-pmu.c | 40 ++++++++++-------------- 3 files changed, 35 insertions(+), 47 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index a24fadddca..c8cc7d2375 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -71,9 +71,9 @@ petalogix_ml605_init(MachineState *machine) { ram_addr_t ram_size = machine->ram_size; MemoryRegion *address_space_mem = get_system_memory(); - DeviceState *dev, *dma, *eth0; + DeviceState *cpu, *dev, *dma, *eth0; Object *ds, *cs; - MicroBlazeCPU *cpu; + MicroBlazeCPU *mbcpu; SysBusDevice *busdev; DriveInfo *dinfo; int i; @@ -82,16 +82,16 @@ petalogix_ml605_init(MachineState *machine) qemu_irq irq[32]; /* init CPUs */ - cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); - object_property_set_str(OBJECT(cpu), "version", "8.10.a", &error_abort); + cpu = DEVICE(object_new(TYPE_MICROBLAZE_CPU)); + mbcpu = MICROBLAZE_CPU(cpu); + qdev_prop_set_string(cpu, "version", "8.10.a"); /* Use FPU but don't use floating point conversion and square * root instructions */ - object_property_set_int(OBJECT(cpu), "use-fpu", 1, &error_abort); - object_property_set_bool(OBJECT(cpu), "dcache-writeback", true, - &error_abort); - object_property_set_bool(OBJECT(cpu), "endianness", true, &error_abort); - qdev_realize(DEVICE(cpu), NULL, &error_abort); + qdev_prop_set_uint8(cpu, "use-fpu", 1); + qdev_prop_set_bit(cpu, "dcache-writeback", true); + qdev_prop_set_bit(cpu, "endianness", true); + qdev_realize(cpu, NULL, &error_abort); /* Attach emulated BRAM through the LMB. */ memory_region_init_ram(phys_lmb_bram, NULL, "petalogix_ml605.lmb_bram", @@ -115,7 +115,7 @@ petalogix_ml605_init(MachineState *machine) sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, INTC_BASEADDR); sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, - qdev_get_gpio_in(DEVICE(cpu), MB_CPU_IRQ)); + qdev_get_gpio_in(cpu, MB_CPU_IRQ)); for (i = 0; i < 32; i++) { irq[i] = qdev_get_gpio_in(dev, i); } @@ -148,10 +148,8 @@ petalogix_ml605_init(MachineState *machine) qdev_set_nic_properties(eth0, &nd_table[0]); qdev_prop_set_uint32(eth0, "rxmem", 0x1000); qdev_prop_set_uint32(eth0, "txmem", 0x1000); - object_property_set_link(OBJECT(eth0), "axistream-connected", ds, - &error_abort); - object_property_set_link(OBJECT(eth0), "axistream-control-connected", cs, - &error_abort); + qdev_prop_set_link(eth0, "axistream-connected", ds); + qdev_prop_set_link(eth0, "axistream-control-connected", cs); sysbus_realize_and_unref(SYS_BUS_DEVICE(eth0), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(eth0), 0, AXIENET_BASEADDR); sysbus_connect_irq(SYS_BUS_DEVICE(eth0), 0, irq[AXIENET_IRQ]); @@ -161,10 +159,8 @@ petalogix_ml605_init(MachineState *machine) cs = object_property_get_link(OBJECT(eth0), "axistream-control-connected-target", NULL); qdev_prop_set_uint32(dma, "freqhz", 100 * 1000000); - object_property_set_link(OBJECT(dma), "axistream-connected", ds, - &error_abort); - object_property_set_link(OBJECT(dma), "axistream-control-connected", cs, - &error_abort); + qdev_prop_set_link(dma, "axistream-connected", ds); + qdev_prop_set_link(dma, "axistream-control-connected", cs); sysbus_realize_and_unref(SYS_BUS_DEVICE(dma), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, AXIDMA_BASEADDR); sysbus_connect_irq(SYS_BUS_DEVICE(dma), 0, irq[AXIDMA_IRQ0]); @@ -200,11 +196,11 @@ petalogix_ml605_init(MachineState *machine) } /* setup PVR to match kernel settings */ - cpu->cfg.pvr_regs[4] = 0xc56b8000; - cpu->cfg.pvr_regs[5] = 0xc56be000; - cpu->cfg.pvr_regs[10] = 0x0e000000; /* virtex 6 */ + mbcpu->cfg.pvr_regs[4] = 0xc56b8000; + mbcpu->cfg.pvr_regs[5] = 0xc56be000; + mbcpu->cfg.pvr_regs[10] = 0x0e000000; /* virtex 6 */ - microblaze_load_kernel(cpu, MEMORY_BASEADDR, ram_size, + microblaze_load_kernel(mbcpu, MEMORY_BASEADDR, ram_size, machine->initrd_filename, BINARY_DEVICE_TREE_FILE, NULL); diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index 9d959d1ad8..9df1dd72f3 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -70,7 +70,7 @@ petalogix_s3adsp1800_init(MachineState *machine) MemoryRegion *sysmem = get_system_memory(); cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); - object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort); + qdev_prop_set_string(DEVICE(cpu), "version", "7.10.d"); qdev_realize(DEVICE(cpu), NULL, &error_abort); /* Attach emulated BRAM through the LMB. */ diff --git a/hw/microblaze/xlnx-zynqmp-pmu.c b/hw/microblaze/xlnx-zynqmp-pmu.c index 5a2016672a..e6f221d3eb 100644 --- a/hw/microblaze/xlnx-zynqmp-pmu.c +++ b/hw/microblaze/xlnx-zynqmp-pmu.c @@ -18,6 +18,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "exec/address-spaces.h" +#include "hw/qdev-properties.h" #include "hw/boards.h" #include "cpu.h" #include "boot.h" @@ -76,35 +77,26 @@ static void xlnx_zynqmp_pmu_soc_init(Object *obj) static void xlnx_zynqmp_pmu_soc_realize(DeviceState *dev, Error **errp) { XlnxZynqMPPMUSoCState *s = XLNX_ZYNQMP_PMU_SOC(dev); + DeviceState *cpu = DEVICE(&s->cpu); - object_property_set_uint(OBJECT(&s->cpu), "base-vectors", - XLNX_ZYNQMP_PMU_ROM_ADDR, &error_abort); - object_property_set_bool(OBJECT(&s->cpu), "use-stack-protection", true, - &error_abort); - object_property_set_uint(OBJECT(&s->cpu), "use-fpu", 0, &error_abort); - object_property_set_uint(OBJECT(&s->cpu), "use-hw-mul", 0, &error_abort); - object_property_set_bool(OBJECT(&s->cpu), "use-barrel", true, - &error_abort); - object_property_set_bool(OBJECT(&s->cpu), "use-msr-instr", true, - &error_abort); - object_property_set_bool(OBJECT(&s->cpu), "use-pcmp-instr", true, - &error_abort); - object_property_set_bool(OBJECT(&s->cpu), "use-mmu", false, &error_abort); - object_property_set_bool(OBJECT(&s->cpu), "endianness", true, - &error_abort); - object_property_set_str(OBJECT(&s->cpu), "version", "8.40.b", - &error_abort); - object_property_set_uint(OBJECT(&s->cpu), "pvr", 0, &error_abort); + qdev_prop_set_uint32(cpu, "base-vectors", XLNX_ZYNQMP_PMU_ROM_ADDR); + qdev_prop_set_bit(cpu, "use-stack-protection", true); + qdev_prop_set_uint8(cpu, "use-fpu", 0); + qdev_prop_set_uint8(cpu, "use-hw-mul", 0); + qdev_prop_set_bit(cpu, "use-barrel", true); + qdev_prop_set_bit(cpu, "use-msr-instr", true); + qdev_prop_set_bit(cpu, "use-pcmp-instr", true); + qdev_prop_set_bit(cpu, "use-mmu", false); + qdev_prop_set_bit(cpu, "endianness", true); + qdev_prop_set_string(cpu, "version", "8.40.b"); + qdev_prop_set_uint8(cpu, "pvr", 0); if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) { return; } - object_property_set_uint(OBJECT(&s->intc), "intc-intr-size", 0x10, - &error_abort); - object_property_set_uint(OBJECT(&s->intc), "intc-level-edge", 0x0, - &error_abort); - object_property_set_uint(OBJECT(&s->intc), "intc-positive", 0xffff, - &error_abort); + qdev_prop_set_uint32(DEVICE(&s->intc), "intc-intr-size", 0x10); + qdev_prop_set_uint32(DEVICE(&s->intc), "intc-level-edge", 0x0); + qdev_prop_set_uint32(DEVICE(&s->intc), "intc-positive", 0xffff); if (!sysbus_realize(SYS_BUS_DEVICE(&s->intc), errp)) { return; } From patchwork Fri Feb 3 18:09:10 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: 650096 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp971747pva; Fri, 3 Feb 2023 10:11:06 -0800 (PST) X-Google-Smtp-Source: AK7set9Wv42a5uOnttPTLUgItQk7lfR6fo3Es+7isLGIuiwCsURMjuYLVan/pSxgWiPpcGd+5vYG X-Received: by 2002:a05:6214:1191:b0:537:791f:48e5 with SMTP id t17-20020a056214119100b00537791f48e5mr16303611qvv.22.1675447865923; Fri, 03 Feb 2023 10:11:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447865; cv=none; d=google.com; s=arc-20160816; b=wUZhD7zKiBk5xH1oG4kFDtaUrafbv9l6u3Ic79/07ZX4B+efkL0AtbVoF86GdYxfXE z+kcS6eEN6BEBf7fgvaFAz/30oUxYHwFurlBBsLNRSIFMctgf29FTSy0TrSscF7YZZ5H myV/Lflm6mwh4zwTO0wF7tae6s/Guyp0G1AFqbYUCXwypAOaC4CGZjKwZnMWZMy8B+bb Tz04KERri141vNf6KmTkti3fOJHpRWEZLi1MXaCQjtQbZZOgeukkkv6yFfIcJQLez/8y jOxuQDGrqd69rzbEsKYHmZEDDgGgeymCkRbS2jXf0TALtWaDsONow+jB6qUYqbL2f0Sx spVg== 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=SLTcZ2bERqFx5QJrSflHdKK5QKRI/+byta3hYLUUz0c=; b=UaQqQkUH+Ynzqyg22uqVeCoOVDRUPPwvt566/ythtf1+PiSEc6B/uBcek1hmcg/1T+ Gc4ujCwsBneQ32EDi98F0zwqjm4bzfbsGN6eMn+EHya4XtG7rYUL+2bIHrwY+hCCjxfe foSAk2tOYq/JHXWfgTRMZ6/Q0O3A1ux/pp4D98eM4BFZ5zimY/QSayPjQcChbGwIBIwI Nmmjhp9TtCEEA+So8m1KSeyo04JCWi8IaRrSFzy5uAx5WJFM3vGI558JnJkY5hMRhC6R d/GyqzetmiRmzqI7LbTF8e1LdVGMOatx4hjgzW4cVSgH7woTz2/dcDRd0ridMzwa0ZkV wWWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zvZlsVJv; 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 u14-20020ad45aae000000b005351bff5a00si2601313qvg.238.2023.02.03.10.11.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:11:05 -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=zvZlsVJv; 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 1pO0WF-0001x9-Uh; Fri, 03 Feb 2023 13:10:40 -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 1pO0WD-0001nI-Vl for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:38 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0WC-0000DK-3K for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:37 -0500 Received: by mail-wm1-x32c.google.com with SMTP id bg26so4526878wmb.0 for ; Fri, 03 Feb 2023 10:10:35 -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=SLTcZ2bERqFx5QJrSflHdKK5QKRI/+byta3hYLUUz0c=; b=zvZlsVJvQ9nVYz40xbEJsOTsWOExXlNi5m+ZWR11e2QgZdOlbijtW1EZV+9yYyttom qx/cONN4L24gJJ/b5iMak+z+CGG4sjTGq8RJDVKQlXkUFeP7es8lB3xKokC9GcBTVLyl seplGESIzoWOj+ioKMB/V9KcRLoilrWM069r/uvImip8xqqtk+ss1DhVGJrR9RYaZGp3 6GOe+Iq1VClsXRp+I1Uj4H3Y1hgXzAGWQKsZIscAtis+Q9rVXioUMnPgzpM5/evUAJmC EfrMEr6vLAys23XdlDl6QPEuhQCMmnjNdo65f/xcUID3GvN8axykf9Th2xh5KR/YY5O5 nzvQ== 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=SLTcZ2bERqFx5QJrSflHdKK5QKRI/+byta3hYLUUz0c=; b=7lWs+twxjGoZa1IIF07eUIZjlYQJK2coP1JCNIPtZRtlvbw3xWRQhLxmQrtUxZsE33 Il2fvpXTpo1lIJvTVFXG3xvj82ZmKvcOCbm7LIP7mze9/CpYCCli6WbZdHd5XYAcLmB0 cN2WMrU6/0j0WJQeu963XmC+pZCaJN3yva70MOD+9PPneSfMRPSBjjrHWeIaQGx7Dcdn SaVR4QsfDuq3g5OjLFqidtt1POlc0wndLruGXDQQNLdRgLAKNpGM9rgqff3843ltqcn0 AODIz1qNAgi57kgVKq84gCjX0ZvQH+0CZB+bAvr+7QoS4hnllMXmHDPzmaCVymncxqSg FvWA== X-Gm-Message-State: AO0yUKWE9BP9zIuhNyDd8Y+4Ja8Cds43x/qidpEvlNmX7C5fPZiuoJs4 NTCSkarzHNSHwHO6AwxmHtSGmOUPkr60L5QJ X-Received: by 2002:a05:600c:35c6:b0:3de:56a8:ae6b with SMTP id r6-20020a05600c35c600b003de56a8ae6bmr4915919wmq.34.1675447835110; Fri, 03 Feb 2023 10:10:35 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m2-20020a05600c4f4200b003dc522dd25esm3702947wmq.30.2023.02.03.10.10.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Paul Burton , Aleksandar Rikalo , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= , Aurelien Jarno , Jiaxun Yang Subject: [RFC PATCH 15/19] hw/mips: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:10 +0100 Message-Id: <20230203180914.49112-16-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/boston.c | 6 ++---- hw/mips/cps.c | 42 ++++++++++++++---------------------------- hw/mips/jazz.c | 3 +-- hw/mips/malta.c | 6 ++---- 4 files changed, 19 insertions(+), 38 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 21ad844519..f3c2179f66 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -700,10 +700,8 @@ static void boston_mach_init(MachineState *machine) } object_initialize_child(OBJECT(machine), "cps", &s->cps, TYPE_MIPS_CPS); - object_property_set_str(OBJECT(&s->cps), "cpu-type", machine->cpu_type, - &error_fatal); - object_property_set_uint(OBJECT(&s->cps), "num-vp", machine->smp.cpus, - &error_fatal); + qdev_prop_set_string(DEVICE(&s->cps), "cpu-type", machine->cpu_type); + qdev_prop_set_uint32(DEVICE(&s->cps), "num-vp", machine->smp.cpus); qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", qdev_get_clock_out(dev, "cpu-refclk")); sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal); diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 2b5269ebf1..3109644c5e 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -79,10 +79,8 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) CPUMIPSState *env = &cpu->env; /* All VPs are halted on reset. Leave powering up to CPC. */ - if (!object_property_set_bool(OBJECT(cpu), "start-powered-off", true, - errp)) { - return; - } + qdev_prop_set_bit(DEVICE(cpu), "start-powered-off", true); + /* All cores use the same clock tree */ qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock); @@ -106,12 +104,9 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) /* Inter-Thread Communication Unit */ if (itu_present) { object_initialize_child(OBJECT(dev), "itu", &s->itu, TYPE_MIPS_ITU); - object_property_set_link(OBJECT(&s->itu), "cpu[0]", - OBJECT(first_cpu), &error_abort); - object_property_set_uint(OBJECT(&s->itu), "num-fifo", 16, - &error_abort); - object_property_set_uint(OBJECT(&s->itu), "num-semaphores", 16, - &error_abort); + qdev_prop_set_link(DEVICE(&s->itu), "cpu[0]", OBJECT(first_cpu)); + qdev_prop_set_uint32(DEVICE(&s->itu), "num-fifo", 16); + qdev_prop_set_uint32(DEVICE(&s->itu), "num-semaphores", 16); if (!sysbus_realize(SYS_BUS_DEVICE(&s->itu), errp)) { return; } @@ -122,10 +117,8 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) /* Cluster Power Controller */ object_initialize_child(OBJECT(dev), "cpc", &s->cpc, TYPE_MIPS_CPC); - object_property_set_uint(OBJECT(&s->cpc), "num-vp", s->num_vp, - &error_abort); - object_property_set_int(OBJECT(&s->cpc), "vp-start-running", 1, - &error_abort); + qdev_prop_set_uint32(DEVICE(&s->cpc), "num-vp", s->num_vp); + qdev_prop_set_uint64(DEVICE(&s->cpc), "vp-start-running", 0x1); if (!sysbus_realize(SYS_BUS_DEVICE(&s->cpc), errp)) { return; } @@ -135,10 +128,8 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) /* Global Interrupt Controller */ object_initialize_child(OBJECT(dev), "gic", &s->gic, TYPE_MIPS_GIC); - object_property_set_uint(OBJECT(&s->gic), "num-vp", s->num_vp, - &error_abort); - object_property_set_uint(OBJECT(&s->gic), "num-irq", 128, - &error_abort); + qdev_prop_set_uint32(DEVICE(&s->gic), "num-vp", s->num_vp); + qdev_prop_set_uint32(DEVICE(&s->gic), "num-irq", 128); if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { return; } @@ -150,16 +141,11 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) gcr_base = MIPS_CPU(first_cpu)->env.CP0_CMGCRBase << 4; object_initialize_child(OBJECT(dev), "gcr", &s->gcr, TYPE_MIPS_GCR); - object_property_set_uint(OBJECT(&s->gcr), "num-vp", s->num_vp, - &error_abort); - object_property_set_int(OBJECT(&s->gcr), "gcr-rev", 0x800, - &error_abort); - object_property_set_int(OBJECT(&s->gcr), "gcr-base", gcr_base, - &error_abort); - object_property_set_link(OBJECT(&s->gcr), "gic", OBJECT(&s->gic.mr), - &error_abort); - object_property_set_link(OBJECT(&s->gcr), "cpc", OBJECT(&s->cpc.mr), - &error_abort); + qdev_prop_set_uint32(DEVICE(&s->gcr), "num-vp", s->num_vp); + qdev_prop_set_int32(DEVICE(&s->gcr), "gcr-rev", 0x800); + qdev_prop_set_uint64(DEVICE(&s->gcr), "gcr-base", gcr_base); + qdev_prop_set_link(DEVICE(&s->gcr), "gic", OBJECT(&s->gic.mr)); + qdev_prop_set_link(DEVICE(&s->gcr), "cpc", OBJECT(&s->cpc.mr)); if (!sysbus_realize(SYS_BUS_DEVICE(&s->gcr), errp)) { return; } diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 6aefe9a61b..d18aeb439b 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -302,8 +302,7 @@ static void mips_jazz_init(MachineState *machine, qdev_set_nic_properties(dev, nd); qdev_prop_set_uint8(dev, "it_shift", 2); qdev_prop_set_bit(dev, "big_endian", big_endian > 0); - object_property_set_link(OBJECT(dev), "dma_mr", - OBJECT(rc4030_dma_mr), &error_abort); + qdev_prop_set_link(dev, "dma_mr", OBJECT(rc4030_dma_mr)); sysbus = SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(sysbus, &error_fatal); sysbus_mmio_map(sysbus, 0, 0x80001000); diff --git a/hw/mips/malta.c b/hw/mips/malta.c index af9021316d..3b88668bae 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1064,10 +1064,8 @@ static void create_cps(MachineState *ms, MaltaState *s, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { object_initialize_child(OBJECT(s), "cps", &s->cps, TYPE_MIPS_CPS); - object_property_set_str(OBJECT(&s->cps), "cpu-type", ms->cpu_type, - &error_fatal); - object_property_set_uint(OBJECT(&s->cps), "num-vp", ms->smp.cpus, - &error_fatal); + qdev_prop_set_string(DEVICE(&s->cps), "cpu-type", ms->cpu_type); + qdev_prop_set_uint32(DEVICE(&s->cps), "num-vp", ms->smp.cpus); qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", s->cpuclk); sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal); From patchwork Fri Feb 3 18:09:11 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: 650101 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972482pva; Fri, 3 Feb 2023 10:12:37 -0800 (PST) X-Google-Smtp-Source: AK7set8FBWpO4GjVfsccqOxxnio68J923lqNHftBNGmDjKFVaM0bOwRllKaY0DzcaYJuKcExSCL9 X-Received: by 2002:ac8:57d6:0:b0:3b8:6cd5:eda with SMTP id w22-20020ac857d6000000b003b86cd50edamr22156334qta.47.1675447957695; Fri, 03 Feb 2023 10:12:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447957; cv=none; d=google.com; s=arc-20160816; b=xF8UfAndix7TLD8XyW63+G3Y+D5vJh3FS1cSm2UiFa1NnhL8KoWq5NGozHTFHW3Vb4 lYusJLkAD82jWTnK7ulU8itln4edwTLqGYPwruwQlYDYrJRVhcbG9KFZCwYM4o/xT8n+ GqIDqr26V+FVPHMurSxziXwDSianUUyOAgI++HUgR20xQRvzmjk+yNPC+GXW4tuwSFuD H0JCR//hflmvzrD81QtkcySo5PXlGyE1p+UZ6kqDpBOJO7mPiEG1p9HfB/20AcM+IzdL gXTRb5hwYSYB1/grdggRroQUfzJ1Jp1woGdkcSykmWNevVYX8IOA3aBIyCRJnvNOh5bC 5A/g== 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=g8ALrbnz1qXI5HffWq09XMPgoWQJ0GtQQ757vbcP15I=; b=fnV1ny7yHHAJxymqjnchd5AZusb8TpuCNYlH9FlAP+rpbTG/68OKtXxY6us+sHFNgv e4tKcHh0yEW6q/nPlxXTbm2pATcOkXj8EBEXgz7YAAEsHeuFkESHGyvNeXQ0IlDVxj2n GcJqrLWrkA9hW5vKBikzwqJvRnU7Gd8lTZ18I591WBwm3118+xwpW/9YeifWvdDw/ZRa a5+Art1nGv/do1hGMp2ON52t80jr/2wAY5C+YUr94lYSAaHLutjqpYNBOb1WVIoVCVb9 pu6JzuKLkj+HO5R+Bcd036cAe19EV3U6O1v2EFMtQ0tPyhIr1fv5ufGtlXlL9TXPGWe3 rn0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HNjQLyre; 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 e7-20020a37b507000000b0071aa932dacdsi1925968qkf.43.2023.02.03.10.12.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12:37 -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=HNjQLyre; 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 1pO0WL-0002Au-NL; Fri, 03 Feb 2023 13:10:45 -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 1pO0WK-00027k-Of for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:44 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0WH-0000hX-Jm for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:44 -0500 Received: by mail-wm1-x32c.google.com with SMTP id j32-20020a05600c1c2000b003dc4fd6e61dso6581945wms.5 for ; Fri, 03 Feb 2023 10:10:41 -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=g8ALrbnz1qXI5HffWq09XMPgoWQJ0GtQQ757vbcP15I=; b=HNjQLyreQEHxmL4W5YYy8YHCmF9c03nB90ylx3Gfz/8BOXXhldHAP1r5R++XmzSCNl rFWWJv66Vr/SdTWnMscDKkdJ9tbO1E57TdJ+AA7ZNi8Xeg07whxkgN7lx/oLZednUAt7 4yytnpoGSzrqy6a5UBBVj3SDHzmUyWuEkvejlSFB0HZEjbng9Ba6MjHOOvylEHOOWSgA K/b0ntaL861gYFFNwWi8qz9uDJSPe3ibknBqJlsnN+tiCWEY59OKNCYfnu+RAI50FkZT oGBLQi8f0LH/L8re9+heWSbcjX1jF3Sc5cqmoBUEE56NOafMiGzr3LQ4q+EIEA4/67sR m5Mw== 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=g8ALrbnz1qXI5HffWq09XMPgoWQJ0GtQQ757vbcP15I=; b=bIviyNFDMNWSRvUqVTIlYSxHo8vArXNwbj3bgyOgFOGavVJXhoxY6v8L88GidVRuhV SeLhPAh2XcGTrNkKcxKExiFE6/YpyyuE7aloiECoBLQfyjnEhr8qv4EPz7JNb8AkzP9o IJ+ywndVt8QkYMra9hD982kN/9qOiu4lNG9UTSsUESWuRX35Zf+knKSTII7G++YNYwc3 vl1hzJs7StpCo/p/W/NNVGrynfJ9t6H/mUuK0+FOKSSKl6rV5ZmVpjuS/F0Bp5IEdRDP eGuDZ1k2G/lNqoWfvGVuU3RDxu9rEnUZf/P/i2Wi+sseC/hIRKxZwIN2P5smmIdyVLLP 0Jbw== X-Gm-Message-State: AO0yUKXg4BOJQimhk97xUL6XtVACyZDB7gLDSzmceNXuUdUb9Y1Xag2O RuCkSYD350s1z8xZ0RzG7KoPsL7YPLv8sD4k X-Received: by 2002:a05:600c:1c0e:b0:3df:ee44:e45a with SMTP id j14-20020a05600c1c0e00b003dfee44e45amr1344963wms.15.1675447840235; Fri, 03 Feb 2023 10:10:40 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c7-20020a05600c0ac700b003d1d5a83b2esm8154958wmr.35.2023.02.03.10.10.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:39 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Chris Wulff , Marek Vasut Subject: [PATCH 16/19] hw/nios2: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:11 +0100 Message-Id: <20230203180914.49112-17-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/nios2/10m50_devboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c index 91383fb097..01f6d5c84c 100644 --- a/hw/nios2/10m50_devboard.c +++ b/hw/nios2/10m50_devboard.c @@ -102,7 +102,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) MemoryRegion *dev_mr; qemu_irq cpu_irq; - object_property_set_link(OBJECT(dev), "cpu", OBJECT(cpu), &error_fatal); + qdev_prop_set_link(dev, "cpu", OBJECT(cpu)); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); cpu_irq = qdev_get_gpio_in_named(DEVICE(cpu), "EIC", 0); From patchwork Fri Feb 3 18:09:12 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: 650102 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972490pva; Fri, 3 Feb 2023 10:12:39 -0800 (PST) X-Google-Smtp-Source: AK7set9oE9MKZMXPhaZ+usuvvGvvbFLzYiyw+bN2HwQqfSoVrKEVtzBapci7thTNGWNYjKdwLFWs X-Received: by 2002:ad4:424b:0:b0:537:653d:690 with SMTP id l11-20020ad4424b000000b00537653d0690mr17263947qvq.50.1675447958878; Fri, 03 Feb 2023 10:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447958; cv=none; d=google.com; s=arc-20160816; b=r4LZMTunMRYSYLOilvFFO+oiVgFbAWxDty3SCvDR3s1tey3K8zv6uetA4lJF8xfxaK debRlqrBERm1aZmV8NnGGuDwOVUU6dVl2MXLCGZTf6sHNMJt04PGHou7kHXw9NjkaVO5 ftcOBGbv5zUNkDBGDHFBOmoHgG8hfnKw/Djb0DqifhNqdnRficJcthrkQmh1SRITl/nC 69Uj+253LFjiCuSPX4mXScbgCU583j6Q0hrztfsvj4tA3Fvo9nlRcC/VsyJ7nECfrm+s FweZpxIVlI4zJrg1LjYroiV2ZOsu/myZ9PgLUFVmV+qTw1g2wNkd/8GOC9hOV1hqF2yu xPXw== 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=KssFyaPm059TI8uO1WBCvVEy7+56aC9XzP9/EK8Uaa0=; b=m4aLUTZ9vYNSSgPkedwD+v+GByEONmLSIYJ8iO1M7hP59cbXjfmkTP7OZGS7bqiWGm 1i/lfwIHcTyEUzX837I7gZc6vyR/sjN4k/xZiKlY48i28DswI+3zV/ukwj2LSTOlZEHq qfjNQoahWbdE87eAVeXZRgfVqgn4tL/G/OEjjwKOUjWAe5V9owJVAJ6tMR5/wbY0y999 nwpElncuPFziw41u4mkwgmdVIqdjjlDTy8al2zc3ty3qmxWERGqVuNGOIZws/DEaJrkN Hd43OuWKZPAiRoINYerh0NqaWVlJhX5ITol1mwsCphhGRNCmJylp7ooZmNglDl1enxyx wFXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zMPSlq0B; 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 j12-20020a0cf50c000000b00568f86db86dsi1639850qvm.341.2023.02.03.10.12.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12:38 -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=zMPSlq0B; 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 1pO0WR-0002lu-On; Fri, 03 Feb 2023 13:10:51 -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 1pO0WQ-0002bO-4C for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:50 -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 1pO0WM-0000kr-Uc for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:49 -0500 Received: by mail-wr1-x42d.google.com with SMTP id r27so1578685wrr.1 for ; Fri, 03 Feb 2023 10:10:46 -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=KssFyaPm059TI8uO1WBCvVEy7+56aC9XzP9/EK8Uaa0=; b=zMPSlq0BOs6EJa6ya9h0GgTxlS9MJw59qUI718cglBA2nlAKPeWBUbxRKMYxgtit5M TawBRE85lkIN93SIh366mzT0p3z61yPhxhiQfHdnGmmMWTkihylXs023/PA+NMbERVhD S4AUQlwNtJ93lh4sbna63930gPNTTJIrh0bVeEh7fIx1EyaJgfVkpkX/I9oXdGhSwLyN eJltEKexUAgPdOZ2syswY0F6/HmETvckx86ujIE4L43Bd21VSFpRljNj7YS0PCcZF3z8 O4DIyxC2pa7BwGJc5N4tVaYF8LR+YKQW5/HQe0GCTpPD5eWArOxuBBMpzUjQP/CzmtaU jqgg== 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=KssFyaPm059TI8uO1WBCvVEy7+56aC9XzP9/EK8Uaa0=; b=zgWbhBX/nFMIrpGFNS9fmsyMjbx8ODGdvMqIvHiCv9J202zTrcG2EqYPkdS9QfnXyA nsUCqmUnULgD5Cvqx5RULjnXFd/URvCDLg+4U8xhYCEl+P73RFLL+ysabMzvZ6TYlMye EiGTzyjbL/BY88DTpz2KH5MPuqU/B34S3uJUrl4dniYsO3yb2nV6X10c4ETrmbmwM1qd 7JY3o4dHME2txr0wP6A/B0YQqBnoQlZVToOUQjeWq51oYnLFL2c8W1skZn90Eeky95/D m37HDr1wu/45+PHJLCgRyFwBs+OPk5tmtB/Dtmn31t3ZULRKcuSbYKXlWisHijQqHEll yhfQ== X-Gm-Message-State: AO0yUKXSa0sCh2yYr9mVcuwKP/N0ZnG9vLPDpAMPzgPXnuZgCprzWogA UZEgL3TeIKigAViouBr0CbagEVLbPJTGLOxX X-Received: by 2002:a05:6000:3cb:b0:2bf:e766:90f4 with SMTP id b11-20020a05600003cb00b002bfe76690f4mr10770428wrg.68.1675447845316; Fri, 03 Feb 2023 10:10:45 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id e23-20020a5d5957000000b002366e3f1497sm2567804wri.6.2023.02.03.10.10.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:44 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Bin Meng , Palmer Dabbelt , Alistair Francis , Vijai Kumar K Subject: [RFC PATCH 17/19] hw/riscv: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:12 +0100 Message-Id: <20230203180914.49112-18-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-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=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. Signed-off-by: Philippe Mathieu-Daudé --- hw/riscv/microchip_pfsoc.c | 8 ++++---- hw/riscv/opentitan.c | 9 +++------ hw/riscv/shakti_c.c | 7 +++---- hw/riscv/sifive_e.c | 8 +++----- hw/riscv/sifive_u.c | 9 +++------ hw/riscv/spike.c | 10 ++++------ hw/riscv/virt.c | 9 +++------ 7 files changed, 23 insertions(+), 37 deletions(-) diff --git a/hw/riscv/microchip_pfsoc.c b/hw/riscv/microchip_pfsoc.c index 82ae5e7023..ff6c4b0471 100644 --- a/hw/riscv/microchip_pfsoc.c +++ b/hw/riscv/microchip_pfsoc.c @@ -423,16 +423,16 @@ static void microchip_pfsoc_soc_realize(DeviceState *dev, Error **errp) qdev_set_nic_properties(DEVICE(&s->gem1), nd); } - object_property_set_int(OBJECT(&s->gem0), "revision", GEM_REVISION, errp); - object_property_set_int(OBJECT(&s->gem0), "phy-addr", 8, errp); + qdev_prop_set_uint32(DEVICE(&s->gem0), "revision", GEM_REVISION); + qdev_prop_set_uint8(DEVICE(&s->gem0), "phy-addr", 8); sysbus_realize(SYS_BUS_DEVICE(&s->gem0), errp); sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem0), 0, memmap[MICROCHIP_PFSOC_GEM0].base); sysbus_connect_irq(SYS_BUS_DEVICE(&s->gem0), 0, qdev_get_gpio_in(DEVICE(s->plic), MICROCHIP_PFSOC_GEM0_IRQ)); - object_property_set_int(OBJECT(&s->gem1), "revision", GEM_REVISION, errp); - object_property_set_int(OBJECT(&s->gem1), "phy-addr", 9, errp); + qdev_prop_set_uint32(DEVICE(&s->gem1), "revision", GEM_REVISION); + qdev_prop_set_uint8(DEVICE(&s->gem1), "phy-addr", 9); sysbus_realize(SYS_BUS_DEVICE(&s->gem1), errp); sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem1), 0, memmap[MICROCHIP_PFSOC_GEM1].base); diff --git a/hw/riscv/opentitan.c b/hw/riscv/opentitan.c index 64d5d435b9..f69db8c31e 100644 --- a/hw/riscv/opentitan.c +++ b/hw/riscv/opentitan.c @@ -145,12 +145,9 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp) MemoryRegion *sys_mem = get_system_memory(); int i; - object_property_set_str(OBJECT(&s->cpus), "cpu-type", ms->cpu_type, - &error_abort); - object_property_set_int(OBJECT(&s->cpus), "num-harts", ms->smp.cpus, - &error_abort); - object_property_set_int(OBJECT(&s->cpus), "resetvec", s->resetvec, - &error_abort); + qdev_prop_set_string(DEVICE(&s->cpus), "cpu-type", ms->cpu_type); + qdev_prop_set_uint32(DEVICE(&s->cpus), "num-harts", ms->smp.cpus); + qdev_prop_set_uint64(DEVICE(&s->cpus), "resetvec", s->resetvec); sysbus_realize(SYS_BUS_DEVICE(&s->cpus), &error_fatal); /* Boot ROM */ diff --git a/hw/riscv/shakti_c.c b/hw/riscv/shakti_c.c index e43cc9445c..32d3d7cbab 100644 --- a/hw/riscv/shakti_c.c +++ b/hw/riscv/shakti_c.c @@ -168,10 +168,9 @@ static void shakti_c_soc_instance_init(Object *obj) * So let it be in instance_init. When supported should use ms->cpu_type * instead of TYPE_RISCV_CPU_SHAKTI_C */ - object_property_set_str(OBJECT(&sss->cpus), "cpu-type", - TYPE_RISCV_CPU_SHAKTI_C, &error_abort); - object_property_set_int(OBJECT(&sss->cpus), "num-harts", 1, - &error_abort); + qdev_prop_set_string(DEVICE(&sss->cpus), "cpu-type", + TYPE_RISCV_CPU_SHAKTI_C); + qdev_prop_set_uint32(DEVICE(&sss->cpus), "num-harts", 1); } static const TypeInfo shakti_c_type_info = { diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c index 3e3f4b0088..0f5dfc5f3d 100644 --- a/hw/riscv/sifive_e.c +++ b/hw/riscv/sifive_e.c @@ -178,9 +178,8 @@ static void sifive_e_soc_init(Object *obj) SiFiveESoCState *s = RISCV_E_SOC(obj); object_initialize_child(obj, "cpus", &s->cpus, TYPE_RISCV_HART_ARRAY); - object_property_set_int(OBJECT(&s->cpus), "num-harts", ms->smp.cpus, - &error_abort); - object_property_set_int(OBJECT(&s->cpus), "resetvec", 0x1004, &error_abort); + qdev_prop_set_uint32(DEVICE(&s->cpus), "num-harts", ms->smp.cpus); + qdev_prop_set_uint64(DEVICE(&s->cpus), "resetvec", 0x1004); object_initialize_child(obj, "riscv.sifive.e.gpio0", &s->gpio, TYPE_SIFIVE_GPIO); } @@ -192,8 +191,7 @@ static void sifive_e_soc_realize(DeviceState *dev, Error **errp) SiFiveESoCState *s = RISCV_E_SOC(dev); MemoryRegion *sys_mem = get_system_memory(); - object_property_set_str(OBJECT(&s->cpus), "cpu-type", ms->cpu_type, - &error_abort); + qdev_prop_set_string(DEVICE(&s->cpus), "cpu-type", ms->cpu_type); sysbus_realize(SYS_BUS_DEVICE(&s->cpus), &error_fatal); /* Mask ROM */ diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 2fb6ee231f..97f504d011 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -540,10 +540,8 @@ static void sifive_u_machine_init(MachineState *machine) /* Initialize SoC */ object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_U_SOC); - object_property_set_uint(OBJECT(&s->soc), "serial", s->serial, - &error_abort); - object_property_set_str(OBJECT(&s->soc), "cpu-type", machine->cpu_type, - &error_abort); + qdev_prop_set_uint32(DEVICE(&s->soc), "serial", s->serial); + qdev_prop_set_string(DEVICE(&s->soc), "cpu-type", machine->cpu_type); qdev_realize(DEVICE(&s->soc), NULL, &error_fatal); /* register RAM */ @@ -905,8 +903,7 @@ static void sifive_u_soc_realize(DeviceState *dev, Error **errp) qemu_check_nic_model(nd, TYPE_CADENCE_GEM); qdev_set_nic_properties(DEVICE(&s->gem), nd); } - object_property_set_int(OBJECT(&s->gem), "revision", GEM_REVISION, - &error_abort); + qdev_prop_set_uint32(DEVICE(&s->gem), "revision", GEM_REVISION); if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem), errp)) { return; } diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index badc11ec43..328278d820 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -25,6 +25,7 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" #include "qapi/error.h" +#include "hw/qdev-properties.h" #include "hw/boards.h" #include "hw/loader.h" #include "hw/sysbus.h" @@ -238,12 +239,9 @@ static void spike_board_init(MachineState *machine) object_initialize_child(OBJECT(machine), soc_name, &s->soc[i], TYPE_RISCV_HART_ARRAY); g_free(soc_name); - object_property_set_str(OBJECT(&s->soc[i]), "cpu-type", - machine->cpu_type, &error_abort); - object_property_set_int(OBJECT(&s->soc[i]), "hartid-base", - base_hartid, &error_abort); - object_property_set_int(OBJECT(&s->soc[i]), "num-harts", - hart_count, &error_abort); + qdev_prop_set_string(DEVICE(&s->soc[i]), "cpu-type", machine->cpu_type); + qdev_prop_set_uint32(DEVICE(&s->soc[i]), "hartid-base", base_hartid); + qdev_prop_set_uint32(DEVICE(&s->soc[i]), "num-harts", hart_count); sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_fatal); /* Core Local Interruptor (timer and IPI) for each socket */ diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4a11b4b010..0e091cb65f 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1360,12 +1360,9 @@ static void virt_machine_init(MachineState *machine) object_initialize_child(OBJECT(machine), soc_name, &s->soc[i], TYPE_RISCV_HART_ARRAY); g_free(soc_name); - object_property_set_str(OBJECT(&s->soc[i]), "cpu-type", - machine->cpu_type, &error_abort); - object_property_set_int(OBJECT(&s->soc[i]), "hartid-base", - base_hartid, &error_abort); - object_property_set_int(OBJECT(&s->soc[i]), "num-harts", - hart_count, &error_abort); + qdev_prop_set_string(DEVICE(&s->soc[i]), "cpu-type", machine->cpu_type); + qdev_prop_set_uint32(DEVICE(&s->soc[i]), "hartid-base", base_hartid); + qdev_prop_set_uint32(DEVICE(&s->soc[i]), "num-harts", hart_count); sysbus_realize(SYS_BUS_DEVICE(&s->soc[i]), &error_fatal); if (!kvm_enabled()) { From patchwork Fri Feb 3 18:09:13 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: 650105 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972692pva; Fri, 3 Feb 2023 10:12:59 -0800 (PST) X-Google-Smtp-Source: AK7set8hGXb15F3Lp6CBON63yGGhuLzLLBu8XFU3W+83h+g/ycAF0MMdigcvIX0A+F3L3yzwDaXK X-Received: by 2002:ad4:410e:0:b0:538:dd64:673c with SMTP id i14-20020ad4410e000000b00538dd64673cmr16035161qvp.33.1675447979105; Fri, 03 Feb 2023 10:12:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447979; cv=none; d=google.com; s=arc-20160816; b=NGr4IoA+eOMae4SKCNRLQtR1Wo0dcAKdh55KZQyziX7YGqK53oz1EU88y9t/tC8neb pU22cKsDaCk/tTvw0rfjYhLmIfGzjSJqQPGkW7DHsaxZH0zKdSY1PQ6qTKSWl3CjZ503 ACDAex0H6VmXGWZALPJXktxCYSaEXQItJlZ2pIIIcvVCGyjK/Z2JAhGPODuOPRHkKoOI xiwByBIkp+Z2TvnJRTEIScw2Xwunr+nsfpC6LxoYnNco9iPQ2U+DFojddFn8/vVtoKEZ 1BmEWofl9mNsDEHseqV5zE/RSEaZaOEbR23vTDzEQJOnUeyLX3GtSCMGRJ2L/Q14vAni tIAw== 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=G/uz1xCSDOP+6dyc1BIJtE4kgUr4oayD/9Q5I8vW7Pg=; b=KPlC87K7Rw0llrbkKqKbUhCSTXcBPQC+CK+rhEjxtAm2wXzqaNeCmStutjgerz36/s qsXXNMPyIqLBK+vSKnMFH1Unf0T1mtG+i+FjLLqqQ7HdjrIAnPAeQLzu4hMCHVedQx2k 29q7L2slAPfoQZkPoMUjU4a3r6uPtj4DQblEBfjsbwKh6a/ii54V+xdotCX7JTKTnyim XyO3jrrN7AigY9rv1WMvZ8tm3ktAAWNqRmVZ3J2Xd1+4iDMDTJnPPp1oRd+i2/vRgh7g hULgcrs91z2n1qpo0pmY9KEJOU2THLgHAyTobZGzVDowCYawjeAoDYOgRGmm0iBCMZRs gHPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rs57IDWy; 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 b1-20020a0cbf41000000b0053211870694si2182440qvj.26.2023.02.03.10.12.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:12:59 -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=rs57IDWy; 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 1pO0WV-0003Bt-HC; Fri, 03 Feb 2023 13:10:55 -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 1pO0WU-00033W-5e for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:54 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0WR-0008VF-Dx for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:53 -0500 Received: by mail-wm1-x334.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so6605768wma.1 for ; Fri, 03 Feb 2023 10:10:51 -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=G/uz1xCSDOP+6dyc1BIJtE4kgUr4oayD/9Q5I8vW7Pg=; b=rs57IDWy4ex+nQZQeb0ZdIEk31Xy11/nJRW20rReogKUl4KeTcl3cc8D8LgRDr/zB+ u1xu9JIMluXipYjm6yV9E/vCM1QV81BfzX0tAdIVcQnw3SCt52ft5tbmv43LCl6DvtTH +QXN/gSlICEsSY7Anmepv49+d8lBSk9UIxVr0gIISD9X1Ok3aWpRr7HtqqsuJSk7XLTn fVD6/NnMCZOT/f2RbzUvvj+eDfPcB+/4tofTKLsSRibABiwE6rlqpTGNK5Eo76e31gJO dbSu47RseekPIV/lwoCjG8G/2gpwb7R4RXsh7j//TXCxI5TY2cP0XC26agoEOcURnJlX nvQA== 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=G/uz1xCSDOP+6dyc1BIJtE4kgUr4oayD/9Q5I8vW7Pg=; b=VZ37ATrOMwUfu8SDCLASDRUvt9C/LPuKHGaqP9E6i96u+e1E2kc3S0e9NDP21sPno7 5J+IxzeIVWfY4bYsuJeKB9BTJTas9HnP3NYby0gmN0ecQpTJ2ZA1EfyzJPH0RjCu8b8T tMu6nvKcVB7FFU4Jv7Lc2gH+R8vVIYKRJC8M2EsyYi8FeK0EcvwmcJpFkhD17QVxBioo FoaQqllPJSra+E+7423j2DHoeeJujKTuEAm7gsSElPn7Kp/9kIicvu83vS2YdzoZbzjp KNPNmP4KT7XsSU3BXAeWMZyPg9IijTnZ1iy4G6a0rqBFb19KRlDuLaXD4CfmElXtV42Y YsxQ== X-Gm-Message-State: AO0yUKVPuQhTrkqIP7SdkYmCMVtmAxSWVs67Mao+244PVsbbPO6WUfob eLi6MCQPA7Bdrx1Oovw3O6/hxChLODqG0uY8 X-Received: by 2002:a05:600c:5543:b0:3df:5eb:828c with SMTP id iz3-20020a05600c554300b003df05eb828cmr4955707wmb.32.1675447850564; Fri, 03 Feb 2023 10:10:50 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id f21-20020a05600c43d500b003dc0cb5e3f1sm3231511wmn.46.2023.02.03.10.10.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Yoshinori Sato Subject: [PATCH 18/19] hw/rx: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:13 +0100 Message-Id: <20230203180914.49112-19-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Yoshinori Sato --- hw/rx/rx-gdbsim.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/rx/rx-gdbsim.c b/hw/rx/rx-gdbsim.c index 47c17026c7..5d50f36877 100644 --- a/hw/rx/rx-gdbsim.c +++ b/hw/rx/rx-gdbsim.c @@ -21,6 +21,7 @@ #include "qemu/error-report.h" #include "qemu/guest-random.h" #include "qapi/error.h" +#include "hw/qdev-properties.h" #include "hw/loader.h" #include "hw/rx/rx62n.h" #include "sysemu/qtest.h" @@ -99,12 +100,10 @@ static void rx_gdbsim_init(MachineState *machine) /* Initialize MCU */ object_initialize_child(OBJECT(machine), "mcu", &s->mcu, rxc->mcu_name); - object_property_set_link(OBJECT(&s->mcu), "main-bus", OBJECT(sysmem), - &error_abort); - object_property_set_uint(OBJECT(&s->mcu), "xtal-frequency-hz", - rxc->xtal_freq_hz, &error_abort); - object_property_set_bool(OBJECT(&s->mcu), "load-kernel", - kernel_filename != NULL, &error_abort); + qdev_prop_set_link(DEVICE(&s->mcu), "main-bus", OBJECT(sysmem)); + qdev_prop_set_uint32(DEVICE(&s->mcu), "xtal-frequency-hz", + rxc->xtal_freq_hz); + qdev_prop_set_bit(DEVICE(&s->mcu), "load-kernel", kernel_filename != NULL); if (!kernel_filename) { if (machine->firmware) { From patchwork Fri Feb 3 18:09:14 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: 650098 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp972238pva; Fri, 3 Feb 2023 10:12:00 -0800 (PST) X-Google-Smtp-Source: AK7set/dEhsL1kkDHoGj+Aep1gGspvXirisYWLe2TV0plMq1SF8Pgj/I67eG9I/SNM6L+Zh4lwcT X-Received: by 2002:a1f:ac82:0:b0:3e1:aeb8:c000 with SMTP id v124-20020a1fac82000000b003e1aeb8c000mr5133896vke.9.1675447919952; Fri, 03 Feb 2023 10:11:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675447919; cv=none; d=google.com; s=arc-20160816; b=LKEsOAiKcje4+uaAz3NdvtxWKHJ5u207iKSB8X/MI9eh8W3ynT/ZR2doG0vDgmJ9Lo RDyocv5p90tN/yggcL8OjuDFRwS46CB3zlnwCeJzs1uFwi/GKNJFuJ8TbcKBcCzZ+B9e Kp6LP6+ZODhWARv6xNp9/v2oDO0mnp0vxTiPLcufG7tv7wFXeH+TiPFHVJbqmaBvGgye lItV+uIm8i292xSR3cxPJelhrzeUfvb2cCNjBVkrxDPZUgTZ1bgJx20FSkX9VBMlAlwL 4cbtS3j1YC1x6B6kcQ5QkxS2his+EighJHiqI+P8NkSVhjqWyk7ftb4IAE1rBicEoIck aYog== 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=I1X0gDpmktmy1MJ+y3Ch36tD5Q1c0/Bd9Mz6MEAa1Kc=; b=iqiiqobS3T4KmDPtibkfmuaukL+jQINkTf44ajz1NK7MbVKV+f5Sjsbr2hjTpIyGph z+duluEVjay6bJdq04zm8WZlqEf639cfYMTBJreCWkC8qonLKjrAWWaH0jV8tUNgUAXG MgFBr/o95tLKlgDhkOi8exeYE8hnlm1ZSwloTFUcF+MTTfDzuNrhv1apy4wyK08I856n Dj+uaReN04ND1AgKe8Xoq5XIgsNVHsyQfe1Oq5FOJ8//yjKuET/Ne7n+3M+d5v/7tQV5 dBBsk9f/vo1j9X+JkHlDab68/pcZirj4pC6kReyD1NOiNhx+KDA9stwazfextOjTd/OG Thpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vOcYP3kz; 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 j64-20020a1fa043000000b003d9eae6fb70si915320vke.53.2023.02.03.10.11.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Feb 2023 10:11:59 -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=vOcYP3kz; 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 1pO0Wc-00042J-3x; Fri, 03 Feb 2023 13:11:02 -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 1pO0Wa-0003ok-8n for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:11:00 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pO0WX-0000ny-Id for qemu-devel@nongnu.org; Fri, 03 Feb 2023 13:10:59 -0500 Received: by mail-wr1-x431.google.com with SMTP id h16so5366705wrz.12 for ; Fri, 03 Feb 2023 10:10:57 -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=I1X0gDpmktmy1MJ+y3Ch36tD5Q1c0/Bd9Mz6MEAa1Kc=; b=vOcYP3kzPydImb49582LG2w8amHds1spIeEId2wjbweHaT/wWk3jWuAQkSEZWkiakK ly8wiZGMvmqtAfXmSFm+eT0rNEg84PLJjF5VNuhFUyF9pZqfPsRSvRzm0WFGreOBDVZN J4/Fz3foJjb+SoysUPc5dr5pnCVCmBFSjiZ4XoVV59ODJo8RgdajIsWEOudgeByz+DQ5 sxCaCvLWqysJSlTz6dqOmtxsE1fU6vJ+5s9f9i7WGOShEVKw5W2+UBEzY+kkNnjzuEB3 y0tdrAxbMtHTg02Hfn47zSk+DF2gS5zMy8IAVL/YHZh9co7z/Htf3Glbs470IaEBHu6h 0YIA== 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=I1X0gDpmktmy1MJ+y3Ch36tD5Q1c0/Bd9Mz6MEAa1Kc=; b=ZY0skgdLvBHOXvEE8Qcs/EuL4IpeWL8khRVTmcby98ggWIJy+8rOSG/Mjx4PVaf8vh pAgkJlO4xheScEoa8nA/pr2buVMw1BtWj03xOPsRb9NB8N8FKPG3MYyYVI2ZkkRPde1A GXHYYZ8nfU4NACJNKGS3Dvq1wQwoiMu3mbXQF5SSyHtCPLLxDbB/lE+uCowCAnWQer7z Rh0gEswbt0HOttP6vPTxCQf8Lz1TxuV6dI861XV1jkTRIrDyV74aQbAWlkwmnRrYMfSJ /bluIrTMcqH5y82s5rXVl3eqC0734OAvsX5o8anxHkOn/jsGADn105/VR/ASjPT9uiqG mNng== X-Gm-Message-State: AO0yUKVWcCVlKqytKTzOOJp/k3f0e5BfSyAZJOGkgG16AeoaURASWE6/ EHHGyfJEZfnT6NbzFQ/il4yfPgO3srZnlZJx X-Received: by 2002:adf:9c8e:0:b0:2bf:d034:f49 with SMTP id d14-20020adf9c8e000000b002bfd0340f49mr9498399wre.1.1675447856022; Fri, 03 Feb 2023 10:10:56 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z11-20020adfd0cb000000b002bfd09f2ca6sm2532286wrh.3.2023.02.03.10.10.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 10:10:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Markus Armbruster , Eduardo Habkost , qemu-riscv@nongnu.org, =?utf-8?q?Phi?= =?utf-8?q?lippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 19/19] hw/sparc: Set QDev properties using QDev API Date: Fri, 3 Feb 2023 19:09:14 +0100 Message-Id: <20230203180914.49112-20-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203180914.49112-1-philmd@linaro.org> References: <20230203180914.49112-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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. Signed-off-by: Philippe Mathieu-Daudé --- hw/dma/sparc32_dma.c | 6 +++--- hw/sparc/sun4m.c | 10 ++++------ hw/sparc64/sun4u.c | 3 +-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c index 0ef13c5e9a..49816755c2 100644 --- a/hw/dma/sparc32_dma.c +++ b/hw/dma/sparc32_dma.c @@ -347,7 +347,7 @@ static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp) LEDMADeviceState *s = SPARC32_LEDMA_DEVICE(dev); SysBusPCNetState *lance = SYSBUS_PCNET(&s->lance); - object_property_set_link(OBJECT(lance), "dma", OBJECT(dev), &error_abort); + qdev_prop_set_link(DEVICE(lance), "dma", OBJECT(dev)); sysbus_realize(SYS_BUS_DEVICE(lance), &error_fatal); } @@ -380,7 +380,7 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp) } espdma = DEVICE(&s->espdma); - object_property_set_link(OBJECT(espdma), "iommu", iommu, &error_abort); + qdev_prop_set_link(espdma, "iommu", iommu); sysbus_realize(SYS_BUS_DEVICE(espdma), &error_fatal); esp = DEVICE(object_resolve_path_component(OBJECT(espdma), "esp")); @@ -394,7 +394,7 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp) sysbus_mmio_get_region(sbd, 0)); ledma = DEVICE(&s->ledma); - object_property_set_link(OBJECT(ledma), "iommu", iommu, &error_abort); + qdev_prop_set_link(ledma, "iommu", iommu); sysbus_realize(SYS_BUS_DEVICE(ledma), &error_fatal); lance = DEVICE(object_resolve_path_component(OBJECT(ledma), "lance")); diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index d9288326d6..f241a676b3 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -803,8 +803,7 @@ static void cpu_devinit(const char *cpu_type, unsigned int id, env = &cpu->env; qemu_register_reset(sun4m_cpu_reset, cpu); - object_property_set_bool(OBJECT(cpu), "start-powered-off", id != 0, - &error_fatal); + qdev_prop_set_bit(DEVICE(cpu), "start-powered-off", id != 0); qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); cpu_sparc_set_id(env, id); *cpu_irqs = qemu_allocate_irqs(cpu_set_irq, cpu, MAX_PILS); @@ -851,7 +850,7 @@ static void sun4m_hw_init(MachineState *machine) /* Create and map RAM frontend */ dev = qdev_new("memory"); - object_property_set_link(OBJECT(dev), "memdev", OBJECT(ram_memdev), &error_fatal); + qdev_prop_set_link(dev, "memdev", OBJECT(ram_memdev)); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0); @@ -978,7 +977,7 @@ static void sun4m_hw_init(MachineState *machine) /* Logically OR both its IRQs together */ ms_kb_orgate = DEVICE(object_new(TYPE_OR_IRQ)); - object_property_set_int(OBJECT(ms_kb_orgate), "num-lines", 2, &error_fatal); + qdev_prop_set_uint16(ms_kb_orgate, "num-lines", 2); qdev_realize_and_unref(ms_kb_orgate, NULL, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(ms_kb_orgate, 0)); sysbus_connect_irq(s, 1, qdev_get_gpio_in(ms_kb_orgate, 1)); @@ -999,8 +998,7 @@ static void sun4m_hw_init(MachineState *machine) /* Logically OR both its IRQs together */ serial_orgate = DEVICE(object_new(TYPE_OR_IRQ)); - object_property_set_int(OBJECT(serial_orgate), "num-lines", 2, - &error_fatal); + qdev_prop_set_uint16(serial_orgate, "num-lines", 2); qdev_realize_and_unref(serial_orgate, NULL, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(serial_orgate, 0)); sysbus_connect_irq(s, 1, qdev_get_gpio_in(serial_orgate, 1)); diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 387181ff77..823d527078 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -583,8 +583,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, sabre = SABRE(qdev_new(TYPE_SABRE)); qdev_prop_set_uint64(DEVICE(sabre), "special-base", PBM_SPECIAL_BASE); qdev_prop_set_uint64(DEVICE(sabre), "mem-base", PBM_MEM_BASE); - object_property_set_link(OBJECT(sabre), "iommu", OBJECT(iommu), - &error_abort); + qdev_prop_set_link(DEVICE(sabre), "iommu", OBJECT(iommu)); sysbus_realize_and_unref(SYS_BUS_DEVICE(sabre), &error_fatal); /* sabre_config */