From patchwork Fri Feb 16 11:02:52 2024 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: 773308 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285237wre; Fri, 16 Feb 2024 03:04:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWP2EFt2SmncfICDv+H4y3Yd541zzfzBGqhes3gO0gEopDG4x6A+fAY3C2uMrnANe8upehRzU30SVN6iLgaK3gB X-Google-Smtp-Source: AGHT+IHu8sLNN2QEy5O0giMVIoMjN0KOU9PRH2h2Vjfdpd2fTScWgmBQse7S8YZ2eNG4mX9zpXSd X-Received: by 2002:ad4:5f0d:0:b0:68f:a59:120d with SMTP id fo13-20020ad45f0d000000b0068f0a59120dmr5766919qvb.65.1708081445713; Fri, 16 Feb 2024 03:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081445; cv=none; d=google.com; s=arc-20160816; b=Tap2mAaJ4M+w3iUdTvMXGXDB66vgyJ4Zuc57XkRbSyAlG/zUaODXgjOm+II0Ql9ttC 4pHleTRoiKNzxQTkKIL7qY1IX3GF+YKfaczdAXatthb8eKjrHCrXGUVZr6Z/+xYsHEgL ArgJyY44AGkTxk7KllwUE+06KOI4aAd96Ufhkv1H0EPcghRTrTLRiw2M15JeeGFZe6oY 3hBLEpNSB/NqGDahfieNJ7VWFhOeHtkcPkx4BXVTsj+fxO1AhRn2m3KpLJFRhrC4fDKc KPgLB05uxFk/OG8ry3xIIj/h7dt+BlH6Kz+DUQ5tWa7ebe0czKM2TQVbbytWLYXqAsIG uK2g== 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=eo0SdoR6qSJ49xsDZEZ0yqz4VDVUEvJcVdzt8nM06Fc=; fh=lo699SrpvFYJnxFLZ6omanT1M6xx54FOFadsij93CRk=; b=ZeIyvPJMsPMdfG2njEpAMhBlQ/UJ29u2WacMzpAss50KxCZumjbykCotFd1mRt3nJZ GEJkeng1D2KWfEceiripKtBNjEenGdy611hiB7QpgsDyDk3Z4evXKzN3MmL3xEIW8V28 9VgT6YJCbreaeQzIvMSWVLfQONOzSx4GGVW0l8kZClhSDezUHXlqZ0R9uUelwgIRc9gA l1vR4OtH/0h5BuZhFMO/hkOrXRfADFv/HLlOZCnDW+KUda3EupHptRFQnCevbCotmw/E KQB4oVApeMHVaqEYVChWFDcKSu64gnKH2j7EOJqxkYK3zuwDctQni9rc7xTPuZPB2JKS 4vdA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oVkk7Hq5; 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 h2-20020a0562140da200b0068ef73244d6si3708508qvh.336.2024.02.16.03.04.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:04: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=oVkk7Hq5; 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 1raw0E-0006Fn-Od; Fri, 16 Feb 2024 06:03:34 -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 1raw0A-0006C2-KT for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:31 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw05-0000nL-MD for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:30 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-412529f671aso1185275e9.2 for ; Fri, 16 Feb 2024 03:03:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081403; x=1708686203; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eo0SdoR6qSJ49xsDZEZ0yqz4VDVUEvJcVdzt8nM06Fc=; b=oVkk7Hq5kNVZHb9M5Sg0jrWnn6XpqE+Lcq+BnZM/XsAACDTAdO50z4VhjTxf431+NJ BSlLLLGOFhgGI08RjkYjIyTgr2QIvBz5EJ12W+5IAURw6Z6rzzh5Ws80m5DeKOoyJkgN hj3q5Gm7DWJoPn6xzBtA+8uWzxru6SWCH70aDHhrb2fSxjilV7WojaU14UA2CEUAw+6d mGJvwEOxM0BFij11r3GXNiQxwuKMk4Urh4R0EFUrqvjyX39J3PTwuImTWAJO1Jv1j40c kie1w2Mtb7nMqeVGTEF9++GWYM2EWc9gwftaLDsJCvy/gFGshNjxzQ1yCL8aT5gqx0Iv UlbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081403; x=1708686203; 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=eo0SdoR6qSJ49xsDZEZ0yqz4VDVUEvJcVdzt8nM06Fc=; b=rq+AlFwkS/0YsYgfYQa62cHE5gaVlNXCqakX1Mu0PLiWPQXurvynvVwb8CF1Ozsvry KRXCgbPa0ArjDvsIIR4PjnXUo+iP+niXkHNN6KlxRrb3SFY49esOsHxDPafSWOGkFGIx 9NhFQtkaEr73w97sm1tswni9wkTB/NkJEprA1XYZ19JNSbc4aGCd8qAYb0hNk3TU6O/F HuSOzVvYMQWmO/J5DKPsyIQ1gloRiBypiQjdR2TOPBW4xGPU8+fVNt1YiSawdKkXdlVV sJKATUHU5n2dWzRzmGvnUDZoPpADCeq46h8gqFqHGtlplY5oliG/mmy4x1BzSzkCsny1 zzNw== X-Gm-Message-State: AOJu0YzQBEDzRfX7IlD7a9IcaDC5qG32RWWrAhyfokNva1vIPVZaqPNZ F7M35NlWwiXTqG+zFE/9CbOC8yr+VenufldC9qTu5Fq+noEzDND4Vw1BmC/dkGvDgZLr4Bx8eGV T X-Received: by 2002:a05:600c:1e09:b0:412:457f:7094 with SMTP id ay9-20020a05600c1e0900b00412457f7094mr977358wmb.29.1708081403143; Fri, 16 Feb 2024 03:03:23 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id b7-20020a05600c11c700b00411c3c2fc55sm1934681wmi.45.2024.02.16.03.03.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH 01/21] hw/i386/pc: Do not use C99 mixed-declarations style Date: Fri, 16 Feb 2024 12:02:52 +0100 Message-ID: <20240216110313.17039-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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 QEMU's coding style generally forbids C99 mixed declarations. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 196827531a..3c00a87317 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1227,6 +1227,7 @@ void pc_basic_device_init(struct PCMachineState *pcms, */ if (pcms->hpet_enabled) { qemu_irq rtc_irq; + uint8_t compat; hpet = qdev_try_new(TYPE_HPET); if (!hpet) { @@ -1238,8 +1239,7 @@ void pc_basic_device_init(struct PCMachineState *pcms, * use IRQ16~23, IRQ8 and IRQ2. If the user has already set * the property, use whatever mask they specified. */ - uint8_t compat = object_property_get_uint(OBJECT(hpet), - HPET_INTCAP, NULL); + compat = object_property_get_uint(OBJECT(hpet), HPET_INTCAP, NULL); if (!compat) { qdev_prop_set_uint32(hpet, HPET_INTCAP, hpet_irqs); } From patchwork Fri Feb 16 11:02:53 2024 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: 773310 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285593wre; Fri, 16 Feb 2024 03:04:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXIdpCi/zcZgopoXyu40mePiA1W6p5+3KCKK4ALQjkwHRkaHAYnH6Q3CRxruewyTRlXupgCUwzDcdGhf4MDLB7i X-Google-Smtp-Source: AGHT+IEWEHAtStIgKAjvzCps104VN+bhsAyXh6zSTVZaNrbM53u98iJ2KQkRgxEQGOhMA6p+kbdo X-Received: by 2002:a05:6214:3d06:b0:68c:cce8:34d5 with SMTP id ol6-20020a0562143d0600b0068ccce834d5mr12989303qvb.32.1708081493475; Fri, 16 Feb 2024 03:04:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081493; cv=none; d=google.com; s=arc-20160816; b=sO6E9SS2xaqHkUAUv2/ufCuXi5go2uVXQOBYuCw6jw6c23aDBbuL0rwGHmybCueYyC gvOUNSHP8mIiEYUQyibUyeZ7lRd4Ki4FFFQfqORvQ9eZpcmr0zLyJ3yvySndfOzJ/vUe Ldu1P+iNsjj1azrvxIV43lS89LBVTFJXo0Eh9eHFVDutWWuXUFLC1O4vk5rmEn8yXh3A x43o3fP1VY6aaX+iVhvyoSeN2FgUblVmgtYHmyMackyzNOpEBQrksqcRYl+VbKTWCvw1 0Ky5XXW2dz7Z00PsTmLaGeg/EA2A6Gbunwj10+6km5HTC4hjJ5soOgALOkSAWllpoB/I /wCg== 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=11uvKBQ22hdk4Lseo0ZUQbLGXppus19b55fkM12lrfA=; fh=lo699SrpvFYJnxFLZ6omanT1M6xx54FOFadsij93CRk=; b=ikE/ffirCoiItsPqQWKWbgSbaKNujsMI0wvBUTIvDkUywLkR/gbL19aeqCQgJAS6XM XKcS5tvdEGoiaoQvfy5lpqwEjFxXU4LklqoKjTfIdIQWXpm4gNQgy881iug+OhOHGF2D tzDbBJogPk5HaOa2skL2MH7KA2BKuAqwVc7Y4oj771sXB4/UhpVpawQcqhs/VmvG7R/o xU622UqDv5Ilo/JCHvUgid1F//DgM/jxXjmzKn6Z8E5bBQ0otxYMz/gE9wrDlZgRn0sz WJdgWLf/0FociQGBoGIVPSOce0a1sUhNIwMUg3EtplEVWMpfVCIFu3h8f0kz5lpG/PnZ KF+g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VVtEuRON; 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 l4-20020ac848c4000000b0042db2599576si3329686qtr.700.2024.02.16.03.04.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:04:53 -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=VVtEuRON; 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 1raw0J-0006Jy-Dq; Fri, 16 Feb 2024 06:03: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 1raw0H-0006JE-Mq for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:37 -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 1raw0D-0000oV-Ia for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:36 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-33d14a711efso681052f8f.2 for ; Fri, 16 Feb 2024 03:03:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081409; x=1708686209; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=11uvKBQ22hdk4Lseo0ZUQbLGXppus19b55fkM12lrfA=; b=VVtEuRONg16xx1oOe+nOWr24BGDYupjedUe7m/Ujf6aVZ+6pexCN+uWLFWnvv6/die f0p5imiKaKkivgTp0MnTNlr2Xvra4oKuMAKBKsNCGmky56UcgLPxTSbGVeIA7/qUmts1 hd8JyMbK6VxjKivF4ClO3HOjxZ6DXyTYaRKR/pAf0ei7zKtKY3RtciPy8DQTwKH0O0mV PVUSfPxkL7VgsbizmdK9JWuw7bN5bzjwwdPbwgd6To7jkWDMgWn6WGmBNy85sAuq2WFw ReVQmnsYNRJuTvqgeU2ZhqCVZfMShzvN+mXHUSnP7xeSMjG6JH7Xd1Z+UHpwTVQCgv1e fmAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081409; x=1708686209; 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=11uvKBQ22hdk4Lseo0ZUQbLGXppus19b55fkM12lrfA=; b=P7LMImfzuersiKzc/KF0cXreZa50DDJUzlHICS/l8bnSiE3OVBmmQ9Onu0AhdMm0xu WbwP91Y7vDbrbe7722+nfvWmGBDFpSCXkYM3kwCv2AiKGCQ14F/qiSv/1mt38CPfl3wo ZabAxp6xFsCzK4mhfvLgooymdqd2O05OgCMEHfHwuO3PFzGy1AolUzl88FUN3F/7QKDJ K25+0W5/NnT9T25uowshkzrGysAH/CbstLW2VsAf2VsVzGLkCzbznmAendixsZ0TiFaH zt3UO+PVxFcMzucuP4Db8YHx3kH36SMe87+mVeHKvfGsKRrd5r4fWf2uYLDchODkFDda 81Sg== X-Gm-Message-State: AOJu0Yz1NyKC1+SkmLc6vuZ8+u1psoXTHQiLQ8BeL55Gsy/I6eFvZrap E62uJ5Uhu51RlHuabSeKZvNusKkkZPaNsBXrlpSYcPKstG/4yivQKg4+yP4L4ZjOlYpGVKAS+Js n X-Received: by 2002:a5d:408b:0:b0:33a:fafa:8cdc with SMTP id o11-20020a5d408b000000b0033afafa8cdcmr3540983wrp.32.1708081409620; Fri, 16 Feb 2024 03:03:29 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id ay3-20020a5d6f03000000b0033d1b760125sm1780146wrb.92.2024.02.16.03.03.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH 02/21] hw/i386/pc_sysfw: Use qdev_is_realized() instead of QOM API Date: Fri, 16 Feb 2024 12:02:53 +0100 Message-ID: <20240216110313.17039-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- hw/i386/pc_sysfw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index c8d9e71b88..3efabbbab2 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -107,17 +107,15 @@ void pc_system_flash_cleanup_unused(PCMachineState *pcms) { char *prop_name; int i; - Object *dev_obj; assert(PC_MACHINE_GET_CLASS(pcms)->pci_enabled); for (i = 0; i < ARRAY_SIZE(pcms->flash); i++) { - dev_obj = OBJECT(pcms->flash[i]); - if (!object_property_get_bool(dev_obj, "realized", &error_abort)) { + if (!qdev_is_realized(DEVICE(pcms->flash[i]))) { prop_name = g_strdup_printf("pflash%d", i); object_property_del(OBJECT(pcms), prop_name); g_free(prop_name); - object_unparent(dev_obj); + object_unparent(OBJECT(pcms->flash[i])); pcms->flash[i] = NULL; } } From patchwork Fri Feb 16 11:02:54 2024 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: 773326 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1288164wre; Fri, 16 Feb 2024 03:11:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVfPVws6EA9FdJagyyFH0KLd9oz1mTnFST/2Skdf8DL+xi+joGzaxMDZWvTGAKo4MT6Tw7YOZFjgnx4V7rjQRiu X-Google-Smtp-Source: AGHT+IGGHCSchlDibC3b+L71slbQTJuGPPgdOw9iaRMJQo0J7xtUpOKEeUUjF1DJDkC/MWCeZlXb X-Received: by 2002:a1f:4f02:0:b0:4c0:2d32:612f with SMTP id d2-20020a1f4f02000000b004c02d32612fmr3499155vkb.15.1708081860379; Fri, 16 Feb 2024 03:11:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081860; cv=none; d=google.com; s=arc-20160816; b=ZUgAeZhEo9RrQKaBSxc25nWMAoOvneeTPvRMFk7Ljxvkn0v+NiXU4oAAelKZ2SeiAX rIS2GkbXExcY7EODGK5gs4pzgWFpYTeyLE3Qnt91jAzSiqSyo1Le+RFD5VIgqCWulB1C hKRX3KUlvrjQBmrpcQFdSXF81rJGbV2fL/qlqcUdRx3S36Cd23lEdBxMZXqyPZqOHwXK cxbxGdKjtsi5GoC8FOO77jQesuFcWDV0JhcTMrc75pTrYbphN5+JDdrk9fbgDekMURZx GWB7mh+FSncLrwCzkRay8K3d6+/ZjLWGRKtyvvgGXSqEEmlTFQm2uL2erZ9KBuf/sOj6 u+2w== 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=jnkIS3AaHEP065b9a1SZ9IcaJ8jPciqvA+XhsfUsiWs=; fh=0UDKgNz4yjNBVu75Ye1IuKJrBNYD8tZdxMkofi2vxCQ=; b=IwsZhujsmWIPWpJRxkpRJLmss6VUpEN4sXdlgNpfavHH5Tmee5ZcnC8bT1HY5NOxmM YRss3NL6sAD1QMz3CTtQ4UCksgdhn14lEOClGcgUJht9ddzlI4YICc6d7jSEm2ZulSg9 JTrWMFTa2rDpGYBHkEuXndF6GO8zOVC5vk6cxQzon43cjZVAqND+gtotjh16O5/V2B/j mIxNHw8ypr/FVG81IE0yyOewnDUu2q6FPsxQbUT2f/OE/xYYjKEujvt1Zt9+Th7vpxs4 JZXmMhDEO29DpJtzYO2Bvv/mDsKwfGA1vltBylJKO0x9W6NUlnDZabw/he0kek3lnfAe l7jw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xwk2xuO8; 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 iy13-20020a0562140f6d00b0068c5dffc2dasi3757498qvb.283.2024.02.16.03.11.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:11:00 -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=Xwk2xuO8; 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 1raw0W-0006RL-7c; Fri, 16 Feb 2024 06:03:52 -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 1raw0S-0006Nk-Pe for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03: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 1raw0J-0000pv-D2 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:48 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33d01faf711so571675f8f.1 for ; Fri, 16 Feb 2024 03:03:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081416; x=1708686216; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jnkIS3AaHEP065b9a1SZ9IcaJ8jPciqvA+XhsfUsiWs=; b=Xwk2xuO8gUd5m24pdtCIK+51HtqI0K8DX6rY4qrU8Oh6w/gcQV50/ngb/AZe4bg9op oBGmuZE5FVtE56VBWhjNE7YGqWErOzN26YnTMUGbNK8nfeWCOJ5waOKdsNhpX46YGk9i Ap8jO/vr8kqza8kGnIAcg+iTVgpDKVrKZIGQlCMIpk0+06OxC4k+AxHzg/MOLVfBh8Ws SiJr5mH3+XUmq8+H80MySpDDzokzqoSiBUvXLkZ75v7N/jROevb06vxxPVMAp+kIuo4m vp8gznQuv7V/eBCNbhENNuVz7c68oBcoDgu1gHFhj/rMWvOJ5RMGL8zrPI1/v/wrb6f2 nAMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081416; x=1708686216; 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=jnkIS3AaHEP065b9a1SZ9IcaJ8jPciqvA+XhsfUsiWs=; b=uEOE2DqwipAXw5hm9+PfDsErJh/nntv2EILfd21EFmfszjzWCjiZSLcgSfp9iQtHL1 s3+5i1UMGc0+kkEdhUDCFjflQCLQ4gLgulT0dqU6UCdtn1zesIbds/YAi1ZKh0+d408H mWn1y6Hqw0z3IiFvo1WvpicJJOdUo8RpncqajZk/RH+rIsA9d+WQZyRCaO3tl+wpinJp /clgXsPYjpVGyEHiiEr882oBo0zmueJvrvHt+K0+eP8yXafGouyJPik6QHPxxI7Oa+4P DA6DapO47ZxCqN3eoOhqgiVHrNOy4Wm1Z53BaEKWP3YZXicw73Bq3eyNM0IZEKGK/iLN sJ2A== X-Gm-Message-State: AOJu0YwI2cKFwE7+MNs4A1m6jlBHxD+bNoU1h75WWeoPNlFqU7h6Nq4M s1QNAJtzitUunRaCuKvCIp+HDpTEGCzsT83v90oLTMWYG1EkYZTJRSk595+WXOf6DE+1ancgt0n G X-Received: by 2002:adf:f4d1:0:b0:33c:e3da:923a with SMTP id h17-20020adff4d1000000b0033ce3da923amr3667425wrp.12.1708081416026; Fri, 16 Feb 2024 03:03:36 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id r8-20020adfe688000000b0033cf5094fcesm1863549wrm.36.2024.02.16.03.03.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , David Gibson , Harsh Prateek Bora Subject: [PATCH 03/21] hw/ppc/spapr_cpu: Use qdev_is_realized() instead of QOM API Date: Fri, 16 Feb 2024 12:02:54 +0100 Message-ID: <20240216110313.17039-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- hw/ppc/spapr_cpu_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c index 0c0fb3f1b0..40b7c52f7f 100644 --- a/hw/ppc/spapr_cpu_core.c +++ b/hw/ppc/spapr_cpu_core.c @@ -245,8 +245,7 @@ static void spapr_cpu_core_unrealize(DeviceState *dev) * spapr_cpu_core_realize(), make sure we only unrealize * vCPUs that have already been realized. */ - if (object_property_get_bool(OBJECT(sc->threads[i]), "realized", - &error_abort)) { + if (qdev_is_realized(DEVICE(sc->threads[i]))) { spapr_unrealize_vcpu(sc->threads[i], sc); } spapr_delete_vcpu(sc->threads[i]); From patchwork Fri Feb 16 11:02:55 2024 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: 773328 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1288363wre; Fri, 16 Feb 2024 03:11:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWzlBK9WrenUJobGGppN6BEO/WJvvtuixrV8yWDiohTfKildL+gw1PyHhkd0kg5U3fb61Sc5shYNghCbSjrKRnF X-Google-Smtp-Source: AGHT+IFzKzT8H90AjIJGvvIDDuiCZT/7qEnsYwHeARgeiHoLQ+yG2mcr65ac8wKIGDWV1KDUy+QF X-Received: by 2002:ac8:5f96:0:b0:42d:adef:bf62 with SMTP id j22-20020ac85f96000000b0042dadefbf62mr5372885qta.14.1708081883629; Fri, 16 Feb 2024 03:11:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081883; cv=none; d=google.com; s=arc-20160816; b=KJIDHpjEuDPT/yVdryYR2CeadeE5pz96X8HrIj2vw93suhDZmHLwSt7D5lyoyDhc28 ccNjEJ0ThdUSQCbdSZR1OyJaYd5JknL6O8w7EgJkpmnciRCHPhBcjcywQn8jqbqOe3nJ ARN64Aj4gzT+aGun2w9mgIS1RotbO0baMTG6ZgTPqQsPk/UUKlQILa6JVNEzgO0bK4O5 KicJ8D/Ja2owreSwSbeYXODjBRVXWIoC/Wmuv/QXzQ7RZK2TtgFiz13zdD23BYkvp2EV FZeos9zGhqTGZHb/Fs469hcx2he+shOYNka5WmNb/ubVxm60lqzw5AZTYBibMMYNLwjj O8Og== 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=kkGLYDX+GSE+ZJ9BSh+2Q16g0HNqBL3+uba9nDXc65E=; fh=yY3cfVrdTI0FQ0mqsz8xWWGdc7mdmBSyIIP51TRI9RI=; b=kZxZgk6DSpCAM6+ef6fcDM+2dq1XZkhcTczudpvO/zAJdnO5+owHloYT7qCE4w1/Qf MppXc0lQpeKEnwbytWyFiQHqHDLkXuXaluJ6I4IcbTmx3yI6VyT3lNRKgR6uVOx3dn9L iIF7vmdh2MfCeed73Axhakkls1lsVo4LV1ysn/w4pLG1B4MPLTOS8vq0iPBep22GhqnM WDXkQwFDQTpntW4XLAofQBWCRKKLzdCNqM32LBhZJFu8sz28F3OGppQ5jujEFMqkgPRw 8dhWEEd4rQ5/uVq0mElHaOQLpWQrMbgCxY1dMbRx6SjD2es0HEteO7aP2yBCwDmIQF+v azlA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qnm1dp3s; 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 u11-20020a05622a010b00b0042dc9057affsi3878067qtw.128.2024.02.16.03.11.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:11:23 -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=Qnm1dp3s; 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 1raw0V-0006Q4-8T; Fri, 16 Feb 2024 06:03: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 1raw0T-0006O1-Qr for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:50 -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 1raw0O-0000ra-SB for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:49 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4121a8635a2so12177345e9.3 for ; Fri, 16 Feb 2024 03:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081422; x=1708686222; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kkGLYDX+GSE+ZJ9BSh+2Q16g0HNqBL3+uba9nDXc65E=; b=Qnm1dp3sycbUkM+tBK1UduQ6hTzF0RbdoXxMESGYgym/1Aa2naOY1aL2YYD32XicXv hOmC0FtBDCr42KliVaKivFtoIaMa53uaG+y3Q+TtpdublYzgKaSkfebOGAtZJV/Pt8gl DNIinS7b/JGDKlw9PEqXmbYyYFri5td98f97rS2wxzOMVrG2aDIVyVNLKahBVbe7R8Jo PJMHoAs5dSCCgTdy+53XsNRir+cE9BNuo5nR6dF0/LUGKKPuQDlCbD88ssBwmsiH9iTT acKTyG7g6zyMc1ShyhpeClrdUAUvtEpgA0Uvj4cDzsNuXrk1F3eGz94r79+7FGUqWjnw olgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081422; x=1708686222; 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=kkGLYDX+GSE+ZJ9BSh+2Q16g0HNqBL3+uba9nDXc65E=; b=nh6VAnCSnKXPHKt6EvJHkDaHpzzkADzg975nQDZUkq1dYBqx/wJRWRWW19NwPVQF9a LyZmveQhXa1f92jEuMjLibmNDFRGpxxro/2cafICUuNHIgHHu3r0Rk+xp7dVo406TWb0 jQJcE/ByU4jF8baItAtYxS+gv+vRNd7oousoVnBa/+s5xCguebLssr8VDWwDj56F8bzF paj1F8/D/lDntHU0dqPyWK+E4MPWKmwijnLjE7De2tjK8ewMkrvVe8NhQ06c529VwOeP gZmBDlyMi6QVj/FmNvFrSUbLonRVY52DYcEzUodxrJjT+TRO2X3v196TmBR+SbyXsLFm omTA== X-Gm-Message-State: AOJu0YyhIwW3bdqDhhKHc1TyifzVJ1SKczl4cVuyyZrLl2s//4bA2wLG KZkN10hScS7Rbtfr7FChAABAuLgfFpy50k7ee4j8Ootk6kovM0w4z34ItSEvMGMl5JhcxCf4EHc V X-Received: by 2002:a05:600c:1c9d:b0:412:3c20:5c67 with SMTP id k29-20020a05600c1c9d00b004123c205c67mr1395904wms.39.1708081422054; Fri, 16 Feb 2024 03:03:42 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id jn4-20020a05600c6b0400b00411b7c91470sm1942118wmb.12.2024.02.16.03.03.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Bastian Koppelmann Subject: [PATCH 04/21] hw/tricore/testboard: Use qdev_new() instead of QOM basic API Date: Fri, 16 Feb 2024 12:02:55 +0100 Message-ID: <20240216110313.17039-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bastian Koppelmann --- include/hw/tricore/tricore_testdevice.h | 3 --- hw/tricore/tricore_testboard.c | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/hw/tricore/tricore_testdevice.h b/include/hw/tricore/tricore_testdevice.h index 8b4fe15f24..2c57b62f22 100644 --- a/include/hw/tricore/tricore_testdevice.h +++ b/include/hw/tricore/tricore_testdevice.h @@ -25,12 +25,9 @@ OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE) typedef struct { - /* */ SysBusDevice parent_obj; - /* */ MemoryRegion iomem; - } TriCoreTestDeviceState; #endif diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c index b6810e3be0..c29db8b451 100644 --- a/hw/tricore/tricore_testboard.c +++ b/hw/tricore/tricore_testboard.c @@ -89,9 +89,7 @@ static void tricore_testboard_init(MachineState *machine, int board_id) memory_region_add_subregion(sysmem, 0xf0050000, pcp_data); memory_region_add_subregion(sysmem, 0xf0060000, pcp_text); - test_dev = g_new(TriCoreTestDeviceState, 1); - object_initialize(test_dev, sizeof(TriCoreTestDeviceState), - TYPE_TRICORE_TESTDEVICE); + test_dev = TRICORE_TESTDEVICE(qdev_new(TYPE_TRICORE_TESTDEVICE)); memory_region_add_subregion(sysmem, 0xf0000000, &test_dev->iomem); From patchwork Fri Feb 16 11:02:56 2024 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: 773311 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285807wre; Fri, 16 Feb 2024 03:05:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX7RrDXlPp7hEgRsbuJ96oV3mpJWVg68J15EV+3kY4A4urFlLKoUerypOhTYxu/bYK3gyl8hI87PH3PhZSJPw4V X-Google-Smtp-Source: AGHT+IEOljiMO29Uev76VTyK+E0xSGGvtVqyaKmzgR7Y9aSfpMTXSFY5Z0MU6PF5e373nvgJ2aUU X-Received: by 2002:a0c:ca0c:0:b0:68f:1e47:a8c0 with SMTP id c12-20020a0cca0c000000b0068f1e47a8c0mr5312493qvk.11.1708081521717; Fri, 16 Feb 2024 03:05:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081521; cv=none; d=google.com; s=arc-20160816; b=jtpISBVEy9aJQmyuVnifCVF+GomhbFud8iJcPTWamWAMAK4XbufrYR+zaSogF27djt DZu3WTPS1fh3sx/Ejxl9vzgMf8SdgEGzHFXLitWZ3bmq9vsmsfUj1cSibFdjPd4MzjPL 0pBf23CmE8vaJThNKJh6SfCZWfUtQ+QURl3bKM6AN+LAAVg0OFWa4zTA+fT1UyhLbWvP Kj48hy6MCEMOPfYHFrV17PFhX87QSgOVkRQJ8CFp8ri7JzlhkIvarwabh4erbT5JQFIY ZKE7tE3mW6K9/A6TogcMCrrEXxbh1Uh4OHJQxyp5zEQPVznfZFqi9yJpAgJ3CKqfYHiQ qfug== 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=NuItVagnX21LnnaFpIrCDiEh6nnybH9GKoEtwiotckg=; fh=MYr+tyZZlCa/Q0qkt125rkFGddyr3/nqWgQD3VNiOug=; b=MoOPnkVbPQHQzsPe/4kdrLcpaqu7nMufoGMh411haFmc4YFJ2XRZhPqGay4//+LxG3 9X+IEAg7Lzn54RZWNhr/M+N1qxD7WxnALOrgb67mO2S6MnkQ1ujP/qbKW+zQU4/Sp/8T wosJsTrSonBvi69DBxaxK9uDKzpd3OaNm+JB23XVXaSgooaJBMrYM49sfp8o+tbhBkdI k7TtkMiwyeD+aioWz/C9IPqm+GyUaDqB5rsj/7COMzDp0jbG8XH8yjLKUPWHVJwkwo2o 3QG7zKx7wZyKCYfKCxl4l2MWmjeoJz+etX8Ak4aX+tHIIEuDueUk8ImsS2QuKz4Rogv3 NJvQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zNIr7y0E; 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 m14-20020a0562141bce00b0068cb7c033d6si3722132qvc.24.2024.02.16.03.05.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:05: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=zNIr7y0E; 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 1raw0X-0006TQ-Gu; Fri, 16 Feb 2024 06:03:53 -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 1raw0W-0006RK-5J for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:52 -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 1raw0U-0000tB-2g for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:51 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-412345cca4eso7136985e9.2 for ; Fri, 16 Feb 2024 03:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081428; x=1708686228; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NuItVagnX21LnnaFpIrCDiEh6nnybH9GKoEtwiotckg=; b=zNIr7y0EqNB2slVEoVD7JE/EWg79kDhOfze+vjPAGjuJ35R1MMLkDxzeIG9MuY2uTc teic7TqLhD7U17NYex5MxbWWKRrFY7mLll2gs18eQ5pdqS7v0IZjK4k8TuExWAyN1WYP ETooz96kVf67wAqZhv05YpAwLvvO3m8mRkWsXrb1Fll6N4/ISmgIsINOmYod0EHbmJvJ NI2JTpSHqi7DDFPc1+hnuylXIkr1dBEv3bqdc9IybqRfoMtGwKjIQcLII3Qo5Dy6hvih +jqIQAzq3wnKZkwCzefgEewZxjgxR2LZfedaGU/EDu+x52xWs9m8iPkpXEM/UqNteDio lEBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081428; x=1708686228; 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=NuItVagnX21LnnaFpIrCDiEh6nnybH9GKoEtwiotckg=; b=iF11jaQZNJSJKJtP/V8da8L8guObVERNqzDfnKf950D29Kj4L2EUz8ThzTRT8Fz+XW /OThyhT+QVYEKuVEQYmtZjcCdW99aPE7dWqbIH+xxldCKiH2I7cS1AeF5ihAw7A7MU46 52zRuZIL2sYReVKEYJc8w9Vu04pEqHTR9RuGCIC5j2GhZweUNlv5te5+VGeCPpqBE8qh CJvRZiWVXk6mWyaP05yRsd4Gtcltg5tq+gQSTB92/2w1SWfud0tOsZhT1mYphWZo49Pr aQsLbx7yNwsHkv33Zne8W03QMw8AWBAhWTgSAI3zmlDoOQQetd7qxlErS5pI4LdaQsoH vIrQ== X-Gm-Message-State: AOJu0YwQTJhp+6qZJBnJn1I+0OTiyoBmfgV/T2ARK67rZvggMABUEOt4 SXwmyX+1x5jefWNiqLFq/9/Q2fDmLqmQ+MlOGzmpoGP6jzyH0ZPxzciVhrzVOPJM0HKJBvL6zKb Y X-Received: by 2002:adf:f34b:0:b0:33c:e1fc:65c5 with SMTP id e11-20020adff34b000000b0033ce1fc65c5mr3642680wrp.69.1708081428352; Fri, 16 Feb 2024 03:03:48 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id k4-20020a5d5184000000b0033b4f82b301sm1942603wrv.3.2024.02.16.03.03.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= , Nicholas Piggin , =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= Subject: [PATCH 05/21] hw/ppc/pnv_bmc: Use qdev_new() instead of QOM API Date: Fri, 16 Feb 2024 12:02:56 +0100 Message-ID: <20240216110313.17039-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- hw/ppc/pnv_bmc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c index 99f1e8d7f9..0c1274df21 100644 --- a/hw/ppc/pnv_bmc.c +++ b/hw/ppc/pnv_bmc.c @@ -269,13 +269,13 @@ void pnv_bmc_set_pnor(IPMIBmc *bmc, PnvPnor *pnor) */ IPMIBmc *pnv_bmc_create(PnvPnor *pnor) { - Object *obj; + DeviceState *dev; - obj = object_new(TYPE_IPMI_BMC_SIMULATOR); - qdev_realize(DEVICE(obj), NULL, &error_fatal); - pnv_bmc_set_pnor(IPMI_BMC(obj), pnor); + dev = qdev_new(TYPE_IPMI_BMC_SIMULATOR); + qdev_realize(dev, NULL, &error_fatal); + pnv_bmc_set_pnor(IPMI_BMC(dev), pnor); - return IPMI_BMC(obj); + return IPMI_BMC(dev); } typedef struct ForeachArgs { From patchwork Fri Feb 16 11:02:57 2024 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: 773312 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285940wre; Fri, 16 Feb 2024 03:05:38 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVI9wNbBMumbEfqgh6TgiptHDlAzfrv8FegNVlZmJ7CY6h28BwquDlx+kXeAM99WXI/lKl2uxy9VhVr++4bjBJE X-Google-Smtp-Source: AGHT+IHjSUixBU1GI0IDd4TFYn8q0Ve6GCXspt4tyQvBaKdmzswg77Llggjm/AyEXCcv2JfiI4im X-Received: by 2002:a0c:f0ce:0:b0:68e:f0ad:93f2 with SMTP id d14-20020a0cf0ce000000b0068ef0ad93f2mr4553647qvl.19.1708081537997; Fri, 16 Feb 2024 03:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081537; cv=none; d=google.com; s=arc-20160816; b=FMa4r69oXLpRxYkmXwLfVWfWb26VZ3XDsHNOGjM09WSfIAHf06D91Ji11aTL3zmr/z Iv0brmA1cuKKaBp1TvNXLn7ua4W2WCTuvrhtmeli108MmoEIHO3VB26TldmPPqKgbq7x r1TimdnAOs6UDeFe/4jQN7uNnwyvhV7wsHePNxvK/hqUSjZKyy2SOogzhmdz9fr4idP9 Q6fXmX4ZWy2d/G/SusLoardOl1VfH8md74CaEoFru3vBMGLkMaeBo21nybUPCuYJ8imm MrEQOzp2jSJICXOPhSYXSGx5/qClkdd/LaXelB38s21Mp4dgyWryskgyF9RABPfWKaML A2uA== 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=jyHSiP+USy9LLsFpR2fD5RYQ//7L3lzistxQTGbBMcU=; fh=mFnen777txzR4qYJX4RargeSoe8/T845RMRdgI5rRv8=; b=Ro/DSG8T9pMc13phPepjbrPH3LzFOQbQAeheINYspjdFNVzDIeUyhO+ckRaxH0UmDk kcb8moflungNKUD52XtqsPwheTitlrJ1qt1LtYUT3LUhsIjxNbD6ZjIJnC6LTGVrPtiX 7u8nCGr9n7WVcYdwkPwaI/NVOF7hy7ZKNzhzEHx9oLzhMhG3iwSDvgdl4hSW42W4aZ9u CYrLQD1DSCtgh+mBZKWolStz4bqgLopmP6jepfRp4EgAXl2siPXFZNzLIYzzmB4DfooI sNJxmUmZE8l9smbQ2oTE7JFGaxdO4jz/oZeAYSp1gHGjQpa/KIbxONENTxpo3H3Oa6HR j3VA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tI5dWdyK; 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 8-20020a0562140d6800b0068f2eed8e0esi1821819qvs.287.2024.02.16.03.05.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:05: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=tI5dWdyK; 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 1raw0f-0006a4-Ga; Fri, 16 Feb 2024 06:04:01 -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 1raw0d-0006YK-MG for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:59 -0500 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw0b-0000wX-E6 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:03:59 -0500 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2d0b4ea773eso23787391fa.0 for ; Fri, 16 Feb 2024 03:03:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081435; x=1708686235; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jyHSiP+USy9LLsFpR2fD5RYQ//7L3lzistxQTGbBMcU=; b=tI5dWdyKBhFtIOXg5uWn8++EdwkI9bV/ShkHlbHXcI8QS0TYyvoSc41cti49Wvdft9 K+PTrFwaaRGWQ1R24NTKTx1s4vFvhm68JwaV7uH22nfGyqTdl19qEx4ys8R/WbUR6Z7C 8HuEIsw8JZaf+xJpPO+2k3/ltziAMVqwcZQxJpE+gcdDxNshmWTAXpN49aqYkwN3Syjb zs9k87MnMfIw2zB9/HGkQwQ+PCziC3QwCY5ZJeUVK8QM8Uz4LyPkROMlslodrt5mrw3k 9soYk769Y4j4N5EzhghvOl1GUN954L3lb1Jrv6E6uRpOdr1YAVLfwmwgQF9bq3I4nAAT 7smQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081435; x=1708686235; 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=jyHSiP+USy9LLsFpR2fD5RYQ//7L3lzistxQTGbBMcU=; b=s/Bf3AcZLW1DWh4c5oxv7qu67R6aK4Qe+nvrZpPrk0jWlYI3sdE5d9WSSc7pIDYid7 7S7re9ekdqn7sRD43ldVU9F7+lryKK3+sQ4cchR6h5TRJA/77LYDAj5n/pVs9j/bpHnA G6lUU+/n67uwmhSSKDVqRWdvSCbn3nTwpVx25f4Csg29Sq7L9caWsSJ9xYrnnpHMCaAT fDNsWYkIB+r6GZuLcd5zrEKmtR6KPJhQsmJfDzIMjx+DB9/yiRhI4M5y4aIN1055GVHV ztl72KxsVZTrobXVcTIBNR9ptDZJFdGtpRbc6/HDZrmLCBIK7wUGw8y1E+0T9VeEUf61 Xo2g== X-Gm-Message-State: AOJu0YwsYdSPPAGtv49wIzm3Vp3nXsMSo2sZdQmapoISHeLxZuUu1T1H Sypcv4bZN4VdPrTNuZIIdVBi1ITXfidV/MK7+8IGJV5BmyY9+HFZmi49hR4PS77lF/cc2UE6wkU O X-Received: by 2002:a2e:8911:0:b0:2d2:12d8:42a5 with SMTP id d17-20020a2e8911000000b002d212d842a5mr1692149lji.7.1708081435334; Fri, 16 Feb 2024 03:03:55 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id bk30-20020a0560001d9e00b0033cddadde6esm1920641wrb.80.2024.02.16.03.03.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:03:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jan Kiszka , Peter Maydell , Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Mark Cave-Ayland , Artyom Tarasenko Subject: [PATCH 06/21] hw: Replace DEVICE(object_new) -> qdev_new() Date: Fri, 16 Feb 2024 12:02:57 +0100 Message-ID: <20240216110313.17039-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=philmd@linaro.org; helo=mail-lj1-x231.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- hw/arm/musicpal.c | 2 +- hw/core/qdev.c | 2 +- hw/sparc/sun4m.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 2020f73a57..74e4d24aab 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1238,7 +1238,7 @@ static void musicpal_init(MachineState *machine) qdev_get_gpio_in(pic, MP_TIMER4_IRQ), NULL); /* Logically OR both UART IRQs together */ - uart_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + uart_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(uart_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(uart_orgate, NULL, &error_fatal); qdev_connect_gpio_out(uart_orgate, 0, diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c68d0f7c51..a271380d20 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -171,7 +171,7 @@ DeviceState *qdev_try_new(const char *name) if (!module_object_class_by_name(name)) { return NULL; } - return DEVICE(object_new(name)); + return qdev_new(name); } static QTAILQ_HEAD(, DeviceListener) device_listeners diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index d52e6a7213..fedc4b8b3f 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -979,7 +979,7 @@ static void sun4m_hw_init(MachineState *machine) sysbus_mmio_map(s, 0, hwdef->ms_kb_base); /* Logically OR both its IRQs together */ - ms_kb_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + ms_kb_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(ms_kb_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(ms_kb_orgate, NULL, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(ms_kb_orgate, 0)); @@ -1000,7 +1000,7 @@ static void sun4m_hw_init(MachineState *machine) sysbus_mmio_map(s, 0, hwdef->serial_base); /* Logically OR both its IRQs together */ - serial_orgate = DEVICE(object_new(TYPE_OR_IRQ)); + serial_orgate = qdev_new(TYPE_OR_IRQ); object_property_set_int(OBJECT(serial_orgate), "num-lines", 2, &error_fatal); qdev_realize_and_unref(serial_orgate, NULL, &error_fatal); From patchwork Fri Feb 16 11:02:58 2024 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: 773325 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1288121wre; Fri, 16 Feb 2024 03:10:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXVhp6yxVNNoKn8O0qTuMkB8M5L7vn941BvtM2a6WNaiG5ejsmAQa08veqSVnvSQZ8hEl82Rs38yPiL/ph8NqlZ X-Google-Smtp-Source: AGHT+IFTndbxFP2F4v1m+X1e217M8/J2Ts2tdxnjCHufFyW54DmJus6mvp/sUx+dis4cYbiOhvqV X-Received: by 2002:ac8:59c7:0:b0:42d:c76e:ccfa with SMTP id f7-20020ac859c7000000b0042dc76eccfamr7191940qtf.24.1708081855295; Fri, 16 Feb 2024 03:10:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081855; cv=none; d=google.com; s=arc-20160816; b=LXDHQtYFAMlfsIuLeV/eG71yYgxuB5npovn20dTTk944A2wrfQm3XS/I1YABE0cf06 jVnwiDLGREh8IxwEHa3r65obzZH9gwLknYlKp1UmNgbzWxM4yWr7OePS9mk7tdqZrek2 kspxH/Gf8o012VTjKzgYU1j6UQ8JcWDCU2C4ZUAc8U9Wwd2+XFcNBEudMr9BOXLg7cWR +1zHklT1QTm8JHfzmq80eMsYx1b6J54Xre+OTJVNZ209xBTU9mHtN1wR1SQOR5ArgCIL EoWJjl6qBy5k3mFSECeE9tdARU8AWZvu3OgCFCrYvxB5CtdIi2xeMB+qB2EEoKonqAnH 97yw== 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=+4cWnhsBShzzzFHqb9EuQ4ogMglB6l+e/nMze0glgi0=; fh=SdHfmMk08V6qaPboySf3LNyDMll0JLG4w+P8OAJe5oA=; b=AEYZkK6tMw8QmZ1z6mMgMUPfltouXuSUVJXPixNbDek3VNXMLTviXDdynivg6gteot yL9ZSy6zeEz8sr5UwOtuOSBrTOsrM2omnymASrlZqIiw0INuU7UvOlzt/75XITYKw3Xn dRpMKxjORZGxVPcuOOaxIOGBuuJ0iET4J5kykKr3QljPpH7oFZlxmxtOxKUilL5IQHSc prvXoT2/RSHZwKq7723n61ZRrsVH6plT0wWTZSA4e0NK9SZ0bMndXdWuT2rL7g9QjsFN D4g5lz4IlQZkyU0U7HSz3pZONdErYboUwmSKYC2y+01pqqzjWFy9roo5OPMpJvrNTg3T 5XcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=loa2CLhH; 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 v23-20020ac87297000000b0042c5d3fec9csi3466144qto.447.2024.02.16.03.10.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:10:55 -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=loa2CLhH; 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 1raw0t-0006p3-Bt; Fri, 16 Feb 2024 06:04:15 -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 1raw0o-0006hA-57 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:10 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw0i-0000z3-14 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:06 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-411d231ea71so14663285e9.1 for ; Fri, 16 Feb 2024 03:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081441; x=1708686241; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+4cWnhsBShzzzFHqb9EuQ4ogMglB6l+e/nMze0glgi0=; b=loa2CLhH2eVGucz+5u/ZHrF/tVm3Kb1XtkZaChSqNZYVLfUMD0wrsLSiUCIX1v+ZZ2 jnXz5aRtVP6cTU3+P5FB0lxpBp84TcD4B/ZpIHLL0UwDR370wc10Ayzy/MMmX50KDTzZ z/Xk/1TgaS3HGA1tZzbOYyJ5yMj5iqUmsvFOtz/mMibvVNmyGoDg6pE7J3ywZfZoyJM+ rP5QIqhDB64AJm+QA0C/hkCE5WkVITAfkMzFpGjp46DbKKpYv+z9A4zHOKszin2d1q8w vxNA667jv1R8UcE5ccNyourlTN6BHYxI41xFsKfuTAlNPqFyqEWYIVrJQHdFX1xTtkID EDSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081441; x=1708686241; 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=+4cWnhsBShzzzFHqb9EuQ4ogMglB6l+e/nMze0glgi0=; b=n6Ra7KPfjdWCSeLc8zqX07pITiqtJjuBClbelXjOXHtatzyy9cpS99/Tu0B0cphHSR 1EuX8u4rm9I6whvRPG0QDs9aqMFX77sVMcjGyvmpqaFRT7qABWDaN4oPLDIE9/dAKlu4 Q1ebiNDhmOZ7JszZCp556hoOg5kQUHMAsnvulOhV8Ui7uyPCC+RtbfZSzVs3D30OFSjw KNnRxmJ30w0HLS0/NLzDDaFVluPZZpMPY6IpIT6ceoKkWhBzYaTOfYuQsDcQdhDQkQRU 6CmxiGErBA5iBh8jtH6+D6Fj4cKFbGMpFvXBMa9VaeZi5miHjucGoFiH+6P0wqA75kDg +2wA== X-Gm-Message-State: AOJu0YxDDg/XgyxyF4antVqefTlGQ+Lv0P+6ZRTEGp++iwUJjr2UhAHJ XqgaBHbmFp5IBOcfQst/ARoKOmb/l9yRrkZlQITIV548fZRnpbNo6cjcTOhsqD1eS9T0hkwK7jU q X-Received: by 2002:a5d:6143:0:b0:33d:2437:e739 with SMTP id y3-20020a5d6143000000b0033d2437e739mr252251wrt.54.1708081441727; Fri, 16 Feb 2024 03:04:01 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id x11-20020adff64b000000b0033d157bb26esm1880818wrp.32.2024.02.16.03.03.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Max Filippov Subject: [PATCH 07/21] target: Replace DEVICE(object_new) -> qdev_new() Date: Fri, 16 Feb 2024 12:02:58 +0100 Message-ID: <20240216110313.17039-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- target/mips/cpu.c | 2 +- target/xtensa/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index d644adbc77..6b3909ee08 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -649,7 +649,7 @@ MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk) { DeviceState *cpu; - cpu = DEVICE(object_new(cpu_type)); + cpu = qdev_new(cpu_type); qdev_connect_clock_in(cpu, "clk-in", cpu_refclk); qdev_realize(cpu, NULL, &error_abort); diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 79f91819df..4f9408e1a0 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -205,7 +205,7 @@ XtensaCPU *xtensa_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refclk) { DeviceState *cpu; - cpu = DEVICE(object_new(cpu_type)); + cpu = qdev_new(cpu_type); qdev_connect_clock_in(cpu, "clk-in", cpu_refclk); qdev_realize(cpu, NULL, &error_abort); From patchwork Fri Feb 16 11:02:59 2024 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: 773324 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1288046wre; Fri, 16 Feb 2024 03:10:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWMswTIffEE7H5d0XLuFYWcan2tVNNtVgJCASukHDqaHm7IOwifhfYfVglzIU22ZAYaVTmDeNWHLN6C63/9F8lf X-Google-Smtp-Source: AGHT+IEZkQhivtsNT0nOZLbLCzpx41HodA1TSyPcoWc2b9vQ5r0K+Bw2eGWkKQi5btQBQ48F/BKZ X-Received: by 2002:a05:620a:816:b0:787:3e4e:f04 with SMTP id s22-20020a05620a081600b007873e4e0f04mr2901465qks.66.1708081845474; Fri, 16 Feb 2024 03:10:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081845; cv=none; d=google.com; s=arc-20160816; b=iHM955uV20Hfr/cKkaFhdmEG2NentKE61pThsIHKJzwOoN5SyR3vJuBqzt3iZ+8veq 6SEntDIuR9YoZLU78tOu5tKD68nF7c5AP3GX57zKM9dTImXa+R6jM5xhMqrnbOfekztb n2wyAQUQfc2ZhyGjhw4bQGUiZzCWUZABArhSupGVu0JazvpBgc1M1mNeSphKKj3y66K6 CGmPgrmNSMWE8A4Zf0/nVHSQemV3lGgzyZIwWYT2BpDcLgOEmziyz0Dtit+H/pfMbfOq dg4/mKi4G1KUiHJn2LznKCi7wn/C3DSC2GTKMu1OtmGKIFrixYYC0lwL31qNxhYLvGy+ e7pQ== 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=xmVGPYBQPq46VUwxkc77izpk+jGAawySTXLarOn7Kps=; fh=qGhmSOrbdn1Y+K68hTdbBBBTMW2i6vZu0jTJfcFCtbY=; b=cKUd16ORN9/M1VPcD+X7nwdFWOKtT/MJHJhTbD5CpRkKDJPDY4dRllNR3TBfKrPqtd OQ6+p8/2tbGmZPvWTEnw9PUSVt9Rv8VWLdqgj7/s6NIyZqqQpfsn/l1QyPXTtnvCvIyw QVswv+LgsYAN6VNZdiVl+Lb8awq48+RtjcVn3gRz+bVP0qKddtlYKTZqZ5fpBJeFMB7E NvMrRMK2+P9Xtun7iexjtB8qMHd7lp5GMEnVECVRYLtHx3NxI/XjsM0G8lXTCNUGu/0J J+r+fG3O/J3aELBmrJBwCZXG1r1yAB9zJsB7tRP9pYvsipNDvTYfUi5Q7hTpfmb5ftG/ 4ToA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gm+E4p3y; 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 g2-20020a05620a40c200b00786fe4117fcsi3960271qko.388.2024.02.16.03.10.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:10:45 -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=Gm+E4p3y; 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 1raw11-00070D-JR; Fri, 16 Feb 2024 06:04:23 -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 1raw0x-0006qt-F4 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:21 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw0q-00010T-7z for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:17 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4124c3a7a75so2534895e9.0 for ; Fri, 16 Feb 2024 03:04:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081448; x=1708686248; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xmVGPYBQPq46VUwxkc77izpk+jGAawySTXLarOn7Kps=; b=Gm+E4p3yblgCXSJ42IVeSIMR18y1d+Lb6ZpMjvT+QCmcvRshvJmEhOoo/o4pDsY1wn r5yyv16wHznHhFfrLrYAYL9QXyGuJbnAN1m4MC8ErvoN1W3niZyV8HZoyUrg/QAFABwV SIrsJDUuNLIH2Mf8QAqzjAqiqPHZXxUG7iUUkDBojPXOeTBn5Qf4eJMDv8QcTiPGj158 u7ASomjPDNp0vGuHBf+c5yRutxzp6T3JkznIHTJ9pR1L7XjYk3EafMkG9SazH7020DXH NFxId7bTp9RAvrslOlmaV/pYOGIm/RozmERAU/P074z03TTUeg2NGPEpsmuNK9ScK+KI J8Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081448; x=1708686248; 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=xmVGPYBQPq46VUwxkc77izpk+jGAawySTXLarOn7Kps=; b=ZLZk0NDrINRpk+jgeGIVGcGG398U2Cj5QtP3mEqhn8af/mNYSrAUmubAze2Rkxbk7T maw48PddTW2xAVwtKXTOMfecQUt1xcR5yvl0bhnnNme9R6r0X3GktE8GYW2EZ5X7U7BY GZ1rzCPOhN2fbD7HU9j+TbgU56hgCzrY3XH42wfA+DT+9bbZEZYx/Lb0GSfFPwmtjhzp jh1EhTfW7YQTYyE3BpC4wQQCG+0393AUEpss7IiW6odmDg7DIDTyPgIqUSZrMl3NAIXy twWrOnL9jF2zrgo+lF+oM29vGxFw7n+SGunXiCWEpFGqJsv1gGFvBu9erA+ZdKtGb97D ax+w== X-Gm-Message-State: AOJu0YzUwVHnZ0dXxGpfiBNbFqaEazxALQLmYWj1J87+OuOkODVZAMNC IXL/I67shsYHnonbk81/ufdohzMu539lE9UgiVhzlzEWa46glOPhRbQspgBqs4QfLt440hEbfOO 7 X-Received: by 2002:a05:600c:3ca6:b0:40f:c404:e2d1 with SMTP id bg38-20020a05600c3ca600b0040fc404e2d1mr3937401wmb.19.1708081448655; Fri, 16 Feb 2024 03:04:08 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id s1-20020adff801000000b0033d01fe1f04sm1881745wrp.55.2024.02.16.03.04.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Jason Wang Subject: [PATCH 08/21] hw/isa: Inline isa_try_new() Date: Fri, 16 Feb 2024 12:02:59 +0100 Message-ID: <20240216110313.17039-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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 Inline the 2 single uses of isa_try_new(). Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/isa.h | 1 - include/hw/net/ne2000-isa.h | 2 +- hw/i386/pc.c | 2 +- hw/isa/isa-bus.c | 5 ----- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 40d6224a4e..8475120849 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -81,7 +81,6 @@ IsaDma *isa_bus_get_dma(ISABus *bus, int nchan); */ qemu_irq isa_bus_get_irq(ISABus *bus, unsigned irqnum); ISADevice *isa_new(const char *name); -ISADevice *isa_try_new(const char *name); bool isa_realize_and_unref(ISADevice *dev, ISABus *bus, Error **errp); ISADevice *isa_create_simple(ISABus *bus, const char *name); diff --git a/include/hw/net/ne2000-isa.h b/include/hw/net/ne2000-isa.h index 73bae10ad1..2440ac8621 100644 --- a/include/hw/net/ne2000-isa.h +++ b/include/hw/net/ne2000-isa.h @@ -22,7 +22,7 @@ static inline ISADevice *isa_ne2000_init(ISABus *bus, int base, int irq, { ISADevice *d; - d = isa_try_new(TYPE_ISA_NE2000); + d = ISA_DEVICE(qdev_try_new(TYPE_ISA_NE2000)); if (d) { DeviceState *dev = DEVICE(d); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 3c00a87317..e8130774ad 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1183,7 +1183,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, i8042 = isa_create_simple(isa_bus, TYPE_I8042); if (!no_vmport) { isa_create_simple(isa_bus, TYPE_VMPORT); - vmmouse = isa_try_new("vmmouse"); + vmmouse = ISA_DEVICE(qdev_try_new("vmmouse")); } else { vmmouse = NULL; } diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index f1e0f14007..8aaf44a3ef 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -158,11 +158,6 @@ ISADevice *isa_new(const char *name) return ISA_DEVICE(qdev_new(name)); } -ISADevice *isa_try_new(const char *name) -{ - return ISA_DEVICE(qdev_try_new(name)); -} - ISADevice *isa_create_simple(ISABus *bus, const char *name) { ISADevice *dev; From patchwork Fri Feb 16 11:03:00 2024 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: 773316 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1286503wre; Fri, 16 Feb 2024 03:07:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUcLmqLK1j82a10uWKySmhKUvP/Sjk5VAW9+TYbfYoW3meu+hPHfhfM3bk28bnfvwT2odmAI1PXrpkNjj7gsKrw X-Google-Smtp-Source: AGHT+IED3olBV6w6iLl2BqvgEdGvBVJyUFf01vc7dgTZaVEItEEsgyVxU9b35KIsZguL4/eYYdnq X-Received: by 2002:a1f:eb04:0:b0:4c0:2a19:7182 with SMTP id j4-20020a1feb04000000b004c02a197182mr4184476vkh.8.1708081620175; Fri, 16 Feb 2024 03:07:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081620; cv=none; d=google.com; s=arc-20160816; b=hI15GRGvLET6KW1Mypxz8eFF7LLo8aR2x4dGN9f9Kkkrzqr+R2QkKHEP+ESU3ZDrJF GQ7Jx2ecX6bo10wlcwxh/YCDQgc5vmlHo38LGyFMznWQAfUYyKAazgcnERSmHI9BRt6c RPXWmSUjJsWQ0oJRRcMhDTCTAejCtvO/2n7fF4gJRm/XQbQev1l7c6evUC1AxFp2A6y+ pa/b+3T+z45l7Scew6/cOuajApQtOV0f5BFtDUHrfoI8lOuDCDaiX71bQGGXsuOuKsUC cBkvE01+99glhjQA3vsBAYS5eu9DTbFnQxUCiRxQVUdjjmgBD94mEhBFhQptIxV/04n6 7M1Q== 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=7iBFC1QhPdWDrDOtRIvOXPWDjCtIz2lHCQrIRmLbo9Y=; fh=fTye0mSSXY8/JlqSAuxQaJFMVU5XWYTq1j3myzxpdTs=; b=a5QcY8fvOdGlKAcBlMZHUGk8KL3ZKVGPjMgynYuINxjcf44T7nWiULAaeBSBwArTrW gn88jhaqwEko8ZpEfShMFdKacFJ7JnlQtoyuJnM/2kFyVc/Npt1pOoiq90uROHF7G1ar r0d+z/o/t/rvvbyo0vfsDhlfI7n1EhH/feZdNIlPLTC2cfqM0jbpetpb2JhlNR2DnQOt M3MF+ZgMidUimGz8Ne3Y/yjDyf1MKBbM9nniqrMoReeao15z/DABCA2PdNkFe6bKGOCt TYyskoa/wj27HUk7sYS/Q9Sl8hbHcmi9585PuTgHhVpiBlRcVkMCq17P4JEA8ZkY2wGE y96g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wYiptgNA; 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 e6-20020a0562141d0600b00684771ba580si3714007qvd.454.2024.02.16.03.07.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:07:00 -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=wYiptgNA; 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 1raw12-00073T-Do; Fri, 16 Feb 2024 06:04: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 1raw0x-0006qw-Ft for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:21 -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 1raw0u-00011d-L2 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:19 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4124907f6fcso2992465e9.1 for ; Fri, 16 Feb 2024 03:04:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081455; x=1708686255; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7iBFC1QhPdWDrDOtRIvOXPWDjCtIz2lHCQrIRmLbo9Y=; b=wYiptgNATPM6dlfnFTPvx+lWJzI+wJZgbFG8wYD7C3czB9Cy/uqfistfDLM4yxj/U0 /qwWlA+2JzfJgywgFXbiX+Fwq1Al0h3JHuQ637UDAC9sFfTbDmZLsUV+nN0mOBBFtTsv M5tu/2JKLMzH/GFc/WHanaZy8CdIMc3nSZR52EYbMkINHq/REzasZ4val+iRVC6HbgHl A4zS2LKtfaHto88IuwrQHSTzKl9IvJVWSmnJJUEoByabCZYB/APz/rIVLY0kQicaxMwa qoYkpCUWivO8Vn2Z3HdweVwQJOa1xnaX29PjdY5MTy7lkcooDRYPunTwZm+hp915dky+ 4Fbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081455; x=1708686255; 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=7iBFC1QhPdWDrDOtRIvOXPWDjCtIz2lHCQrIRmLbo9Y=; b=YWuAjOin1fbprF4d13YZGzEHD86oyV30H8jFweDeKLYVEKRO/srFiuiMRQBbU1+gTL HkuZIwZXFWBe79/8BwlDgQxj6ZLaTiBSjC0M4YXpwv0Z7VEQHOZT0e9BBUn12bBvtgWh qU9q6mFPTgr68WHu+86lh7Ob/MApKLCok4ZfPxzWTbsUGkonV0KQfVZa5URBqKE/BvZM BI+WOv37xtjFtz2yhYDaFxvnbMQPZaIP4d4aMwnwzbhNU7SehYzLzz9Ak0u15gpmRZ50 IefFwo3vlqKYBDEjASHdOO6X7nezrH+FqKwcKVv+qLYZB1BWSIhYXTp85eoxmw0Mi5Bj g3GQ== X-Gm-Message-State: AOJu0YymlkuoUQ0/jHy+y+pwHrobom7DcPv4o021olxw3UA50I3KjXQ6 Oip7ZXVa5pClMRSyETXT1OIRLDI9sqkf7EB3kfsRiwnKUCYZaUcN0e8+JKgQG564GByH8o2tejS m X-Received: by 2002:a05:600c:b92:b0:410:c69f:51b8 with SMTP id fl18-20020a05600c0b9200b00410c69f51b8mr3531506wmb.14.1708081454975; Fri, 16 Feb 2024 03:04:14 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id k35-20020a05600c1ca300b00412393ddac2sm2036410wms.6.2024.02.16.03.04.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH 09/21] hw/usb: Inline usb_try_new() Date: Fri, 16 Feb 2024 12:03:00 +0100 Message-ID: <20240216110313.17039-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01 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 Inline the single use of usb_try_new(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- hw/usb/bus.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 59c39945dd..148224f06a 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -334,11 +334,6 @@ USBDevice *usb_new(const char *name) return USB_DEVICE(qdev_new(name)); } -static USBDevice *usb_try_new(const char *name) -{ - return USB_DEVICE(qdev_try_new(name)); -} - bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp) { return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp); @@ -447,7 +442,7 @@ void usb_claim_port(USBDevice *dev, Error **errp) } else { if (bus->nfree == 1 && strcmp(object_get_typename(OBJECT(dev)), "usb-hub") != 0) { /* Create a new hub and chain it on */ - hub = usb_try_new("usb-hub"); + hub = USB_DEVICE(qdev_try_new("usb-hub")); if (hub) { usb_realize_and_unref(hub, bus, NULL); } From patchwork Fri Feb 16 11:03:01 2024 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: 773323 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287557wre; Fri, 16 Feb 2024 03:09:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUrJu9wH2erTQNxUlsjvOy3eHdwZyO3s1uIwCpQ5/lwO7d1FbIX/EqxLRAtJXLL85MDcZI8ZKBpdAzlL7Nv2VQo X-Google-Smtp-Source: AGHT+IEgGlrLxn5sM1UM8D0DNKg9CJTxQVM0w8uzYK9HMiF7ZgfSAmvAOdl+S4dzklER+h96rnsZ X-Received: by 2002:a05:6808:1823:b0:3c0:318a:c85a with SMTP id bh35-20020a056808182300b003c0318ac85amr4649195oib.23.1708081769658; Fri, 16 Feb 2024 03:09:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081769; cv=none; d=google.com; s=arc-20160816; b=fk+LHICdPrvELSBg6nd1an8GPOtJZowYti4bNNRCAXc8bx2gfWSh967Abnah3FAvzb OzlOgQeQyZJ1Tk8asCUM3lnfEMwLHcDQPL/uCM4CGsY5D8a+wc/tAVuHAz9of9LiuRWE v0gNwpp/CXQBQQxdDiAMgjBWqWTD576sRsIEz7nXco0UJwxgH9IOGnjl+2unAOku1f60 ZHFDBsGTh7i5LVCGkitG2I5+senNg4D0bag8FUbEuE3SLRUK2z9khvK3Y/ZzJ9AInYBW /y0yN3UnCEcAf73MMo8VOVoYxTmSm74IHb7XyYHSJhJWI7XC+Nff6YmfjA9cRGwhH7Uf vYVQ== 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=1f6J2H1K9VOhN8YiJnj6i61rwEdmxKhJYj3MwXMwmEA=; fh=5Qnrw9e8qimJRC/V5In/+KXUd+bIKApPagk/4KwBjmQ=; b=Mne1MY/fxXGpz3WMmoN6PwV8Ni/mH+8buZUsGklvSCVOc0JEiuEZWL8jeID5yb+Vjk vzR3SUA4dYHqAo1xdjgZ725AZBkdclglXK26mlvYIiNFO7uHclmBX+0ZueHwviK4dcNf Jo1IedqlY9CoRx5Ajq+EfL9cMAhceKmsrn6Sd5KSuEfQQMG1UNhPl/QTYLYZSbE8MUKc M07ZY1ozeKvj4EnjtWym0y+wgmTkXkfgUygt4w90i9OAqi5Uy5Rw0XYAFWwMePrK5cD7 PNPHFwroUjgxXzT54/fUpGgKM+4VfRVYcjGmPSRk4R1BfrBqFmKkIgnprXjP8BRSiXbd YJLA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aklU6aCR; 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 r19-20020a056214125300b0068effee79c5si3584799qvv.494.2024.02.16.03.09.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:09: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=aklU6aCR; 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 1raw18-0007Nn-DF; Fri, 16 Feb 2024 06:04:30 -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 1raw15-0007BI-2w for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:27 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw12-00013E-1b for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:26 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-33d14a711efso681771f8f.2 for ; Fri, 16 Feb 2024 03:04:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081462; x=1708686262; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1f6J2H1K9VOhN8YiJnj6i61rwEdmxKhJYj3MwXMwmEA=; b=aklU6aCRgVVkS4G4qnszjyTTv5IvY/xbh8JwrkXQjUznalKUIvh7LMV/FuwUMv8qwT qPyUkgwuQ1RF9CgV5iEKCgtVjtHoPAghDMs3D4pegzbUspx9nnUV+1y/61YUCwFSelVr pYLGNo4POjhX1n7amesa143IGUtbKy3rPZOXozLnJ1wT54xkewGPjn4AGxart7IJ8GXg T2ErzLyQ8r9ZrxjweRz5e3yAncECGMHnbh60x6qWIIwnqXd0S7t0peR16jF5KOQZmffW IXfOV8bFpTjr50/2VFgVdUPx5Zwms1SuF6/KSqE9P0zCo4NisOwo9Vo66QVKuDon7uCd QTHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081462; x=1708686262; 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=1f6J2H1K9VOhN8YiJnj6i61rwEdmxKhJYj3MwXMwmEA=; b=cgkEdGwznHfFjPcId8wTg6JTaByRIhU7x1gP7Ey+gErROHLsypfX+ZgZFWgTkum0mR ETzS3j3vtHowNLLYPb8JC0r+Eu5x2ScQGUHebMYLUUaB9JJvz2oGY+3c67Vvc33uiv9p xpyHs0TmDxawsZPyAC1LOrEE3GtdR9/zDhuueJ+4NswWKTWMjMqnFMe+HHLeHAChFAio nMgi0BVoLHTqQX8LmCbuKH68E+TPv+jBtCRqrajvJBs6WGoygV/fteK10E9d1t3M6ZPD v7M+a+HceTIWE92x7mKoD7ou1iKfLfHjeNQRXVFMIjYMn/+Z1Qzu1/HyYHb5psu9e7rO Iipw== X-Gm-Message-State: AOJu0YzMF+WKQ7JMJmRv7b0HBAHSOSP+wOCyWzfjSkbY4G1nv/e/+1uq gxm72gwFoTv7CP4+o/H9ImM+LpsZxQ4ZMbVrkU+hppVmFMbY+Y6al38PWTmIqOiEx5JUI43Ufbv 3 X-Received: by 2002:a05:6000:1e8f:b0:33d:2120:1011 with SMTP id dd15-20020a0560001e8f00b0033d21201011mr550180wrb.54.1708081462196; Fri, 16 Feb 2024 03:04:22 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id az1-20020adfe181000000b0033d1f992ae3sm1275770wrb.112.2024.02.16.03.04.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Samuel Thibault Subject: [PATCH 10/21] hw/usb: Inline usb_new() Date: Fri, 16 Feb 2024 12:03:01 +0100 Message-ID: <20240216110313.17039-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Inline the 2 uses of usb_new(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- include/hw/usb.h | 1 - hw/usb/bus.c | 9 ++------- hw/usb/dev-serial.c | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/hw/usb.h b/include/hw/usb.h index 32c23a5ca2..2d820685cc 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -500,7 +500,6 @@ void usb_bus_release(USBBus *bus); USBBus *usb_bus_find(int busnr); void usb_legacy_register(const char *typename, const char *usbdevice_name, USBDevice *(*usbdevice_init)(void)); -USBDevice *usb_new(const char *name); bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp); USBDevice *usb_create_simple(USBBus *bus, const char *name); USBDevice *usbdevice_create(const char *cmdline); diff --git a/hw/usb/bus.c b/hw/usb/bus.c index 148224f06a..a599e2552b 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -329,11 +329,6 @@ void usb_legacy_register(const char *typename, const char *usbdevice_name, } } -USBDevice *usb_new(const char *name) -{ - return USB_DEVICE(qdev_new(name)); -} - bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp) { return qdev_realize_and_unref(&dev->qdev, &bus->qbus, errp); @@ -341,7 +336,7 @@ bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp) USBDevice *usb_create_simple(USBBus *bus, const char *name) { - USBDevice *dev = usb_new(name); + USBDevice *dev = USB_DEVICE(qdev_new(name)); usb_realize_and_unref(dev, bus, &error_abort); return dev; @@ -693,7 +688,7 @@ USBDevice *usbdevice_create(const char *driver) return NULL; } - dev = f->usbdevice_init ? f->usbdevice_init() : usb_new(f->name); + dev = f->usbdevice_init ? f->usbdevice_init() : USB_DEVICE(qdev_new(f->name)); if (!dev) { error_report("Failed to create USB device '%s'", f->name); return NULL; diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 63047d79cf..6e79c46d53 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -624,7 +624,7 @@ static USBDevice *usb_braille_init(void) return NULL; } - dev = usb_new("usb-braille"); + dev = USB_DEVICE(qdev_new("usb-braille")); qdev_prop_set_chr(&dev->qdev, "chardev", cdrv); return dev; } From patchwork Fri Feb 16 11:03:02 2024 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: 773313 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285956wre; Fri, 16 Feb 2024 03:05:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV6ST47OIrk+vVkjJ+RMMuSpMeBL/QLD75YLG5JDCIk+4a3PRKsnY71+sO3XfTgAJTCw5E37hZ0NZ8FUr1+Q/uQ X-Google-Smtp-Source: AGHT+IHE7dxlYEjNSbHuOG7LRPzhVDBXTXnG9TYBNSJnpEfvEPBV1HUL+Rypl7UOuDSxJTCpoQdR X-Received: by 2002:a05:620a:2985:b0:787:3e87:4487 with SMTP id r5-20020a05620a298500b007873e874487mr2854298qkp.12.1708081539093; Fri, 16 Feb 2024 03:05:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081539; cv=none; d=google.com; s=arc-20160816; b=N3wRfegTw4hIU5LKaJaGufJLSRzsZJEAwE3UM5DXrtO6/r3qYOQVSQ0xPAdx6pvdho XSUu0eUknlH8wz4Flgh9h7akJ1G4EjHhAOMZSwABd2PV9qEspWbioLyT0O0BdvElHvLH oKu6LTno2DDfiHHPj9dks0Su2c6IrqG3BJTMt/Htg+uXe/jfY6jXFLXYw0gv9C5cU9J2 Z5HnLd3sAcgjCh6XjD6XLUc9BoCCMM0EBwRRCEw9rqI8kYqqmfAw9eJlm0yfKBkeXTrQ TRRi3HHzZZ5O+1LBsUl1+DhIQUIvrmAiRl2sbc7aFClmbDXzWRGL0pwduK9EU5dpjXL+ cZDw== 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=T0y1oWRnInhsHqZm+cg/tsMm+PW5dK4fpoLCbcPyN88=; fh=fTye0mSSXY8/JlqSAuxQaJFMVU5XWYTq1j3myzxpdTs=; b=E8SJ/r6Cf3Oawk0j3QczibuzqXjJFTU8KCxDpxEBzckwLYnHdB+ppcbLVutvJRmjb4 36k5eQG04Ip6BerCw48Ah8YNqD6F0f9tSU1FhXDOlrarlhhPG1DwB0b1JmM2gM/Eef1c ipXheExhLsvUjFpr3WS9Ie+MEmVe489WrZXSpm4CO0VWI0StGcVhzaxs5Dc5EQtGIryH TyJ/Iw4iA31nsqpBDH95YRqaX/ywXSWGGxW18KUnzIBj8U9sps+LgwNAuDYYewggdNwk yUXporMpm2MWmqpl2K9pYc352wWcxODu0WBveL+VSZ8tA+bl5frpjaWXHaHTyedhNRZ2 yWZw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JH5nC58Y; 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 vz25-20020a05620a495900b007872878b83bsi3706656qkn.211.2024.02.16.03.05.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:05:39 -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=JH5nC58Y; 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 1raw1E-0007bb-N5; Fri, 16 Feb 2024 06:04:37 -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 1raw1A-0007RT-Vz for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:33 -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 1raw18-00014R-MF for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:32 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4125295ff94so1409265e9.3 for ; Fri, 16 Feb 2024 03:04:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081468; x=1708686268; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T0y1oWRnInhsHqZm+cg/tsMm+PW5dK4fpoLCbcPyN88=; b=JH5nC58YOAe6murAf8Ji9d+hD94A2GIfXNBxOprWtySIRQH8TD+apJkRM61FcK4xiv 2PPZRvf7jkRlKW6op+KHRV6P0DCURkaM2CxVv67gi1z77zTUxdaz3lRv8y8NpWjwnBEy OKRbliYrXFW6jn+cU7/cgP4lEwe5DthLSuWMNUqoZHep72E9s34ysVjmuIsB6DwqiBGp EV1hk/b+mzPemEYZrp+OVejzOGF/rA7WBSa3hozafzPkMUlq6mI1ADoo6lAt/Vh5ORJP Kg093cEsMn7UsxNkyV8GbQPNWcnUNg+XE92W9Yg5a0boHXoYwJ2bUgCPz8H3BODx1u+t lNGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081468; x=1708686268; 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=T0y1oWRnInhsHqZm+cg/tsMm+PW5dK4fpoLCbcPyN88=; b=JTiIjHkVeECqLPR6nZIvsGzfvds+O9VcByZf42ZcWkqWE5iW7LNwQ0WPqXG0WjoQz4 a0JyTzPRdZMbhYB8J2jEcMB1ZahNOfPuoMrWQas6AzAsiB8DqauQ7WdKTPWmb0BqMmsV wjv27j5hCl96bRmhTDJqvtrbA6euT0hQMwULJhhIF0VR4WQ+t+TDa5VGLKlNC0Sv4R9u 4HRwyMFcceOX/02qUKA0//NGU686q3oc0FdG49Yv2S0qTBOJxCc1VNcbk2qcPQl9ec8O b5q6CPWoeB0fLng5J13GZWLiaHB17IG8oDJKCmT5pcfitkrl53AnQuvOZEnmKcqoteEm /ZbA== X-Gm-Message-State: AOJu0YwqS7vlSY+Qisdb1WvCjIF5DTDm0i5JT5+wcU7TMb6fWnIckLbt awtJw4SFfrB8qACedkMQ2EjHiWHI1azZZMroWMoPkaEY37Ld9BV5EjkQilYZvy4e6mTkRCVDpOm P X-Received: by 2002:a5d:428c:0:b0:33d:2156:6da1 with SMTP id k12-20020a5d428c000000b0033d21566da1mr553594wrq.61.1708081468667; Fri, 16 Feb 2024 03:04:28 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id az9-20020adfe189000000b0033b7a2136a4sm1911276wrb.97.2024.02.16.03.04.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices Date: Fri, 16 Feb 2024 12:03:02 +0100 Message-ID: <20240216110313.17039-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01 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 QDev objects created with qdev_*new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index a599e2552b..baad04f466 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -439,6 +439,7 @@ void usb_claim_port(USBDevice *dev, Error **errp) /* Create a new hub and chain it on */ hub = USB_DEVICE(qdev_try_new("usb-hub")); if (hub) { + object_property_add_child(OBJECT(dev), "hub", OBJECT(hub)); usb_realize_and_unref(hub, bus, NULL); } } From patchwork Fri Feb 16 11:03:03 2024 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: 773314 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1285934wre; Fri, 16 Feb 2024 03:05:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUpxTNvSoQsmstUOM873uxddOPvPIVcxDWYn5ZL4hNDxTaGmFiFcebLpP74u3IdaPjVZp7OB7Zj3zjXd1f5MPJP X-Google-Smtp-Source: AGHT+IH9llWlQMwg7RDiDe3fbHUxFTlnZjUNIvDsvxlm8J9JQ6LIQzQGQ/xU6tFkeL2WWWQorWb9 X-Received: by 2002:a0c:df88:0:b0:68d:a591:80e5 with SMTP id w8-20020a0cdf88000000b0068da59180e5mr4872709qvl.39.1708081537613; Fri, 16 Feb 2024 03:05:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081537; cv=none; d=google.com; s=arc-20160816; b=mkgs/gzXXOixvRkalBdCkGPSu7eXBETnK2xReVsK8RgHiLn+insMUCWAZJ0rl+gRox KD3rh0PynWOeXPlB+88KFxv6uIBZbvMTgT1+Gqj/ja4VtoIxf1EBdVnXQERvj8nHbIJl KRiSFOb8eyu94GGxvgakqDAdPT61zLZh98QV25NAprnSkDi18y6dr6ccT/4fZL0GjWgZ lJNHsEqjchNu//8g6B/dZyJxHwkmvqam+AErOFe6GU/rlPw3nEhHZgrC5gVnfZSJdJ++ EKli7BwBkFne50eGyKNvPR8YgFDgtIUd5pts016wX7E3WFAFW9MHFsx9MDzGFPkQFrVy oVlA== 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=lSddd7wgwT+Aw6mIanqA0vHkbVR0NSdWvof0YaVRHNk=; fh=PpPyNa5GEKuCuMie00PQMipI4hymEaRA6fmXgxwYmp4=; b=Y/423NIt0M6K6GOaNoU7ZKhUN2AZL0C/6bIrnGJDzWYWg/dYFsSsUNT+LsWqS8bu8i rFvZUMDZkk7kXujCatl9qvj/QMzsOO1iu5vtt97v2489jtNHWePYT2C5YUQxXo6FV6Kk 1aF/6D6JlSBj6rd5YVyJUeuRKfHxSmwYVd+BlXoZaDyvJDZdu6QgR0jlngUmXWbMwI2E AoWLdFhUqOZ3xG54gQqRczK6KVHzX2m8d15co7XG+hz2RwoO35AaGOULFiIoKyDapc/Y DqaBxSoJ58nD7pk855V/yM2lsdaC9VVxv0TVmenQRzLNUwzMfESrfuMS5jT4vgq/46gS BI7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WbTSvauY; 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 jk15-20020ad45d4f000000b0068cccc3bfbcsi3729022qvb.470.2024.02.16.03.05.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:05: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=WbTSvauY; 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 1raw1J-0007vz-Ux; Fri, 16 Feb 2024 06:04:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1raw1I-0007ob-3R for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:40 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw1F-00015c-3m for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:39 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2d10d2da73dso24658561fa.1 for ; Fri, 16 Feb 2024 03:04:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081475; x=1708686275; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lSddd7wgwT+Aw6mIanqA0vHkbVR0NSdWvof0YaVRHNk=; b=WbTSvauYQUvypxaPw7bit1QwCQNsVWwbnLkc3pLQ68kU9yiuZL51QGjnbMpjGQgW/C ziDpm3zbxWJdm/MB1GDpF7+r6//ZHSuOvioOGfhD626hWVbYXbBQczQm7paG7LWidfVU zcWMU418X6f6M9AYr37k6OAcK+7gcUDFOqjWVHD7p5U4Can6PBstIius9Z5OcUbtV4Ar aVzZL2kIN32tUZqF9TncJ6EtMFOtw3wIQMy8C5g/IVxgTUbvnEiqa0BgTCmFXHdBvwly zmMfizwkmlqej5VHWsqe1U8xmd6pUurRXbrATufityGMy+RS30LWkOeXilgea0EWponF lRYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081475; x=1708686275; 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=lSddd7wgwT+Aw6mIanqA0vHkbVR0NSdWvof0YaVRHNk=; b=jGfMPCuY0Ix4gWJkApVq0mzmHlSRVetQnaYEn7k6YMUOg9ixRVXOoB+wfo2XYy2JqS A+i1kcjAoGmhBj8iE+Ea0adtBdOih3HYNqOxThR60BjYSnNVg0wpMXjqzM4LwXjQM/Yc 7f2rv+0wSZERWBwWF2hnBFDvoOebVHs621cjyhdPz7OXkcHl+UzfkfaInlsKeNwnO6f8 Uwi/C6Hf1x8sXjIeI2/qm5C+nj3SOu7DPfh+4nOw6Ce6rk6W+Oc0kq7iF5esyW0qUCQP Tg5gkaSnMNxfdt1lWkgv6ycqiKvQ1m0e8chjJdUOdvEGdoy5lrpByglBSpAxWlaqrn+j vwvw== X-Gm-Message-State: AOJu0Yze2d0ptQVrz331EovXJQBZER48r6EAziVtewcTkHKgK7QhwdGb u4BzJNQ/D9CHHvphsvHKdXl7Ib1QWtZ4lMrbVbhAwhs5CreJZXfI4430CMsAv6lac7X2LE20C7g O X-Received: by 2002:a2e:9247:0:b0:2d1:1e31:c178 with SMTP id v7-20020a2e9247000000b002d11e31c178mr3333201ljg.17.1708081475351; Fri, 16 Feb 2024 03:04:35 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id iv6-20020a05600c548600b004103e15441dsm2036535wmb.6.2024.02.16.03.04.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH 12/21] hw/pci-host/q35: Update q35_host_props[] comment Date: Fri, 16 Feb 2024 12:03:03 +0100 Message-ID: <20240216110313.17039-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Commit aff39be0ed ("hw/pci-host: Use object_initialize_child for correct reference counting") replaced object_initialize() by object_initialize_child(), update the comment. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/q35.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index 0d7d4e3f08..0eb1c7034d 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -165,10 +165,10 @@ static void q35_host_get_pci_hole64_end(Object *obj, Visitor *v, /* * NOTE: setting defaults for the mch.* fields in this table * doesn't work, because mch is a separate QOM object that is - * zeroed by the object_initialize(&s->mch, ...) call inside + * zeroed by the object_initialize_child(..., &s->mch, ...) call inside * q35_host_initfn(). The default values for those * properties need to be initialized manually by - * q35_host_initfn() after the object_initialize() call. + * q35_host_initfn() after the object_initialize_child() call. */ static Property q35_host_props[] = { DEFINE_PROP_UINT64(PCIE_HOST_MCFG_BASE, Q35PCIHost, parent_obj.base_addr, @@ -211,7 +211,7 @@ static void q35_host_initfn(Object *obj) object_initialize_child(OBJECT(s), "mch", &s->mch, TYPE_MCH_PCI_DEVICE); qdev_prop_set_int32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0)); qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false); - /* mch's object_initialize resets the default value, set it again */ + /* mch's object_initialize_child resets the default value, set it again */ qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT); object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32", From patchwork Fri Feb 16 11:03:04 2024 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: 773317 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1286512wre; Fri, 16 Feb 2024 03:07:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVbgIcrQ0De+s1l6jluBZIgxR0yw5Uoyx15qzlED+NYCdovmxkweOhrok/QLIe+QfgakukhEW8XRb4IeD9+pajO X-Google-Smtp-Source: AGHT+IFCb+MHl0MQhRKzxygWqz3VVjUQdcWsU77GMMwKE8R/pZuFSemP7x5EUi32VDSDzgxdSAfG X-Received: by 2002:a0c:e0d2:0:b0:68f:2ac1:99fe with SMTP id x18-20020a0ce0d2000000b0068f2ac199femr3576510qvk.45.1708081621323; Fri, 16 Feb 2024 03:07:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081621; cv=none; d=google.com; s=arc-20160816; b=BdkfY3MmaQpzrtch3ecwiZy3BdBTy2SGWWlhnDDRfUpbSLkp8/RghGgcSrZ6uhGfJn j38WgNN0B4ysEfgiXZwYT/j7igeglwPpXl4LyLeMyTdI2+DBxG57ESAO1/p6Rk/WclD+ Ju/5ljZfxtwDTVd2sp0p0gUm6qZ2iu5sQ3yZO6UXIbu8C2P7NUPXdSIBB5q6kA4vhRk/ omDDxuy4c7Dr6TcOpkWgJMT/3xaPCHYBkIsjdFhQeKTLB3lHUlNA0rNrrLOgbr1jX5be D82LiPGaIoGt9yeOb3wA1NQWw3zoHN0lV7dPaypwJ4A1skwt89KZnXNtBknrCTg0t3th F5bQ== 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=SDE/2ozeILt8icMDCEMhs9DK4Gx3Yb4arama1t6dDAI=; fh=1CsvuuPs9UPSTZuV1m9yFwpqVLOER2vpzJGWrJFmFxE=; b=LDQ6ZcXwkn9QVfjqLKiqykno8FxEpBQo+z/k+z/LhxYkAjwvjucw9ytWfNWVCBgavB jumeUXBOGXJNMSjq+NqRFuV5dUlSojdj9oRyFWhEt4G0yKTfPud5sVkpnx+HLE/sjjUg ThAZRiLS+Zp/+vKHu9VPB7tkBYU9LxvCxncYHKPh04yv2CL64UENDH1kVz4Hwld9A8ut /fy6KTIGGQRADCAcKwHIJKR7VHW5Xr4SR9GQWloxPIon4uzNYRwRksFRswNecR9jp7bx aHeZ6bc/zDibGzEDDSItvL0ec+hbY+C0t47e7uHJ+DXXvHlUGZDSBjqKGl9C4mt3pwwD e3eA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zRnddEaP; 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 pn6-20020a056214130600b0068cb633507asi3532174qvb.575.2024.02.16.03.07.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:07: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=zRnddEaP; 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 1raw1P-0008Gz-Mb; Fri, 16 Feb 2024 06:04:47 -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 1raw1N-0008AD-GH for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:45 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw1L-00017G-Qq for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:45 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2d094bc2244so24396151fa.1 for ; Fri, 16 Feb 2024 03:04:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081481; x=1708686281; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SDE/2ozeILt8icMDCEMhs9DK4Gx3Yb4arama1t6dDAI=; b=zRnddEaPVtVB3ljS8L4qwXg3FSFcOSNQNEZmwKN+dQ3hu6DVbC5oYtHoQ7atunkP+F sCmlXBhPEQPVjb4C2C+w/cGV8tO1aABftXwSMnQM0F3h7ky9mts1rzkmT6yRkepX2G1B jmHzrYz1ZREiP+ondn179HOmhdU+5xcPoZmxEUopslBQLVF1fdwbBQCy5Udtl6vLkfZx v3KOZq+F2/sni8rmSkKlGtfhb+l0fVyH2CmFNWDbUR9hH7G78+GxDbIf6tyP1T2A13rA d6DfZ1J3Z6l+/hjzZ1YG77ymj5pdx2XEE1O8t20ph21h1/x/LcELMWx+lnnJ6HiV29bo qLZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081481; x=1708686281; 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=SDE/2ozeILt8icMDCEMhs9DK4Gx3Yb4arama1t6dDAI=; b=vVbn84gZ+ZiJ1CMVHKQKWnlZ9MdLrZHK4vqGg+nuo9hJ1T1PeQMxaB35M8QDajovd7 4RghIaTff6HMS2VGD4deqpcLtIdJpvUxVGRK7NwYX60aXZBPvt8pTCAw9lwVc1SLCtw/ kJNW2/FUKTRxhpQT0KH8hLdJeBsCCNvMMVRAqsfaR40CiOvFGbDLz4nTANbsXkmIzHB+ 8V2L9i3pLdUd3gdyvo2cSzeHRIyRxoww0ORcCJZldIG2cZSkmUGcPp8LyKA/DUTzfmtE 3Z3xL2Z6LJw2vbMoMN1f+uePnw1DU3xjC6BbNbkz+AanQoDkNDAfz8n5kTyA9YmzDghn eWrw== X-Gm-Message-State: AOJu0Yzmh4i490FQJp/R6D3XeHGDDUjHmUzizrd7wsogDiwVG52exuGZ qU1uLnVxtcEIf0Cxuujadl69tR45ki8cvDmQLZ7lfSpZjjztFY2Bwb+isN1MQUHdYz7mJMeigbt 2 X-Received: by 2002:a2e:8950:0:b0:2d1:26f0:8167 with SMTP id b16-20020a2e8950000000b002d126f08167mr3170282ljk.35.1708081481655; Fri, 16 Feb 2024 03:04:41 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id p18-20020a7bcc92000000b00411a0477755sm1963807wma.9.2024.02.16.03.04.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Herv?= =?utf-8?q?=C3=A9_Poussineau?= Subject: [PATCH 13/21] hw/pci-host/raven: Embedded OrIRQ in PRePPCIState Date: Fri, 16 Feb 2024 12:03:04 +0100 Message-ID: <20240216110313.17039-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Since we know the size of the OrIRQ object, we can initialize it directly in place with object_initialize_child(). Doing so we also set the QOM parent <-> child relationship. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/raven.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index c7a0a2878a..9e47caebc5 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -60,7 +60,7 @@ DECLARE_INSTANCE_CHECKER(PREPPCIState, RAVEN_PCI_HOST_BRIDGE, struct PRePPCIState { PCIHostState parent_obj; - OrIRQState *or_irq; + OrIRQState or_irq; qemu_irq pci_irqs[PCI_NUM_PINS]; PCIBus pci_bus; AddressSpace pci_io_as; @@ -249,14 +249,14 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp) } else { /* According to PReP specification section 6.1.6 "System Interrupt * Assignments", all PCI interrupts are routed via IRQ 15 */ - s->or_irq = OR_IRQ(object_new(TYPE_OR_IRQ)); - object_property_set_int(OBJECT(s->or_irq), "num-lines", PCI_NUM_PINS, + object_initialize_child(OBJECT(dev), "or-irq", &s->or_irq, TYPE_OR_IRQ); + object_property_set_int(OBJECT(&s->or_irq), "num-lines", PCI_NUM_PINS, &error_fatal); - qdev_realize(DEVICE(s->or_irq), NULL, &error_fatal); - sysbus_init_irq(dev, &s->or_irq->out_irq); + qdev_realize(DEVICE(&s->or_irq), NULL, &error_fatal); + sysbus_init_irq(dev, &s->or_irq.out_irq); for (i = 0; i < PCI_NUM_PINS; i++) { - s->pci_irqs[i] = qdev_get_gpio_in(DEVICE(s->or_irq), i); + s->pci_irqs[i] = qdev_get_gpio_in(DEVICE(&s->or_irq), i); } } From patchwork Fri Feb 16 11:03:05 2024 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: 773318 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287144wre; Fri, 16 Feb 2024 03:08:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUggkCqYv4MoP6kbb20F4kEyv+3HESrF8rt1k9lltz2espMz5C+uHU/KtT9VoEYhLtJW8lpoGPxYh5+RKvd0nTW X-Google-Smtp-Source: AGHT+IGnUexjBGLfESC8HCw3kb5kvxA2yaj6dfLAtTBIubPUyfZykH8m0DZ/5lJA/WW23prgd4FP X-Received: by 2002:a05:622a:207:b0:42c:68b4:1f9 with SMTP id b7-20020a05622a020700b0042c68b401f9mr5972996qtx.0.1708081703189; Fri, 16 Feb 2024 03:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081703; cv=none; d=google.com; s=arc-20160816; b=Vn2HQhNlY0xCQIX9PrQMgTicgQiE8sv01TrJGH9ZDIMCmJMevbMtU+EUA14WKVwsO0 jswtHIrrEtgevw6Yhf3qhzqpXxEuFLI2sLzVdNSnGZbuB7R6PjApzt3W49M0sZb0nrEn msgXEwt3wnw1y41nghueczCC3+W9mbbqCF0e3ubnwrZ7l52/vF4mJ2UXH4rOCAVr8grL cldlwCrs/Z+xjsZ6QLoMfg22AXmwTn5noE/ORkR8pVtOUYsuB8SUhgVZ1+9oACHsV16w u1QqBD/ir7p9aJws0mY7lhoDXQYTbstpi1hm33U/3u0OsZRWvRlR5q4WLnI43mTBMQde I+lg== 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=/zKKBP4rtXDo5bJMJS/mfNxVsCqCESb5cpbpX3cp4fo=; fh=1CsvuuPs9UPSTZuV1m9yFwpqVLOER2vpzJGWrJFmFxE=; b=q4sgzbZ1crLzQ2ythjeMx1g8g86GatQI7yhFPpQVg5zFrCW4UoQI06a6u/at4MvbpW Lzhc2+FABKrA4ptBT2VkqtEUT2OKEgpI1uJfrdRmtxDRvgGQ6To58FUAcG3hCNduDhYi AW7ANpMhVRacSgF0JrP5I2D5ArVSNN6ZbJpENklsCWHcfQLzqoKQx+Y9q85HplUkuTOl iZdiBuz33Vs5m7Q+sl8KjRkXW1gJiOj9wyECKD0MPU12tNNtf9GEl7rEqkG7hhAfN/FO GwwHmsP6/9bcCJ3wnq3g3oBXIHcRlq+7W+i39gUIMbx5AALfTpHerVW3UavYiMJc9SoW +C6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hgHoEzOT; 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 e14-20020ac845ce000000b0042c459cd209si3477476qto.600.2024.02.16.03.08.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:08:23 -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=hgHoEzOT; 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 1raw1X-0008WT-5h; Fri, 16 Feb 2024 06:04: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 1raw1U-0008L4-E4 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:52 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw1R-00018S-U9 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:04:51 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-41243d19ecaso3270935e9.3 for ; Fri, 16 Feb 2024 03:04:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081488; x=1708686288; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/zKKBP4rtXDo5bJMJS/mfNxVsCqCESb5cpbpX3cp4fo=; b=hgHoEzOTJE2GAUdiiRHOopema77vTDTSD4nbLnBygQ13j/5siddqlKYhgLWQMwuvpM HovwuaGJVjwV2RwJZebBlNkmH3ZIh2Yr3j/FPdNLpwePpUNcaxONY+ev1+puxcpta4ed zkXbvCaYzjoAzcsrFr6nfWNGihexkUPC5kRzLhWNY5HhegVUjHdLdKAMkKlWJX4vZlvs KtZwXjWB0Yck/8I50TABB2tH1t1maoOYUYZgDrkKA2jWXx+0/qDa9P91lqIdH656Q9CA wy7cTaLR1rXo2s9AuB43NiHqHuQ+FWQce4M1crAv/njIu/Rzv2KI/Vo8nZrZlU9XVzH4 HaSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081488; x=1708686288; 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=/zKKBP4rtXDo5bJMJS/mfNxVsCqCESb5cpbpX3cp4fo=; b=Hepvf3vzem+D1rCkBq51+gHDED1tgt4QYNebjbz92hrxubhEDfoL4kb/hoR+7TqycU NRINbGJ5iTSGjv9Tn8qcqhunRkSKGQhOdhlKcKyjRXMy2gZmVgxej5rjeWhvNydg+3WM kS/+fHO5UNkLknpsT7OC404YNc7oF3x0rRwuMkKY9rioLJkSIGkuAboLr8fbcul4e2AP MZ1hjml6uq9PsXeE39PN/xmMza+aMgZCrsaHWTkVUHA/49XRx/3G5CBeHN0v/zFkD8pK 6FzIFKDFLKAMgLNw36tzTBsP2N73xWAsPrzMHFrxJyzePYye/g7QdukXaJWX2B1ctp3v GFtQ== X-Gm-Message-State: AOJu0Ywpj9cuxTmi0T/HYAgaRM9m8GCOVantY246+L89pMP2d5307UYY NV/PzsEpWdjdi2BOhfCdV/k2nR1Q3Ho9ys7fMeyzC4nmD1fB/VJ0oZ5q/XrzgeMA8DT+SNaA/VT V X-Received: by 2002:a05:600c:6a07:b0:410:ed9f:7acb with SMTP id jj7-20020a05600c6a0700b00410ed9f7acbmr3427466wmb.40.1708081488237; Fri, 16 Feb 2024 03:04:48 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id z10-20020a1c4c0a000000b00410794ddfc6sm1951788wmf.35.2024.02.16.03.04.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Herv?= =?utf-8?q?=C3=A9_Poussineau?= Subject: [PATCH 14/21] hw/pci-host/raven: Prefer object_initialize_child over object_initialize Date: Fri, 16 Feb 2024 12:03:05 +0100 Message-ID: <20240216110313.17039-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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, T_SCC_BODY_TEXT_LINE=-0.01 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 When the QOM parent is available, prefer object_initialize_child() over object_initialize(), since it create the parent relationship. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/raven.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c index 9e47caebc5..5ef25edba6 100644 --- a/hw/pci-host/raven.c +++ b/hw/pci-host/raven.c @@ -290,7 +290,6 @@ static void raven_pcihost_initfn(Object *obj) PCIHostState *h = PCI_HOST_BRIDGE(obj); PREPPCIState *s = RAVEN_PCI_HOST_BRIDGE(obj); MemoryRegion *address_space_mem = get_system_memory(); - DeviceState *pci_dev; memory_region_init(&s->pci_io, obj, "pci-io", 0x3f800000); memory_region_init_io(&s->pci_io_non_contiguous, obj, &raven_io_ops, s, @@ -328,11 +327,10 @@ static void raven_pcihost_initfn(Object *obj) h->bus = &s->pci_bus; - object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_RAVEN_PCI_DEVICE); - pci_dev = DEVICE(&s->pci_dev); + object_initialize_child(obj, "bridge", &s->pci_dev, TYPE_RAVEN_PCI_DEVICE); object_property_set_int(OBJECT(&s->pci_dev), "addr", PCI_DEVFN(0, 0), NULL); - qdev_prop_set_bit(pci_dev, "multifunction", false); + qdev_prop_set_bit(DEVICE(&s->pci_dev), "multifunction", false); } static void raven_realize(PCIDevice *d, Error **errp) From patchwork Fri Feb 16 11:03:06 2024 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: 773315 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1286299wre; Fri, 16 Feb 2024 03:06:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUHmIj64hVCPAoLBX/2rBEILiedrfEx8zQEBOTO2jkdoGrXu7v0E91w4e3AVh0oRnPvFqiYETyUD09Yi4rw8pWE X-Google-Smtp-Source: AGHT+IHza/pIpNv2rDjiV6UdhieXQCFwCO9xGoqI8NhgJgvVJiedSlIa/whOoPHDebTb916mqzjI X-Received: by 2002:ac8:5d0f:0:b0:42c:8b9a:e252 with SMTP id f15-20020ac85d0f000000b0042c8b9ae252mr14705239qtx.16.1708081590327; Fri, 16 Feb 2024 03:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081590; cv=none; d=google.com; s=arc-20160816; b=aCSlHse7IlmpApVp8dDBYCQ2Ur/wmv67MiPFcs1fXSgxuXhz8nuLCr0cArlrPWPrY0 ie6Gn7ttrc5pn2Y8/sQJldHSnrEEvtPUHu5ncvbP3f85c89vwSz0Ffq3cg/MSJ1zCUcC XAACYoRW4muXj0JGxMpzw7rD6dTtvDXkv6BO5bicxDJG1betY0Tzc1EbvcpBpZtS3cT1 ON6lvt02TFV87k9sYwq+9z7Nhp3x/+TYOK8QRGjyvoHXH40laA6r5EBzNZDGFmc9d0O3 O+liK9kjYhfCr41UGUuaxkyJ/EUsZxZ/o9j1eyk/z0c+Fg/Pd3/ELx3Rh506d5rC7qf3 7ndQ== 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=XbRM+bkgLot/ksoxAWBDVY0FT1QlycUiAAgPHWKXiwg=; fh=CePwNcoO0Eku3Y0aMSfSoo1GRtlhMMRO0gXZuLdgoQc=; b=osEcYdLXIe+YpPGqk9A2x/a790hCSmZg+hJZFOIEhxqAeVq40Yh7Ff1C/yhi0fPLx3 1edqSE+txz4NlaKqm/+x+yOwrQ/LYbIqKfO3VTIJjHrhn+ORuzci8QQ/H/Wfksr3e8qL qIRYyHuTEP40QnQzM1Bgh/QHMD6l+L7yPdkDbzRdQU+kY5mRntx04V2IkzF/UXvz2aKx 0NRte8vhryq67EBSwlyL76ejuvosa/GBJSvxq3DCnHihBvN5WN5cwARF3lL/DzKrXuD5 l0RQQXhCDBfb96RnzxgagH6775OBBqWhiYhSygW2abTwYujC3y+/xdSdL09VXhbdOh/F ypJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pKr1CCvU; 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 j4-20020a05620a000400b00785d8a1cce3si3754799qki.295.2024.02.16.03.06.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:06: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=pKr1CCvU; 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 1raw1s-0000hj-60; Fri, 16 Feb 2024 06:05: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 1raw1o-0000QL-M1 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:14 -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 1raw1Y-00019r-G0 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:10 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-337cc8e72f5so464925f8f.1 for ; Fri, 16 Feb 2024 03:04:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081494; x=1708686294; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XbRM+bkgLot/ksoxAWBDVY0FT1QlycUiAAgPHWKXiwg=; b=pKr1CCvUMUAtvcb60s5t/Y69MiuQng7NHnHq2uMqrdOxyXrhYMTtCDTLtbYxHoHtt6 S4j9dh9YbpdH9TZf9HAJkBsHZou/wRpyFZJ2q98SZLEhx0lU3woUL/2xcvkXTIpAMHxW WTJprwEvTEgFOl5lcQ97UtRmg6uV9tDb0FYwOtvYyfIooxkJRbnKu8B8yqIC6qFZy2t5 txjIBtC6+4nT3ZeYKnGG4lxQHUhqQuQ5RWI3NBAnfKSRpqrVBZddxJCbRwhr+AtqQnRP SGMQGIc2GFqCyQRpiWCrWkYJEZRyj1Jp4IIcZx/a04F/+09JqAoA5I0ieiLVKl6bTjtN Cecw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081494; x=1708686294; 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=XbRM+bkgLot/ksoxAWBDVY0FT1QlycUiAAgPHWKXiwg=; b=ixoHxUq2qIeuMqcMAn2A69/r4VFdBPGElgwlj4+TbFdfewmkdYn/VL2HavEe2v7Tqk VjBfqruPCM6AkH6kxzXrOCqatj7Kxd9Kf2dpwDM2IfnaLdAdnCxcGMb/t73rZSCl3rPW jsWIDAOJ/gAhJQCfb6aEfQSeI8WCByL7WNM3z6Zzni0qMjIZwHS7eIOKkzhF/6KpKVGL rAZZ3a/XTmgm6RUkDMjUQBRuDKVEvlWpRHLn2y6yIA+DZkkvT+R2GLboaN1LIzj5xBrs YQ3YAdEA7WLtjL9PUJWlgwpFvgcOJIcvnnD7uCgOACuEcj6IuAjqbgT7DHZW3qVU025A MlyA== X-Gm-Message-State: AOJu0YxusjZ/MI1Y3ML+vczyCW1ZsfHjzhtwM6bUf6VQIjJW5CtVTLNM U1UyTDrK0rk+xiFfnTUY0hEBjKROoeGI2wyhHH0DkDDo2rUDjmRwyhs3hapPYU87ZhTiMx++LPt q X-Received: by 2002:a5d:4fc1:0:b0:33b:5563:3502 with SMTP id h1-20020a5d4fc1000000b0033b55633502mr3177267wrw.17.1708081494488; Fri, 16 Feb 2024 03:04:54 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id bp4-20020a5d5a84000000b0033d1739aedbsm1908351wrb.95.2024.02.16.03.04.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:04:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Alistair Francis Subject: [PATCH 15/21] hw/core/register: Prefer object_initialize_child over object_initialize Date: Fri, 16 Feb 2024 12:03:06 +0100 Message-ID: <20240216110313.17039-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 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 When the QOM parent is available, prefer object_initialize_child() over object_initialize(), since it create the parent relationship. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/register.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/register.c b/hw/core/register.c index 95b0150c0a..b6beca0e02 100644 --- a/hw/core/register.c +++ b/hw/core/register.c @@ -259,7 +259,7 @@ static RegisterInfoArray *register_init_block(DeviceState *owner, RegisterInfo *r = &ri[index]; /* Init the register, this will zero it. */ - object_initialize((void *)r, sizeof(*r), TYPE_REGISTER); + object_initialize_child(OBJECT(owner), "reg[*]", r, TYPE_REGISTER); /* Set the properties of the register */ r->data = data + data_size * index; From patchwork Fri Feb 16 11:03:07 2024 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: 773320 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287348wre; Fri, 16 Feb 2024 03:08:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVKlDGRDTRNeshm7SG2iXXwPfzInIKlqkSct3+eqzu/eXBvW/AcrQXXrQwc5H2YqzjYQ4lDBiB4ooNlJgpwCvqY X-Google-Smtp-Source: AGHT+IGCP5iw9MGOiptP5Astfq2EKn8mrMOZEiiTWnq55jOVilKeQ+4j7dNJEzzlpyp70aOSnp2u X-Received: by 2002:a05:620a:956:b0:785:63c0:c56 with SMTP id w22-20020a05620a095600b0078563c00c56mr4478043qkw.12.1708081736200; Fri, 16 Feb 2024 03:08:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081736; cv=none; d=google.com; s=arc-20160816; b=lD6rzeR1pXxoKZ7YuW3t/JBtoXqEdsBfaf5yIKerCl0GrlzzhWuQtk7Ltpm19iNmSm KQgBLuotzNdnrn1aIhHjF0KMGb/v3aehXzQ73WCRW9JlYMZt/2IXJnK2X+s2AMUM89yz v44IACl+MgG6REiHL1O7Ni8hLpkbPK+ZfZrI4gwhZkirKfDgWV+9KhRVMieU6c90LyP2 jkTLCbXCrl5/Rl9qiU9GfBLg/T6wDHlgLw5BEUeQsJ8itZFl87OTqGNOH3LfrVrUIABf uiCe4ZOIjXQ8jrmbbTPWpi2x+jy6JW8v2YpusBIcGEnUz88kwHywgWKAO/xJrw1NHI4U 1Kng== 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=48d0wm1jd8E2EcPt+QBeCr00l3Febl6qelXBQC6Tkz0=; fh=RuZcrAlzwN5RJ2iLXMhHhFkm+3yNgenuDEXMjnG1cFs=; b=xIuvZyuTuUELgj9kzx02FzRYpHuC/ECAvhJkINECsWD4vTSlSkUXoKPRYidcOW/aMt 17WSmD//1hKBtJhO3OiZE8yUZTPxk71kT26n1PA2RT7sgjjOtUZNtTpAV5fHksdBycyp B2X61oLxGj1HciXvTtLVIEca9+lEa+A+ROJn+Wi9oF9jYMP1dSD2pOQMuHUqjGcFY8Y+ e6nVwOTgsfaPHC1d5GSjsgbUbDxuS4PzDZPViIR6SaCdJM0FKbq3qmoej7rdXt2pI32Y K2zwHYyVMvhQa3P4R5g7FvyMYjiWmxtEcEGyDu94DnDxd02GOE3GvPObl43ajs16RVJL oioA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p8uKsUMA; 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 h3-20020a37c443000000b00787359896d0si3541407qkm.378.2024.02.16.03.08.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:08:56 -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=p8uKsUMA; 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 1raw1w-0000yl-1b; Fri, 16 Feb 2024 06:05: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 1raw1s-0000jp-H9 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:16 -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 1raw1f-0001C1-QQ for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:16 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-33b28aadb28so1011208f8f.3 for ; Fri, 16 Feb 2024 03:05:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081501; x=1708686301; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=48d0wm1jd8E2EcPt+QBeCr00l3Febl6qelXBQC6Tkz0=; b=p8uKsUMA3UkpnF4XwBkE7tJapWa2ePRHGARhy3jA+bfHqxZKHz1pVa0Ow8w7HmwY6J tYZdkmvmTDJiP+kh/bUai9Sfht2Og6D9ZM7WAPhebwQAzVu+u5qOIHi6bLtwvnotnLys IoxPJHNHwfLiir4Ye4QjE0e7McEAzNZFPFR/WTlaAbH3NXIVQBGvQpH/DoqOzimKt/YY 3aF+/S8Jg8d+SDfFWiN4UGw7jcb1Kq33HgOXuJsSEf8AY0Y8xz27qyhUMtScmlE8AzcI vzWj37XV2C95kIkgcF0uWA/hQyr5C47IxL2uev2a8rEuGEPVvDA/qCp3CCQzXNvsnOc0 BRCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081501; x=1708686301; 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=48d0wm1jd8E2EcPt+QBeCr00l3Febl6qelXBQC6Tkz0=; b=uOjww+USZdVlx8lzxN5t9/Yh5t0ezjfGYFPbD0vkzB7GfmbdKo6TOEv6I0nuffQx7a GBMf4WwszUQd0t2I2sbE89YIC5yVWC6qvcjCpeTwLdr9O9eAkoTf2LPK6l5ncb2Dr+AK OMMAzGhZBiwSfQeeoGKi2l0qn0t6sLjZFPjDUg/7ny6O+T8Usm3cKIQTvqAkPEj+2PPG n+1zmdx1Jx9SYJFT+UAF5GcS6Kwz7zi+G2DMyypwJf2flJw4SM+SKBFcRs8y7CaGS/fP Sc7wHKKlmb9aAWPsNPLqH1gJjTAOyGjqXYSYZzhzQRCXulsxbyYlJvbXyO292iP6gWxU ueMQ== X-Gm-Message-State: AOJu0YyApFpcdbtNnjpCW3w9kKPOo42vMxjOt9nt1KLgzBVAaGdL8WUQ nQBylshABqYKooWH32XFD9pR8IkMYG++ps3l4q5lM1qdYQQ/Y7iHGzRjhEHo7M0298b26LWKr8d + X-Received: by 2002:a5d:6a8b:0:b0:33a:e9dd:5b6b with SMTP id s11-20020a5d6a8b000000b0033ae9dd5b6bmr3133003wru.9.1708081501246; Fri, 16 Feb 2024 03:05:01 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id i5-20020a05600011c500b0033cf095b9a2sm1872339wrx.78.2024.02.16.03.04.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pavel Pisa , Vikram Garhwal , Francisco Iglesias , Jason Wang Subject: [PATCH 16/21] hw/net/can/versal: Prefer object_initialize_child over object_initialize Date: Fri, 16 Feb 2024 12:03:07 +0100 Message-ID: <20240216110313.17039-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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, T_SCC_BODY_TEXT_LINE=-0.01 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 When the QOM parent is available, prefer object_initialize_child() over object_initialize(), since it create the parent relationship. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Francisco Iglesias Reviewed-by: Pavel Pisa --- hw/net/can/xlnx-versal-canfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/can/xlnx-versal-canfd.c b/hw/net/can/xlnx-versal-canfd.c index 47a14cfe63..f8e4bd75e4 100644 --- a/hw/net/can/xlnx-versal-canfd.c +++ b/hw/net/can/xlnx-versal-canfd.c @@ -1900,7 +1900,7 @@ static int canfd_populate_regarray(XlnxVersalCANFDState *s, int index = rae[i].addr / 4; RegisterInfo *r = &s->reg_info[index]; - object_initialize(r, sizeof(*r), TYPE_REGISTER); + object_initialize_child(OBJECT(s), "reg[*]", r, TYPE_REGISTER); *r = (RegisterInfo) { .data = &s->regs[index], From patchwork Fri Feb 16 11:03:08 2024 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: 773319 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287147wre; Fri, 16 Feb 2024 03:08:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXpH/w4g9XoULJxmxshmI2Lyx805fw8qwJPJJzSnJVFC+2jQaYSRnGtiwN2mnAsrCZD84wQ9VhaMSX5QE5wpl9K X-Google-Smtp-Source: AGHT+IGrJexEtWcNaqx5SEixF0NJYx9pAgUh+ZJI+kHGR9N5kSz1LhDtGxhbx5ZDtrqVtk1Ed9AN X-Received: by 2002:a05:6808:1524:b0:3c1:4179:32e0 with SMTP id u36-20020a056808152400b003c1417932e0mr896503oiw.7.1708081703677; Fri, 16 Feb 2024 03:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081703; cv=none; d=google.com; s=arc-20160816; b=WXkZeLkX35d35gLr5A6ndM2WC3T6iXQgcD0IilZpOqnW22SFPJUQFK8A0rZmPzohp4 3TgvQyEj8988v1RY3BBvTgtz+mCwXgA7S6Qv23Dj3CPQi7TL+cw2VhiEFFJKpHCISCkC oZbW+eyUi8vtgwStyX3zHmygiIZmrv7T22LAZxrjdldUjRhSZHnX77DdRuqbgmTlvbUe VDybuAfoaaDhn4XK/lYFKylbObXpGhlZh3aL8BErm92DzY4AL+VbPSN2KSoGJO0drjL0 glvVZhDi279dUMeSMLgqHccFP+L2KTtzKuMbAUXWYXV30IlO1k1DOBhL+kHquTIviZHE +NtQ== 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=wIiFm5Lc76s4egbopN+QwAc3v81IfNt4gHe1mB8rI9U=; fh=lo699SrpvFYJnxFLZ6omanT1M6xx54FOFadsij93CRk=; b=GiH/lH0kUJAH4+cUo6J/MGBbLRoHrTBOy9CGzsum4w+aKRC2284rvgSuixm+wLf2uE 7udTi9J/uZE85ktRoKxfdMy4PwuYBv89N7cE2yUKtYPDIQNsDmtGgZL66j9xCRljkJm1 Rn0rgiCw/NsMlGjn3umiZgwqcJwVX1RlU3nsBB4W1wD4xG4ybgIW4abF3eWFtXDW5gw6 dT4PPdh85qnRFL9DT8huS6hHULM/ZqBvuxM6llW/TjZsRPqPv2dtAEzB+opWXUiHflcb lPskboKB+7K7/iNIa/BxMpn47OdG1Mugj1xkFBQq6kcPGrYCMHXRo7plzV18AEHCHdZH 82dA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JKl4ls6s; 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 f6-20020ac85d06000000b0042dc7351039si4341662qtx.209.2024.02.16.03.08.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:08:23 -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=JKl4ls6s; 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 1raw20-0001Cx-QJ; Fri, 16 Feb 2024 06:05: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 1raw1x-00013D-CC for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:21 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw1m-0001DP-OA for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:20 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-33b4e6972f6so912362f8f.2 for ; Fri, 16 Feb 2024 03:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081508; x=1708686308; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wIiFm5Lc76s4egbopN+QwAc3v81IfNt4gHe1mB8rI9U=; b=JKl4ls6s30yDphvgFJqbet/DnKLO6hOugNHjlqBQM4MmoyrzpXxtYqCz9RU9iLq0Bb wxxWr8TuJ1s8kz+aRFHPxFmQZxg0Ewv7/J62aaaKGksrO7Bw9nUxL4N/1Yr/UVXRI3QP x7ksVuHBMJ0mmXYDvgx8bvDKgmNuCV5Bwk/ZM6bUpVcOIBKW4LFvKa7sDsdwraNHeELm 6vQysFkGoTrl+vurBUP5AA/THKiAx5FV8H5+qXIjp67ku1fqcXuuAOqwSbIbaNqR0BKO gnfb+qp45ne7y6GJLh6sOVYD1u37dTiEK/KJinW9BO3E7eVT+wN/AQG1LgJlET73ckth SPZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081508; x=1708686308; 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=wIiFm5Lc76s4egbopN+QwAc3v81IfNt4gHe1mB8rI9U=; b=mpFVVbJ5OpWlHQCTGbaDRg/jiqYARxSTGKzLefcTLs0h/+e2CXEmV5Sj75oKVfwriF feajiZQYa9Uju8ZdgG7ez8BTEiASt7WsvyVlFb1F6u/Xe2iT+FgVZRAt0I0uE9BLlpA1 Nw1OieR6ApcM+fimhW7UCxZhKC7X+Qn7+tWfMWLdRZrKtaJV8qfOdO4Nn39JbQ2IDszQ 1A1b+ueAjMShlVw//Vbt/lvMvEgdVwPNmna+qud7/uaSNwn8AHmLiawCxn0jO60FvmUo bnl1n2MwX9YCeUWULZx9HDL/7qtkqtXNoj73KqeYUvibaIRlt8ZauApi+XIqWP+YJDWO 5e0w== X-Gm-Message-State: AOJu0YxE31UApwz0VXytNQvtnedpAy+rUddYU92U4tnDwaXDEfiY5Iox eT8GFhCP1EKRCdC6Ym3sPu7TVTiZxD7zSe2upzh+6adIheDzCiyuz6/LUecV+TEg7WRF3Ubpb30 r X-Received: by 2002:a5d:664d:0:b0:33d:157d:a7ad with SMTP id f13-20020a5d664d000000b0033d157da7admr1642262wrw.40.1708081507912; Fri, 16 Feb 2024 03:05:07 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id b10-20020a5d40ca000000b0033ceca3a3dbsm1898621wrq.2.2024.02.16.03.05.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_initialize Date: Fri, 16 Feb 2024 12:03:08 +0100 Message-ID: <20240216110313.17039-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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, T_SCC_BODY_TEXT_LINE=-0.01 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 When the QOM parent is available, prefer object_initialize_child() over object_initialize(), since it create the parent relationship. Rename the 'klass' variable as 'obj' since the argument holds a reference to an instance object and not a class one. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/amd_iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 7329553ad3..c3afbc4130 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1616,11 +1616,11 @@ static const VMStateDescription vmstate_amdvi_sysbus = { .unmigratable = 1 }; -static void amdvi_sysbus_instance_init(Object *klass) +static void amdvi_sysbus_instance_init(Object *obj) { - AMDVIState *s = AMD_IOMMU_DEVICE(klass); + AMDVIState *s = AMD_IOMMU_DEVICE(obj); - object_initialize(&s->pci, sizeof(s->pci), TYPE_AMD_IOMMU_PCI); + object_initialize_child(obj, "iommu", &s->pci, TYPE_AMD_IOMMU_PCI); } static void amdvi_sysbus_class_init(ObjectClass *klass, void *data) From patchwork Fri Feb 16 11:03:09 2024 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: 773329 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1288418wre; Fri, 16 Feb 2024 03:11:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV5dHUGUrATk2drv68vz2jiPoE39uupyXs+I8BYMGAlrfo4WN5Q2ucIK3WMBAKGey6S47HAkjI05LnquYI21n4n X-Google-Smtp-Source: AGHT+IHedxQGaM267dpClcK0pDgbO0Aqi8W+u1p0os9/r0HDKWbIyQSx5shXUWVEqxL2DlH0DaTV X-Received: by 2002:ac8:5a55:0:b0:42c:43d6:c69e with SMTP id o21-20020ac85a55000000b0042c43d6c69emr13359467qta.1.1708081871381; Fri, 16 Feb 2024 03:11:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081871; cv=none; d=google.com; s=arc-20160816; b=i7Ttvkn6xj0TPNPxI88an3sp3K2eswprwcnLczrN8fzF7YzDbonktmXYl6H0ZXfbXr rIrmraJWlG0Xr8tf5ce4Y3dEuljoSHV1j5kJupkpRy2oU+dRRt9pCtp7QUbPtaOEKghA aO6sNtt99fVKHiinp6JPdJEUBCOnALmasRlk5xR/HoARlyyZgs9R+sxHEhx/cL23GM00 NpPnKCjkFMfe/AsckR6GqNX9XT9jNSX/RWNuE65tbejs6AoeUNnv2DWZFN1giXiwq2H2 yCYJJkC2VL009fNGeWomssVABwRkONXnPleIMHs7Vip5i+uCI99EPgl07r9B/0hPhp30 Uy6w== 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=ELKUbUBr744bWbi9HHUFUd98mluSMaEj1sworCQzpug=; fh=VbPIqyFuCYL65k0FKNVmSVSYwnadnuqExi5+vdUGOTw=; b=H78e6tB5dYgnOhLiv9B53cWfLLsXe2qzG7GvQ5NFdpuOgvILaGt9FWmJK7otizHPI3 A97PbB/VHrsdGf75r+jXtbhcmn/SafzOXxDEZe2RQpQ+JIOYeG+LRFo52R94vtrUYXTg z1GV6pYeCZxhhCNhAFtfsI/2saVpbANMZ79MFtgAuus9UfNgYCDAhNf5+AbWyFZ0A9uT Pe/ydLlZxBkdN+xu77Gf/BVAmXPcYjzSot6zrEL+jBuFc+UoRNXrBgN3SXgpDRNBBBTP uWPf5lm2SSAkEiJe0olELTFH2TtpY0ph0lTNQuwRTKo3tkjI9Wyizt2GDUjrD8rnLhgQ JYeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Hx/8fgPX"; 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 g4-20020ac87d04000000b0042c592b68ddsi3883451qtb.314.2024.02.16.03.11.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:11:11 -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="Hx/8fgPX"; 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 1raw2A-00023L-3p; Fri, 16 Feb 2024 06:05:35 -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 1raw23-0001ZY-VR for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:28 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw1s-0001FM-Hx for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:27 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33934567777so1057476f8f.1 for ; Fri, 16 Feb 2024 03:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081514; x=1708686314; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ELKUbUBr744bWbi9HHUFUd98mluSMaEj1sworCQzpug=; b=Hx/8fgPXQq5hg4OPgOcSzsfgVa+ySPBuLbXb6XoE6MpS5Qt3zWfpoMP4G9rBhVzLf3 holnO1KCNPid2zQheWFV+d3TSmLDlTkdoeX6tNHhk8LfMWXfNC2pmLOhKoxiSefimFcE DOXXH9E1XEz638rO60CAgUaIafpoVcPMWF697jVf7wRXNvjGteM8ouE1RYJChM0ibVy3 5waXu1msyJM4lwfvnAgMrtVWtwFv9oAFqWfq1JRPreIGSRklGvw664q5HRLogkYebKIW /v+VcW695zUrGewdh9BAtwEFFizcD86om7VEfTNNxwxEivGpBgTGwfqFa+UytEQ0c+hL ZRDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081514; x=1708686314; 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=ELKUbUBr744bWbi9HHUFUd98mluSMaEj1sworCQzpug=; b=EZOKFfryG9YKIZFW0pu1Y+F5jJ6Q0h25MI29GOUBs0pQp2eQqDx3EE4/2jdo3NKJMM WXiwBdW0FQ5VjQ6hBN8PylXZ1Y4aWIquA8jwzcyf74i+CqERqe4qhLX7xygMx5RXIEif OamxmroLsy8TpvaiYGXjVRL2fm4KDPOQ2QqMr4EXcyc4/H5oNFxjDIFnPK2wzRKca9Ii TDS02b1O0xoajW5ch5Uz3E/LIMnaiXJCZYJEqbNk5S/mJX0dGKarIGVSpMIiQCjHA9Lp niBHNhzLurVgJDo1TLPXI7KWU27vnGjCFO8f7JLMKQXOA/Gz2fUZRqgYEWjPXrBBu7VG R/Yg== X-Gm-Message-State: AOJu0Yw4/kwi0akbgR1mUtLQBMKl3IXV1qiQqoedQYRWFynnsqyED0vl B0yYPTRzHH6i8TWrBsB8rem0Xubcz62otwD2+Jy0Y0YiCIYXcSiLCFpQUscxJdrFdPRgZHT1NSn S X-Received: by 2002:a5d:4a4f:0:b0:33b:5087:c913 with SMTP id v15-20020a5d4a4f000000b0033b5087c913mr3438284wrs.54.1708081514666; Fri, 16 Feb 2024 03:05:14 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id x6-20020adff0c6000000b0033cfc035940sm1889460wro.34.2024.02.16.03.05.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:13 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH 18/21] hw/pci-host/versatile: Replace object_initialize() -> _child() Date: Fri, 16 Feb 2024 12:03:09 +0100 Message-ID: <20240216110313.17039-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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, T_SCC_BODY_TEXT_LINE=-0.01 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 When the QOM parent is available, prefer object_initialize_child() over object_initialize(), since it create the parent relationship. Signed-off-by: Philippe Mathieu-Daudé --- hw/pci-host/versatile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/pci-host/versatile.c b/hw/pci-host/versatile.c index 0e65deb3f9..5d1f9cc96d 100644 --- a/hw/pci-host/versatile.c +++ b/hw/pci-host/versatile.c @@ -410,7 +410,8 @@ static void pci_vpb_realize(DeviceState *dev, Error **errp) PCI_DEVFN(11, 0), TYPE_PCI_BUS); h->bus = &s->pci_bus; - object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_VERSATILE_PCI_HOST); + object_initialize_child(OBJECT(dev), "pci-func0", + &s->pci_dev, TYPE_VERSATILE_PCI_HOST); for (i = 0; i < 4; i++) { sysbus_init_irq(sbd, &s->irq[i]); From patchwork Fri Feb 16 11:03:10 2024 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: 773327 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1288275wre; Fri, 16 Feb 2024 03:11:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWW46aW+WSNGf6Nn5kwTvI8Yryn6GaOCQd2lmeTVH8lsGW2/vtHKFrxUhTCTkyP7l7X2GzAjakpRXiIq+lg6wZA X-Google-Smtp-Source: AGHT+IFw3WPyo/3e8wvwmn6d8f/pr7yicdqXuTZXVVx2IkJW7gUIRXcbtMEMNjiR8MIEfSczhEbc X-Received: by 2002:a67:e8c5:0:b0:46e:d0cd:428d with SMTP id y5-20020a67e8c5000000b0046ed0cd428dmr4809933vsn.33.1708081872346; Fri, 16 Feb 2024 03:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081872; cv=none; d=google.com; s=arc-20160816; b=bvq+dA6UbwJYFQobn1iNq1sXyQG6lJ9nAFOtEWdm/ZS9VD0RCPD3BDKPxVTNjlvAwz o2U3jzxppkl/BMkb0cccOsaplJicFH059dWk/KCGBorsEWXQtSYVtOIgntBLApL04oR4 iFWoG4TBLS5mXW+lonCwsOLmaXXpUUpjMlqYIE/A7BF0UQXh/u65ZF+4mKbpyXCkq/sT Gd9468er8Aloo/A7zPLy9bNPXBOJfiFHtjqsti7VOJeqdDykMpHv9Iu/SnxF2PUf17af EQnprqKRDgKmqOBtxJ8MtZNw258sn3dhojbvijObDTfEXR7rbilR2mNY/6oVf6csCxm2 FGoA== 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=EY92sY1OM6q6PT81SQkKCMEQr7lGvoIEo8ukB7aXD50=; fh=UiWC6Roja1ztrrNqpKE/JeGIlT1eDwlyHqBVsZEo61g=; b=wGiORDrr0UMrT/eD/XNJ8vfciEBzIdn6i2cqRYu4O68LdasKYq+JgFiLrpNm5Unkh/ YLhp6xNUyO8LE55817OpFCsrCFZKTI77NV/XlftH5B1RlhHPg0FUcsxFWvOMm5dkKNUa zm2R6TPgsNvWE3TfUj5ZxS5+nROyVOclPwwf5PdhtzTeMS3pHVajfNjqAtSZQucNBEav Ybo2KwEY8KTt0hgtCE8DTnxOIgESlPpqvmNzQJzpYe0e+NR7DZ8M5wIQ1OTgWSaKtGK8 Kh4FOxtxyQwzyj4UEiM1uGHWJ3HTyWPjqQOxUfczv/4BEFA4IqCa6pO6G13cX1XX2R4k ihvA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Y/ZcLL72"; 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 j21-20020ac85c55000000b0042c24902693si3806833qtj.741.2024.02.16.03.11.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:11:12 -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="Y/ZcLL72"; 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 1raw2E-0002Oy-MB; Fri, 16 Feb 2024 06:05: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 1raw25-0001fp-8B for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:29 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw1z-0001Hl-Ng for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:28 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3394bec856fso1782605f8f.0 for ; Fri, 16 Feb 2024 03:05:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081522; x=1708686322; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EY92sY1OM6q6PT81SQkKCMEQr7lGvoIEo8ukB7aXD50=; b=Y/ZcLL72CDJKL+5r2dO8P+wIpI7/77R3I3pQmRUqOH21HAHQjN59/1XuC0YIykgVv3 GZ8nNUws9Sqe5zvOMTgdzr9YcCXxHLHdk4CQhx1guMtQ0SPnUHHJ7mgKPRT8Kbz0av99 E6jGgkK2IW1uxLkQgGbyHB8C7KbTFQ0GZWtYHdGf7v2IPcX/mvWQR+ffdGteo2kk9RUz frb/Up2+gAy+Xf6vRXBTnr4BN6cO30tCboc4r/n4uPDSBp/7ydUDiGA7EKI2fDpQXFDE 6CDlpj3c+B679wRIOLafXInl+Q4EgGxcpdgCq7fe/n2z7mb6Hc+OuVFk8cXLMREWRNFM NdYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081522; x=1708686322; 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=EY92sY1OM6q6PT81SQkKCMEQr7lGvoIEo8ukB7aXD50=; b=Rm0ix+0ZR2cjxdCXe85v0ForcIn/nTAHZwzJR41mzpes3Qs24nHwkYCpofXPQOUUu3 YIF5LDdqzDB/OMkXH2O8qQyjKes4I+yAFV6F5p21kpDqY33EyeQ3o4jDgVHud8CHPQuq oj+DIgy8agRU0isFDOOEQc4vPKAg4dgd/WB+xjRaBZ2GOt6r/JyFg6ys914KCcgXeQeq djoIFfjeGANgxi16qBqqmNCW5ZLf6FlAYtI7h/Qrr7ltAtfGmyd4DzewpAou5f6QKzJR FqrY2sMeQPYqaD88jbDuGQN9y1xXQR1493Gu+LGR5BSGkgmBbo8U9WQfUsX1uPYW8yhQ p3fQ== X-Gm-Message-State: AOJu0YyUTV7pIuqMLNWTygWR5V4UKG499dB429zX4Rgvy6cORdJT8aWr InBD0hk4DJ8D4svyxm4gGx259ciRaDeNoujeKXGnzVUzaK9OIPGwU1zPj7uIikVHIvUzH7H+Bq+ c X-Received: by 2002:adf:efd2:0:b0:33d:201f:ea9d with SMTP id i18-20020adfefd2000000b0033d201fea9dmr875165wrp.2.1708081521846; Fri, 16 Feb 2024 03:05:21 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id i5-20020a05600011c500b0033cf095b9a2sm1873207wrx.78.2024.02.16.03.05.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Matthew Rosato , Eric Farman , Richard Henderson , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Halil Pasic , Christian Borntraeger Subject: [PATCH 19/21] hw/s390x/zpci-bus: Add QOM parentship relation with zPCI devices Date: Fri, 16 Feb 2024 12:03:10 +0100 Message-ID: <20240216110313.17039-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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, T_SCC_BODY_TEXT_LINE=-0.01 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 QDev objects created with qdev_*new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé --- hw/s390x/s390-pci-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 3e57d5faca..6d07a7b530 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -934,6 +934,7 @@ static S390PCIBusDevice *s390_pci_device_new(S390pciState *s, "zPCI device could not be created: "); return NULL; } + object_property_add_child(OBJECT(s), "zpci[*]", OBJECT(dev)); if (!qdev_realize_and_unref(dev, BUS(s->bus), &local_err)) { object_unparent(OBJECT(dev)); error_propagate_prepend(errp, local_err, From patchwork Fri Feb 16 11:03:11 2024 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: 773322 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287517wre; Fri, 16 Feb 2024 03:09:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU4GvezicM+O+JNdI2TQHWZ2l6w843fLPRF3Hm9jxRdR8xrmR0jtza2OzSzSb5V62e/BCahiKOmgonGbwtYjql7 X-Google-Smtp-Source: AGHT+IGxqvJFWqhWqTJZLdxcFpribDuuPF8L8G+Txxd1PNVZ5b8pqTYrHjc6rHmVY3JCAv/QPcjN X-Received: by 2002:a0c:f052:0:b0:68c:c837:fbac with SMTP id b18-20020a0cf052000000b0068cc837fbacmr4678870qvl.49.1708081763632; Fri, 16 Feb 2024 03:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081763; cv=none; d=google.com; s=arc-20160816; b=Y+bxGErVuVK6aa/ZT2iG5z0r/G6xKV/9+KHhJPeYbbYn2KdLnvRAFENd+Assy8vxTg IZMozCLY2aZGzUQ8egq6WAgFfdICHvbTNoYs6A5f/euXRQNgjINmDPHAi4ZfOtydHxMU MATYbETNL3flm7c3SyvBklp7+/T2WAYGF/NT28Oz0SyAirFqCRg2DOn340Cnnr67DUWP D3OL9a7ICviXM+VUzT9zZs7MFo/6M0z3LKyujfE7NrgkUQ1IJtIk+up5BHYO4sBZO5eM HBNtDcxiQ2Er8FNh8+5FFXtaDdcX9kLqoARrj8GW+kbnWkx/KwAAW+h7HDEoxFhoDNhb BYPw== 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=+TP1TJioczzc39Hx3iqthMm6LDPQbvhwTOiEAkO1gUM=; fh=VbPIqyFuCYL65k0FKNVmSVSYwnadnuqExi5+vdUGOTw=; b=PmvZUhQxKo6S/JoW24WvmkSTYe6T72kbzbpbjwcqPggk6V6Ub5NjKiiZBEDOtPBYYg 7TNqxxWltuzKxFHCEQ8arDQLodWRK3Ubv0cKX+XR1Py0nGiI7/gVf5HJdry21hnN4FKB d1Qtwr9lZrvo+1/3bVLP4NE5q52SrAsDdA/x9XrAokAWcdfmMz2L9anGP22t/4SZQ+ZA yyb7G8zxBlcM2xxiOtcF7Q8IVr2+/eCCb8XH2nutFOx8sO2vG/Lt8LgK2VGv+mlLm62r V733xkiC1F5fiT0QV0/ymubwadMMqkeElkKSYGFaaZtQifU0u/TqpyiYinGoY5Gxw19a cMYA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YxW32De3; 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 t6-20020a0562140c6600b0068cd10dddbesi3624155qvj.230.2024.02.16.03.09.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:09:23 -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=YxW32De3; 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 1raw38-0004YI-WE; Fri, 16 Feb 2024 06:06: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 1raw2E-0002bV-Qu for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:39 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw27-0001L6-AN for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:38 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40fd2f7ef55so16816995e9.0 for ; Fri, 16 Feb 2024 03:05:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081528; x=1708686328; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+TP1TJioczzc39Hx3iqthMm6LDPQbvhwTOiEAkO1gUM=; b=YxW32De3ZsXwzJns1+dzJxJhcBFHYEb8tnw00Pf98GX+sR5gfeKz/H3vV8ezDDiDmN Vp7iT2hVTH/vhgcq0Zrzd3K1wFB6aA+HwgnbHY/X5FiiFwjHjC4revQ7rlIVkg7gwxnx 3uCP5OMjKl0is5y2Ety2xRPsrWsPB8LYEXR6hi3W6MV5DFzaS4sfVYqLENmRCUYq+/C9 ST7vnlkCbp5vBgMHS4El2ekn9fFvZBNUkaGQ3nUYfHLOZYaS0jpGCX8rQhg/9NHrS7bv ED6JuTxTNE8BcokPCcENyQDdh4B9spnhIuEp48xK8VNG1R0yvqlKve4ebn6UcB/Fjaly EcwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081528; x=1708686328; 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=+TP1TJioczzc39Hx3iqthMm6LDPQbvhwTOiEAkO1gUM=; b=NvERRj9zm9ydTlQTGux8r5v05i+7dJdcvKcJz9xXZ/bTE+jkZwJv6sllPfrWLgtjdI gxpr+C9X2w7y2GHvxDZEAM5NVlPjYHWK9I95yyjvv9HevOZ6P5eHiFWvDL3oDE9xRb4W HlgjfY4lspVyhReoYbOOJKujZ9ZQudFBpDQXnZ2rZYDXO9ooNTHupL8KvRu7tnOSr2n1 xU/FqWPetTnMLlnNFepaDADNlONaRiJMpmJkM2wueiZjEVqqXn6s2r5VyqnR0+8HRS+V IT/6slut4sDIOWgLNUcZOKqDjZuhF2kT02I/HT6c9jmVF7tV1l5KxFdro8Cb8MQ36huh imWQ== X-Gm-Message-State: AOJu0Yy7Q8jk87ObReJPyAzDiTb7mA9Wy39ivEFNLzTcY6zVdkExqelb b9GLV2CU0V/cjqBHo85kXrElM+Do5gcpf5FPuU7lk1jXs9LUvU5GYiz1Nr8PpO0cbx/11zbhMQM G X-Received: by 2002:a05:600c:3b10:b0:411:aa3c:128d with SMTP id m16-20020a05600c3b1000b00411aa3c128dmr7082597wms.15.1708081528391; Fri, 16 Feb 2024 03:05:28 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id l8-20020a05600c1d0800b00410c04e5455sm2031239wms.20.2024.02.16.03.05.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:27 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PATCH 20/21] hw/arm/mps2: Add QOM parentship relation with OR IRQ gates Date: Fri, 16 Feb 2024 12:03:11 +0100 Message-ID: <20240216110313.17039-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01 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 QDev objects created with object_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé --- Better would be to embedded an call object_initialize_child()... --- hw/arm/mps2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c index 50919ee46d..780f2adf0f 100644 --- a/hw/arm/mps2.c +++ b/hw/arm/mps2.c @@ -274,6 +274,7 @@ static void mps2_common_init(MachineState *machine) orgate = object_new(TYPE_OR_IRQ); object_property_set_int(orgate, "num-lines", 6, &error_fatal); + object_property_add_child(OBJECT(machine), "orgate12", orgate); qdev_realize(DEVICE(orgate), NULL, &error_fatal); orgate_dev = DEVICE(orgate); qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12)); @@ -317,6 +318,7 @@ static void mps2_common_init(MachineState *machine) orgate = object_new(TYPE_OR_IRQ); object_property_set_int(orgate, "num-lines", 10, &error_fatal); + object_property_add_child(OBJECT(machine), "orgate-12", orgate); qdev_realize(DEVICE(orgate), NULL, &error_fatal); orgate_dev = DEVICE(orgate); qdev_connect_gpio_out(orgate_dev, 0, qdev_get_gpio_in(armv7m, 12)); @@ -333,6 +335,8 @@ static void mps2_common_init(MachineState *machine) txrx_orgate = object_new(TYPE_OR_IRQ); object_property_set_int(txrx_orgate, "num-lines", 2, &error_fatal); + object_property_add_child(OBJECT(machine), + "orgate-uart[*]", txrx_orgate); qdev_realize(DEVICE(txrx_orgate), NULL, &error_fatal); txrx_orgate_dev = DEVICE(txrx_orgate); qdev_connect_gpio_out(txrx_orgate_dev, 0, @@ -425,6 +429,7 @@ static void mps2_common_init(MachineState *machine) orgate = object_new(TYPE_OR_IRQ); object_property_set_int(orgate, "num-lines", 2, &error_fatal); + object_property_add_child(OBJECT(machine), "orgate-ssi[*]", orgate); orgate_dev = DEVICE(orgate); qdev_realize(orgate_dev, NULL, &error_fatal); qdev_connect_gpio_out(orgate_dev, 0, From patchwork Fri Feb 16 11:03:12 2024 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: 773321 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287512wre; Fri, 16 Feb 2024 03:09:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX5wjb6YnXR4rDXyiDR5g7IP491gIWuAanniPuQP+8tKVHxXM2Xavbyo1zr/qklSfJIiBTvd4dYkLz3a7SZwq2T X-Google-Smtp-Source: AGHT+IEN/un1PL572RqC8GOiIUMEWc8CWjPT7d9QmPR5NOjG+vA3IjiF7lb6xBOqu0qtIpGH0Rqo X-Received: by 2002:a05:622a:1b8d:b0:42c:70a8:1b40 with SMTP id bp13-20020a05622a1b8d00b0042c70a81b40mr5267558qtb.17.1708081762515; Fri, 16 Feb 2024 03:09:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081762; cv=none; d=google.com; s=arc-20160816; b=ZCq0dilsNBXgfstyhDugdBUdn5FzVVm27NJpNF8nHpzJ0+eD1ZGQybgy3Yo+ALO3Cj QbyXbugct1FPYY3fspZGTMdoYcloMJ+InA2cGTI0uv43GUPTbkg/ucjwD9/E41HRQymE ihs5pq/9ZlsjipdAlgWIVMzAlKSkhu2uUXk73ZDNYZ5WArX7iMS/kE7lQpxDzpxbt259 oe8m/Tp3fUNs+7I3ZjoGxJphS49/5jfALrwTrpx5+rKZNjvGhowWhv3ibnMx5Mrgr8+1 /CGlP27TBya3et9A/QZlb2YmQfbcN5+mcHSWV41ReDrArKghIjt8O4VzK0VGn3fyODmq L8CQ== 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=F6ajeUmTQmKHExarjmIHQmgeLAwEfZL4L6fDKfFyi0M=; fh=ZKKgbbU8WVqPGHC0Cm5TsGKB0jx8PKipJZhIfpuaAW4=; b=XWpoms9nMmvexinH1sScFtU6erDacLQYf+1dItshOfK/tEBDc106ZOUUC3j+SRJ4cK RB59d0ozvExoyCUhpDdq3ZfVjVj+Nsk9YrkkJ4l1lz/bVXfDoqoH3MbU4Cb8d8M7yiir UrrFAVa3n/bqNzFIReIKzRIHxlK76TdS6XyCyeIbyZIUmX9DQrhl7wzg+wCUOPLh0eki g7XiIbiyu6G7VAQ/pa/oQZLYc8CPNpgxDvW6mwSmwHASbssEH4TxCBOPo0TFc7pSMfqX L+70DYfERAdsNb2WaGaIvRdRgkJKf7QMWVLyVFkk0hAYpNuKnssfE7aLIpZvxqku/AXI FkOA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dWLtbfh1; 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 g10-20020ac870ca000000b0042c384540d3si3391595qtp.595.2024.02.16.03.09.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:09:22 -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=dWLtbfh1; 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 1raw2M-0003Mr-SU; Fri, 16 Feb 2024 06:05: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 1raw2H-0002kS-D4 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:41 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw2E-0001W3-4p for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41211097adcso13376235e9.3 for ; Fri, 16 Feb 2024 03:05:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081536; x=1708686336; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F6ajeUmTQmKHExarjmIHQmgeLAwEfZL4L6fDKfFyi0M=; b=dWLtbfh1Gmr6bwIP2lCRTT6tGAslqKGAd5oAfkaSRPDMUCRyTqrHaOGoSpQq9ioStb Zo9NDQ0ilplfg58JEJ9G+W8gDEftqg10W9VITYfrbK25DD40K2bPSp3PxxMd9p2DOKTi 5zzyWXTpXBDo1MpFRnNRLiAI6AsdvhnaB0qVUMV72LrQ28NhRKR5SUgjSeGkLxxapIxr YxbG+y8RZW2ny7sivB4uNUYLOwlcXnr17Sc56bQYA+7CZ/XpoUaaCl6KUsGo5DqdP1cf Um63Hnh9nc7+vBnal5rnbsWfAr0KlvwWm4PMTM/9dDoQHcRTCRn0h6tl++kZ50gXV8Kw yP1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081536; x=1708686336; 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=F6ajeUmTQmKHExarjmIHQmgeLAwEfZL4L6fDKfFyi0M=; b=LCSpljAMvxZIgpStSfmAF7n0hTY/1uCiLWxuhGt8MAirGYQwO8GlepFg6+7Pimvqep I+Zmye2yUEOpoOglANa6VV1h5pDr+8dJF6xk0fK0fnJzxSECXpRsh+QwMiuw2QL1UugL WfNdyLZDAZd7dwov/RBrSuEdJBriCa1qiUNNlnIrtxqMcILwN/qG8UyppyEcXXEeBrmx pQmBLJQCUVWMb8EfATyMUQbdpZXFqKvDpF+KJAGVc6WyYfwBimeXSmpYUUCk4WWrGuLG 1HQFn1X2F48CrnrN17aE769Fb+Zc75dIFPmzWO/CPaP46lg94skT9uvx+RvVrYqaVxHy XR8w== X-Gm-Message-State: AOJu0YyWgYVbqyUAb9Roke0s9LtEc8PYhyC1xHGxqXw/5egr7okA57KS 2K0FoKaineQv0UpSRRrmWtpMpdyjsGT9xQunNwDOr0490bOZJdGjqJk826UZ/We5uYWHifUZIdR p X-Received: by 2002:a1c:7918:0:b0:411:a802:700f with SMTP id l24-20020a1c7918000000b00411a802700fmr3604707wme.39.1708081536016; Fri, 16 Feb 2024 03:05:36 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id 13-20020a05600c020d00b00410dd253008sm1927267wmi.42.2024.02.16.03.05.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Edgar E. Iglesias" , Chris Wulff , Marek Vasut , Nicholas Piggin , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , David Gibson , Harsh Prateek Bora Subject: [PATCH 21/21] hw: Add QOM parentship relation with CPUs Date: Fri, 16 Feb 2024 12:03:12 +0100 Message-ID: <20240216110313.17039-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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, T_SCC_BODY_TEXT_LINE=-0.01 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 QDev objects created with object_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu --- hw/i386/x86.c | 1 + hw/microblaze/petalogix_ml605_mmu.c | 1 + hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 + hw/mips/cps.c | 1 + hw/nios2/10m50_devboard.c | 1 + hw/ppc/e500.c | 1 + hw/ppc/spapr.c | 1 + 7 files changed, 7 insertions(+) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 684dce90e9..7021419d91 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -102,6 +102,7 @@ void x86_cpu_new(X86MachineState *x86ms, int64_t apic_id, Error **errp) if (!object_property_set_uint(cpu, "apic-id", apic_id, errp)) { goto out; } + object_property_add_child(OBJECT(x86ms), "cpu[*]", OBJECT(cpu)); qdev_realize(DEVICE(cpu), NULL, errp); out: diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index 0f5fabc32e..dfd881322d 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -83,6 +83,7 @@ petalogix_ml605_init(MachineState *machine) /* init CPUs */ cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); object_property_set_str(OBJECT(cpu), "version", "8.10.a", &error_abort); /* Use FPU but don't use floating point conversion and square * root instructions diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petalogix_s3adsp1800_mmu.c index dad46bd7f9..255d8d4d47 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -70,6 +70,7 @@ petalogix_s3adsp1800_init(MachineState *machine) MemoryRegion *sysmem = get_system_memory(); cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort); qdev_realize(DEVICE(cpu), NULL, &error_abort); diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 07b73b0a1f..6b4e918807 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -84,6 +84,7 @@ static void mips_cps_realize(DeviceState *dev, Error **errp) /* All cores use the same clock tree */ qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock); + object_property_add_child(OBJECT(dev), "cpu[*]", OBJECT(cpu)); if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { return; } diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c index 6cb32f777b..f6a691d340 100644 --- a/hw/nios2/10m50_devboard.c +++ b/hw/nios2/10m50_devboard.c @@ -95,6 +95,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) cpu->exception_addr = 0xc8000120; cpu->fast_tlb_miss_addr = 0xc0000100; + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); if (nms->vic) { diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 3bd12b54ab..77b7d2858c 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -956,6 +956,7 @@ void ppce500_init(MachineState *machine) */ object_property_set_bool(OBJECT(cs), "start-powered-off", i != 0, &error_abort); + object_property_add_child(OBJECT(machine), "cpu[*]", OBJECT(cpu)); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); if (!firstenv) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0d72d286d8..b6e5caa0d2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2715,6 +2715,7 @@ static void spapr_init_cpus(SpaprMachineState *spapr) &error_fatal); object_property_set_int(core, CPU_CORE_PROP_CORE_ID, core_id, &error_fatal); + object_property_add_child(OBJECT(spapr), "cpu[*]", OBJECT(core)); qdev_realize(DEVICE(core), NULL, &error_fatal); object_unref(core);