From patchwork Sat Jan 25 18:13:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950494 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE489C0218C for ; Sat, 25 Jan 2025 18:16:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkfL-00089M-LV; Sat, 25 Jan 2025 13:13: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 1tbkfK-000895-4n for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:13:54 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkfI-0004C8-Mh for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:13:53 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4368a293339so35389195e9.3 for ; Sat, 25 Jan 2025 10:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828831; x=1738433631; 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=/se+ZOUWHI4guWWCfgPKU8ovKC99g/6LRZidVGKe1oI=; b=GknMRLSa0TwPL7aGa+NUapTQsmVfLpYvkuIwl9e3cChzeXZKOw3zwYpUhiD7mwsrQa AaHaHMKF/Ur92+Dkj+7ZTPHHllsL+jkSNbQ88UwFgsgj1XWbllYpIUejAH0D8h4KfbKy pqnNOYSB0j4GAjEk5deYZ2obM7SdFoh8fkVjqXeeIK996XlVil2bmTd+qLaX8yWeL3mW KLywr33aSGfLxqeGRVOje2oMc220F2Z8xXCw2276C/vUSkMOExAWgPYBDwwX6OFXpQ8E oUV15Xt89TB73ujlZGqKPHN3MmLOz1LYyTCxTdR/oCfOMeoTfa4B/T0SVtlJ5NDgFq7s xZWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828831; x=1738433631; 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=/se+ZOUWHI4guWWCfgPKU8ovKC99g/6LRZidVGKe1oI=; b=Tf3sa6fEtE7QUtPrI6Sghy5xypFxPMSrFQkUw08+1u1P/Yu+mbw5DTmNdK4AYcHuFd 5aAKlJcozy3zdRH8apB40zwwDS9bhokweu+u7mBFwFe3Hi2IzWnojpEgNLUetoet3Nkw TgCRAi+4sehgjY1KuosFcSTo3iAiQXPc4/PdmSZ119ipzhlCDnY0S0azWwMSEhebmMVn ifLF2QuixtReF1G43i9Ey79NJQhGjLyWce/qpgvUgC0NoILCyz1gGEAaqZ3sTb29nBcI eFMbhOKJUyxcyhO82vCGvQoS06wLQ6XILxLoWzzQzja/1F0nJzNeuYwo493lz52P9OWE 2oWQ== X-Gm-Message-State: AOJu0YzCirW61FgRxWc0a9TfnUFk2hZwR2UDFMt1tCCjXErVindzvfGZ 7AG4007d2H4iXrwx75aBJPQeWS2hj1bSFYMPN9pzGjwIVDPdDPbdvlcl+4o8Yh7Jdm/q1A2mI/v SRZs= X-Gm-Gg: ASbGnctqgdsZWp7DN4H3AseGnbNQfQd1yIoNFbvOxAMnQykScCCzCVH1lftfBxkmIwd RHbb5guABQmhyfgfZsBSNMdbrvtXV3JkTloU7l+jvpDM1OfaNWCuZt/Us6eSP5G4YRSUAgR7qMB OP1FUcY1CpyN0vq75tK71+cGrHWD0O/d1Es9D+hdDpIrU1wADf0XFW4rOSiVqm37ZwE3jo7gr/6 2KmBmJENvF9aIEun2i8qhgbQzn5ZVN0ErDxSv+FaHQFi+QG4CR/WOOgg13qgUEkbc3lgUAofaWw tB1v+pp96yoUk9mWNze3F9YU23swdk86NE93uMY4UIPYFY96LfDNC0IQB5tF X-Google-Smtp-Source: AGHT+IGP2iaXKLI15CkhKDP5NBlnFOMSHwCbGSNXKLvJxawalslRdLF5wYi0CoJhDHevjTYCGWh83g== X-Received: by 2002:a05:600c:3d86:b0:434:f9e1:5cf8 with SMTP id 5b1f17b1804b1-4389143c306mr335517805e9.31.1737828830945; Sat, 25 Jan 2025 10:13:50 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c4e49sm6227077f8f.98.2025.01.25.10.13.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:13:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 1/9] hw/sysbus: Use sizeof(BusState) in main_system_bus_create() Date: Sat, 25 Jan 2025 19:13:35 +0100 Message-ID: <20250125181343.59151-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Rather than using the obscure system_bus_info.instance_size, directly use sizeof(BusState). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Clément Mathieu--Drif --- hw/core/sysbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 9355849ff0a..f713bbfe04f 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -323,8 +323,8 @@ static void main_system_bus_create(void) * assign main_system_bus before qbus_init() * in order to make "if (bus != sysbus_get_default())" work */ - main_system_bus = g_malloc0(system_bus_info.instance_size); - qbus_init(main_system_bus, system_bus_info.instance_size, + main_system_bus = g_new0(BusState, 1); + qbus_init(main_system_bus, sizeof(BusState), TYPE_SYSTEM_BUS, NULL, "main-system-bus"); OBJECT(main_system_bus)->free = g_free; } From patchwork Sat Jan 25 18:13:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950488 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 892EDC0218D for ; Sat, 25 Jan 2025 18:14:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkfa-0008Au-1G; Sat, 25 Jan 2025 13:14:12 -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 1tbkfR-0008AA-KT for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:01 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkfP-0004DF-G7 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:01 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso22053825e9.2 for ; Sat, 25 Jan 2025 10:13:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828836; x=1738433636; 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=+D9ecSNssEoyInsTWPhPYbcbkHeV5ELbKuxuFIHXnAU=; b=rU78N+B3vpdOV7osTi+XpxaA6bjXEzDEr/je2nB74xXl3TnF5P2XtlZQ4TBO8QFtfA 31YpqYzjmnGqCCOUhgA61ZoBcx3gX+7lyJ8UptDJx619CySHHOu11bOn3u1HZQkrpJJd B0UzOrjJpjVZ3Q+mq5MKJoX7GdTTATLhob5SghfVersmcPGtf+bhmTWGoqWH3U7y7hVh sNWcEa2IahFd9HYckNqPt17Peb92NMfvQrLo4NjczElYJwjjJ7EGzX/ZK8RImgyvN/28 BUs3XsE/f9I4fbQZGcrIxECUj/cc+TAdzkHDNTjtGxQA6Q5uBBmiXFg+aN0BHuJKqcPH 80hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828836; x=1738433636; 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=+D9ecSNssEoyInsTWPhPYbcbkHeV5ELbKuxuFIHXnAU=; b=Y1mR4txbkgbOmJK8NBcfU96JAoB7d9evHLucEPWzWm+hyYnzAiMVujbzqLRpCHO4cX DYli3U5dTpRdbIdNga12PnJK+TSixQul3mt75FjAH6f0pxDfxorShzrQO4zQ2xD/Dmoj KzUKj8N7k8V6ejn9FdePa5KanEmGwyGzOscrlo5Vp9pr621Nl0a9//ofUjCboEkrvUQz 6YGiITRy1oite8LEeNXnste1xI5L4JHGVr29DYaHC4xMxWP4vsPnGuUbXqNwrJa07+eF LKOu6vWYim8lMDD1sa+HHFz1wyzJ9bX5bcS0tpvsQENA1i+hJSA3BTzW3bXFYvaF8Bm6 wfUw== X-Gm-Message-State: AOJu0Ywl7WhmbX9tW3Y14SkmhWzruhTYuOc/Omx8BNj/LDr/sBW0aw+0 tRMjqLDJmrOPFTqQvtwjPhjs3VQi/8yULOngE42S6dNRNBjX4ykRmWBrELtvTsAcaxtNIcmoMsA Adjo= X-Gm-Gg: ASbGncs1rGCfL5zi8zIrs/ZFzitnw8TuxFGk8xNL4/03VuTMau4JCFR+sp7/LFDUbvu ppNmBEWZkw8tNext834lpdMMGCk74RKsw8fDSbOLQTZXCkZrQDPpoBvP2ATbrIFGgBxXst3KV96 cMTdJ9td6/fbCiqDLda2UxPqcG1m5jArf3c2IF3Xh4eKWuKHgqW1hp4P0+Rf3E2H2QU1ryMAmrX AaJlns2pJwApD8Rg09sNsWXdZjERZ0CNECk/ezx4ve8s4bJg6nngtYcV3XlcUmoF6aNYeDFRd23 R6ddtw3HkuzrOIRTn0BkaYADHa8TBkAyAhk/U9NmDgzBrt7bWYpckRLltH5U X-Google-Smtp-Source: AGHT+IH3gG9oDbH+Yt++6e9axdywvxazaykwi7sr/Zo0cY2/uHyHOw51lxlnycmePra8xEH0EQ/Sbw== X-Received: by 2002:a05:600c:3b94:b0:434:9934:575 with SMTP id 5b1f17b1804b1-438913e02f8mr395787785e9.16.1737828836350; Sat, 25 Jan 2025 10:13:56 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4c75c0sm68201815e9.31.2025.01.25.10.13.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:13:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 2/9] hw/sysbus: Declare QOM types using DEFINE_TYPES() macro Date: Sat, 25 Jan 2025 19:13:36 +0100 Message-ID: <20250125181343.59151-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Clément Mathieu--Drif Reviewed-by: Bernhard Beschow --- hw/core/sysbus.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index f713bbfe04f..306f98406c0 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -80,13 +80,6 @@ static void system_bus_class_init(ObjectClass *klass, void *data) k->get_fw_dev_path = sysbus_get_fw_dev_path; } -static const TypeInfo system_bus_info = { - .name = TYPE_SYSTEM_BUS, - .parent = TYPE_BUS, - .instance_size = sizeof(BusState), - .class_init = system_bus_class_init, -}; - /* Check whether an IRQ source exists */ bool sysbus_has_irq(SysBusDevice *dev, int n) { @@ -306,15 +299,6 @@ static void sysbus_device_class_init(ObjectClass *klass, void *data) k->user_creatable = false; } -static const TypeInfo sysbus_device_type_info = { - .name = TYPE_SYS_BUS_DEVICE, - .parent = TYPE_DEVICE, - .instance_size = sizeof(SysBusDevice), - .abstract = true, - .class_size = sizeof(SysBusDeviceClass), - .class_init = sysbus_device_class_init, -}; - static BusState *main_system_bus; static void main_system_bus_create(void) @@ -337,10 +321,21 @@ BusState *sysbus_get_default(void) return main_system_bus; } -static void sysbus_register_types(void) -{ - type_register_static(&system_bus_info); - type_register_static(&sysbus_device_type_info); -} +static const TypeInfo sysbus_types[] = { + { + .name = TYPE_SYSTEM_BUS, + .parent = TYPE_BUS, + .instance_size = sizeof(BusState), + .class_init = system_bus_class_init, + }, + { + .name = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DEVICE, + .instance_size = sizeof(SysBusDevice), + .abstract = true, + .class_size = sizeof(SysBusDeviceClass), + .class_init = sysbus_device_class_init, + }, +}; -type_init(sysbus_register_types) +DEFINE_TYPES(sysbus_types) From patchwork Sat Jan 25 18:13:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9536C0218D for ; Sat, 25 Jan 2025 18:16:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkfj-0008E2-99; Sat, 25 Jan 2025 13:14:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbkfa-0008C0-75 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:13 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkfT-0004EF-JH for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:05 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-385de9f789cso2506565f8f.2 for ; Sat, 25 Jan 2025 10:14:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828842; x=1738433642; 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=60AuA1WDx9vhZn9WTP7sL5YOcyHTmPSWNTPXV1fPX/g=; b=NOzNXYXMvUQ4z6MSZv8v0orQ4FQb/kv2Kc9CbBejaFKVNbD5GDarkQdePQTGQZmwA2 ssAwj9pilZthsmAmScon3CTvuh4JYgPdc23nidlKmzTzuE0MSY8CgDPDZIh8yRL6SkfT GO/RxnaA4EwR4xSnuJcfeMv72GEJ9cHnCO0c7UqmWt46WIdqQicZFwoa/APSG/JHdF6E 1T5LRbjuTrz+jfBWImRPtXHycqulcDqeBnxt7NWfYmO/DGO1J3mDKdDtVX3XrZhGQJd3 X/u1lZhEhZNdrp7xuHucMNM922jWI/zYXdwFVCVldlzmPsU5We1gF2VAtUGrDilKNoiV 4isA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828842; x=1738433642; 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=60AuA1WDx9vhZn9WTP7sL5YOcyHTmPSWNTPXV1fPX/g=; b=dkk/WwD4QYDc53IBhQcjYEzAc+1a3pfKWUNgx8zNmBOB9lRGnDFOfPXVHRzpTNNaZE WQnUBmix+tYuQh6wOQRMq2MqTzOUtufkhWfvytGQjpZ6LnqVjzdxrU0IESKVcR2bNAWi S0qz3Xbi2/tmMrpGkpw+ZHs0UAa8tt1xlgUUoDhEsU01GbeygKO2Omkr4xzzYnZ/rZoc 2N+GnY/HWLSVUTWy0uQ5bdmizWqMwpO1JQBGv/ZZAto63eTDZyfqnITtR7PH1LBJD0of 4+MjtyM7GSiZOA8mJ2f7MO+p+miqp4+ELWiQIWGXCBf5c2m5X42YAhh9tQZcZPsYE/bl JmHA== X-Gm-Message-State: AOJu0YzQVJrhqKmtZzyRq48vRWSYRUrFoYOAs+EiD2YqegfHNToDo/Ko bOHSRFJRMAui+UeYimwUNwxhVGqawKB2nky1+Ps+vFEgcm8iiboV2Ph34UwITxWJs+eK92ZLwTA sTUA= X-Gm-Gg: ASbGncvASX6FqmsJJ2JkElzpfJTGHiWIMIfnibZ+Xh46o6c5jKADK2S5QlWO5WWfHYz 9s2SWsbrLCSyLjBoMV5UETbo2w45UK9pNOdu0LwH01At0cYtwv0sx24O/5WCQPydjDO1ayFX3yX g0DQXbrpPPcDkbMSRdzD+AittdLpXhFebtqqMU2DbeXM1NnJraLRsNN0Qs7IkRg1lNc0k7jSW3o JyT6nk422u2VtUzg/3LkxGqEecxqrfUGeUZFj/Fleq8yt6ph0LAtd80+6KS1/JpnkOxZOJ8yHEg Fc9qFgmviV+Sd7BjbTO6qNmlMMB0nhCXYUwgmllwggcMYFvYrnkpR2Q3DT9/ X-Google-Smtp-Source: AGHT+IFmsyFMtRiyUoQTMlDTj6UgcQ0Wyp8q7Re0IHss6ougDQh97Nwe8Gj2HZEyku0oDKVtn8rFyg== X-Received: by 2002:a05:6000:2c5:b0:37d:4647:154e with SMTP id ffacd0b85a97d-38bf5655bd3mr29759427f8f.9.1737828841654; Sat, 25 Jan 2025 10:14:01 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17d865sm6249213f8f.38.2025.01.25.10.14.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:01 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 3/9] hw/sysbus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:37 +0100 Message-ID: <20250125181343.59151-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Some TYPE_SYS_BUS_DEVICEs can be optionally dynamically plugged on the TYPE_PLATFORM_BUS_DEVICE. Rather than sometimes noting that with comment around the 'user_creatable = true' line in each DeviceRealize handler, introduce an abstract TYPE_DYNAMIC_SYS_BUS_DEVICE class. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Clément Mathieu--Drif --- include/hw/sysbus.h | 2 ++ hw/core/sysbus.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index c9b1e0e90e3..81bbda10d37 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -19,6 +19,8 @@ DECLARE_INSTANCE_CHECKER(BusState, SYSTEM_BUS, OBJECT_DECLARE_TYPE(SysBusDevice, SysBusDeviceClass, SYS_BUS_DEVICE) +#define TYPE_DYNAMIC_SYS_BUS_DEVICE "dynamic-sysbus-device" + /** * SysBusDeviceClass: * diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 306f98406c0..e8d03fd28d9 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -321,6 +321,14 @@ BusState *sysbus_get_default(void) return main_system_bus; } +static void dynamic_sysbus_device_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *k = DEVICE_CLASS(klass); + + k->user_creatable = true; + k->hotpluggable = false; +} + static const TypeInfo sysbus_types[] = { { .name = TYPE_SYSTEM_BUS, @@ -336,6 +344,12 @@ static const TypeInfo sysbus_types[] = { .class_size = sizeof(SysBusDeviceClass), .class_init = sysbus_device_class_init, }, + { + .name = TYPE_DYNAMIC_SYS_BUS_DEVICE, + .parent = TYPE_SYS_BUS_DEVICE, + .class_init = dynamic_sysbus_device_class_init, + .abstract = true, + } }; DEFINE_TYPES(sysbus_types) From patchwork Sat Jan 25 18:13:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950490 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F156C0218C for ; Sat, 25 Jan 2025 18:15:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkfn-0008FD-39; Sat, 25 Jan 2025 13:14: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 1tbkfe-0008CS-1H for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:16 -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 1tbkfa-0004F8-0S for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:12 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-437a92d7b96so32123215e9.2 for ; Sat, 25 Jan 2025 10:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828847; x=1738433647; 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=dyOkRsNGVEWSIU/g0zj3C7+UfvVjzQgLwIYDoErjrzY=; b=j7cufMCr+elMY6jVERZ8Fx+SxovwQ0h+/COMnnW6yJ7O16eXCMYJNV3AaiKYNDR5OG KiVXZOy152tw9KYAi3wFgL1zUL0w6LeKihf+ct1FE/6Z0KOWx0zqLY2uMNP7SPYMPEE+ sLTzyGN7/YRgzCx52oDY4180qkQajYB4ePPLleWk3wSo1SDyrCh9M64Dn3HCkTpWfaKD ewWEahHz9wtOn8vZIXz3mcKQk9e9CHyg0q4RGbqEH2AqStMEBn6v3sFIqG3yRUccUMBc 3CqQWQSk7s4NFun6SQ+NkTVcNoyfIfXkffzfUv8NTWFB2NgLR0UiyueL1BotIktEA3pE 8UIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828847; x=1738433647; 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=dyOkRsNGVEWSIU/g0zj3C7+UfvVjzQgLwIYDoErjrzY=; b=OT5znBFscITiz5zPCUF/9FBEwXZsoBpOgVZ9gC8vgaK8qc0RJ3qxDSH3QOIngW9Lh6 qfFGxiNLXNEiXnyVnIZfr0vefiFy+fkM2NZK4JylQRbbDFPM92RjCo5i/5lzCayX+cIa G6J6hnCf8WBoCn/jBsB9QHnSjCMazltkcQMcpR6Zrks4lP55DxVH2w3HN2eDfbqROVU4 8fxKZ15rm+iqLKfgIC0XUnH0GPglCT4mYGul3fWYEQs4da7vC0VtUdLYgUwLmAbShs52 pHI5iH1mGHTXF52/PjyonizGhp+kQILNgPJsiz1jhZKUF0vF0Y6CPBNXvu5W4oXlsoio 4J3Q== X-Gm-Message-State: AOJu0Yw3mMPBvecZzGcWME7iRG3gOsMU9Ik+c7WqYvRlXWmuPqIfnV1m tD7Ju9suiR4oyKoJOsRFmLM/q9vQ7NAs/1wrknBJRtTPYuU5DGiY2MOnTwCW6fQ2APU3uumovzS bggc= X-Gm-Gg: ASbGncvibm1VqCfD9qtfdgMcthD79yViPRlwOJhiMoHOxJJU785uv0cwVr8ycYRnMwl 2gfyUeV0ep0oFnq1XqhAF59xHRFyW0WcO/2195H6X7RmiC88pdLAmV5x8qTwI7XO7urUIJRD+wK l9I8jR4OWx9zXdsjybHUuSOvqGdukm2kGwvkoJ7LfYtem0d/mUZM2aMJJERbVZs2amIeHo/doLG EAj8aNlQAhEff3hrk9r82UmRu+XJKxnYrpBVwwa/LezhZ35rJTSh3hx4uWj4HIwLYRF6vNH6JlJ LiWYyTzyuGxFdYKiHYlMjVEdvNb1Vbfgrj4bEhlacrAjEcXlhgeFERdU0jqm X-Google-Smtp-Source: AGHT+IEr2qoA1rRQRSxzBRg9AaVRyh1DsB0c2e066JVheh7W35FZo8o118MnJ47nSIRaQRkoz3MpFg== X-Received: by 2002:a05:600c:468d:b0:436:4708:9fb6 with SMTP id 5b1f17b1804b1-43891437546mr293523335e9.20.1737828846888; Sat, 25 Jan 2025 10:14:06 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4857c3sm68307685e9.10.2025.01.25.10.14.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 4/9] hw/vfio: Have VFIO_PLATFORM devices inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:38 +0100 Message-ID: <20250125181343.59151-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Do not explain why VFIO_PLATFORM devices are user_creatable, have them inherit TYPE_DYNAMIC_SYS_BUS_DEVICE, to explicit they can optionally be plugged on TYPE_PLATFORM_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/vfio/amd-xgbe.c | 2 -- hw/vfio/calxeda-xgmac.c | 2 -- hw/vfio/platform.c | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/vfio/amd-xgbe.c b/hw/vfio/amd-xgbe.c index 96bd608b8dd..aaa96903db0 100644 --- a/hw/vfio/amd-xgbe.c +++ b/hw/vfio/amd-xgbe.c @@ -41,8 +41,6 @@ static void vfio_amd_xgbe_class_init(ObjectClass *klass, void *data) &vcxc->parent_realize); dc->desc = "VFIO AMD XGBE"; dc->vmsd = &vfio_platform_amd_xgbe_vmstate; - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable = true; } static const TypeInfo vfio_amd_xgbe_dev_info = { diff --git a/hw/vfio/calxeda-xgmac.c b/hw/vfio/calxeda-xgmac.c index 87c382e7361..b016d42b496 100644 --- a/hw/vfio/calxeda-xgmac.c +++ b/hw/vfio/calxeda-xgmac.c @@ -41,8 +41,6 @@ static void vfio_calxeda_xgmac_class_init(ObjectClass *klass, void *data) &vcxc->parent_realize); dc->desc = "VFIO Calxeda XGMAC"; dc->vmsd = &vfio_platform_calxeda_xgmac_vmstate; - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable = true; } static const TypeInfo vfio_calxeda_xgmac_dev_info = { diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 1070a2113a1..f491f4dc954 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -672,13 +672,11 @@ static void vfio_platform_class_init(ObjectClass *klass, void *data) dc->desc = "VFIO-based platform device assignment"; sbc->connect_irq_notifier = vfio_start_irqfd_injection; set_bit(DEVICE_CATEGORY_MISC, dc->categories); - /* Supported by TYPE_VIRT_MACHINE */ - dc->user_creatable = true; } static const TypeInfo vfio_platform_dev_info = { .name = TYPE_VFIO_PLATFORM, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(VFIOPlatformDevice), .instance_init = vfio_platform_instance_init, .class_init = vfio_platform_class_init, From patchwork Sat Jan 25 18:13:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950492 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FF90C0218E for ; Sat, 25 Jan 2025 18:16:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkfu-0008KU-KZ; Sat, 25 Jan 2025 13:14: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 1tbkff-0008DA-K1 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:16 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkfe-0004G1-1X for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:15 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4361c705434so22040945e9.3 for ; Sat, 25 Jan 2025 10:14:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828852; x=1738433652; 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=oekQdNljsXmvRCfjRcF/YH736cTnRtLa3bqMS7/4HKc=; b=bR1OGlpggt6HX8m3z2x7MOCllw3RVk5BDUY4TGdhp8kCz+DUqDqF2hxqUyW1oVkfon wbpSH0FlL6ksGziFt9R0FLwimj2uO0MtrmUEoFIc1jRUMYDi2QzGO5pNjW4+tYmid5w+ wfE3/QLzLMjikmNm5sFiZ80lWYPZOmhjRSAuTYz7hjgK0NaRsPOykXLB2Rqwzk0UDqLk 7SLo35bUoripsOX35VozZLzJKGqr3xXsYVpQvaIOQfsW5HWleZEk8wQ7aHCa4nM8Nr4q r9eCKx59fG7UvEsCgfbseTcBoFhpBArUv9eNAh0SLlWKMDxb8WGYJz8/yALW1NY1uqGP CaDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828852; x=1738433652; 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=oekQdNljsXmvRCfjRcF/YH736cTnRtLa3bqMS7/4HKc=; b=ph1yTrGsvrGfjd1S3TR69oEoDDmElU93brJ6JAKdlo/FFiKm/oYRqUUrE4FbVQhs1J BRRgITAcqRiE9g6m8Uxs/QQV1K6HPkSPbdizZwzIz9gDnd1pV9M7WEFBx1pwfKOI7o5N tuTJKjya3tlArMe5OptybQcJMFGtQ2EvnZhp2imsFpmBIY5Rr9zwMc1YeiOjdNJTJzGr QH88k9UJRaseQJT/GXQkYHedHUzR5EF33+JK177/U4nnxrPxlg/PwwUKZGHGeLn+l+rD WJEwkydmrKIdHzpLMIqKF9Nh3Ni6hYKlhuT3EBC2WJ+jJDV1woOvWNYOg5Xg0EAKKCtW j1WA== X-Gm-Message-State: AOJu0YzNTRz0mGiwMdvJKyvHzeggvGBW4THHns/KdxCKyRbd1hSS3M4K ic304yEABR8Rkg2hqIpD+FUTXzhZ+/oRVB+wwYpjeaHxyet8M6Woi+Bq2STFdKuRZHYUD+4WKGK 2B4I= X-Gm-Gg: ASbGncvPQDXL+7ra3qIG2sdGKKhUVCCiT6en2KEsWmaWq/y24MPIHF2okHfjcUc+SoK ImTpgrwmvisOMk/1WfKFY70Uge7iS1DO0alSL6EVUsw87x/NpsmHl0OgUPPCLE6dyMrsqGTMouj CYaz+wODEA7+L7K8TdjYg0b/WjgWuaChdy1fBL0dfBApWdTpFf6+PEOinIM4DM8Py/fQUAuvYXL nvxUraqspAtWo5yqj/CnEVJ2ub8RPa53YyhJjS3NYepQr1AqirY+mO+A3BaCkbr9/4eVdNKoWRJ fKHIBDkABUJdlCh79G1QDHKetZhEZjN9A+BcCxoPnz8D2MVyaw1mPjo5YW8X X-Google-Smtp-Source: AGHT+IFcf5NC5w3OdMEeSdE+fJzRv8eMmKrsAaFn1q2W0Qs4+hxyDFiFEoLFYJSBxaKkISXGUJ3R0Q== X-Received: by 2002:a05:600c:1f19:b0:434:a1d3:a30f with SMTP id 5b1f17b1804b1-438b9cc072emr109914115e9.6.1737828852191; Sat, 25 Jan 2025 10:14:12 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4900e2sm68626685e9.24.2025.01.25.10.14.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 5/9] hw/display: Have RAMFB device inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:39 +0100 Message-ID: <20250125181343.59151-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Because the RAM FB device can be optionally plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Clément Mathieu--Drif --- hw/display/ramfb-standalone.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c index 6c35028965d..1be106b57f2 100644 --- a/hw/display/ramfb-standalone.c +++ b/hw/display/ramfb-standalone.c @@ -72,13 +72,12 @@ static void ramfb_class_initfn(ObjectClass *klass, void *data) dc->vmsd = &ramfb_dev_vmstate; dc->realize = ramfb_realizefn; dc->desc = "ram framebuffer standalone device"; - dc->user_creatable = true; device_class_set_props(dc, ramfb_properties); } static const TypeInfo ramfb_info = { .name = TYPE_RAMFB_DEVICE, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(RAMFBStandaloneState), .class_init = ramfb_class_initfn, }; From patchwork Sat Jan 25 18:13:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950496 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92685C0218E for ; Sat, 25 Jan 2025 18:16:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkfv-0008Mi-Ut; Sat, 25 Jan 2025 13:14:32 -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 1tbkfk-0008EW-OU for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:21 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbkfj-0004Gj-70 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:20 -0500 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43690d4605dso20968885e9.0 for ; Sat, 25 Jan 2025 10:14:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828857; x=1738433657; 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=w1nS9BzjJB0tn/0Fa9F2b1T3lbd2oKgl5iwd0JMSerQ=; b=epudOJvkry3DP3vuXPUI1Gx6j9ZZuzMNSw/hYCX8weYBI4SWvyvoUGSSQ1n4Tm3You 2hTLaRpvuaojKn2gjuTLJtOf2pfCBvrTC4BjHozD31uGgYmgYL/XB+F76FWK4nnQOQOB UeidpPLLjPRY0aDNTcdVGHfPaelDOIRuhHFkeymL2zfQfLBb79hYhIra3CBN0wo6sNoI vMX2Rxn+bOUeJiz0Uav6bCy22KemTV6clFd5l5R3NWQR0ouOX7qkgh+WDR6Xco00ppNE tsdn1g9i1+pMgj6PmSAjqT0dTQLcpScshof6u1rf8IwbuISweA9gZ1jDjJZK2vPs/or5 tAqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828857; x=1738433657; 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=w1nS9BzjJB0tn/0Fa9F2b1T3lbd2oKgl5iwd0JMSerQ=; b=pRL/VYLMFYo266PFh7xy61tRrCBr/uPywXWmaeHlIjwsoYDw1WVDk6WqrJScfKt44V u76Hn/s8kUONqkYFTKceXBIW2FpvrilJcRQTbg/Q4JAU9k/py9Z/qyCcgOEd3gyra8xh jY+1NtXz0Zj07oqvncKFlXdkmoyor2Woh4ge2gs8F50wrXTkfpRZyM9YIGGNxCCus5T9 YwHdE/Cb6rN1QC0cCCUI11IXKVnNR7XDl1LJ7gZMBN2riLvbP3IwVisYI8QRbMBZnUYf 9V7m/Qb1uOkTZpwBVSKmQ1nBlc92eacuQCesNf9S9eMipzdj+SlKJOggRVXzZxxey0TJ UZgQ== X-Gm-Message-State: AOJu0YwmhAJxT9wxCeMzFJxCS08vp8uNMHM7UcU1gkilYzXwuU0roZ0Z wtFA+IWbB1Y88RjvbzKA3KndezEuoWZ0/+VkRzfphf5lOfmhKWVxNSkZQi8abDwEV4n0Lsb4Gxv Jy2M= X-Gm-Gg: ASbGncspGNGv1cljPs/qS6ZHLHiu2NgpWv0arenJHJandLzXJvc8qsbcOIa4Uvcdia6 rv3fbSwW+zAPRKSfL9JliNCx48axn8JwFva/4zKnTUQ6yAnqNLRZ4Xm70h2KFJBrnCdwRrHz5vQ 365TdSLMdEg3iaKbp7T7dwoBYYl7L1dntMte79MRv/rLJXCgXDOfCy8t9fI6wvYxH+6sAEcO8Kc 7XiCo1pfXEQmXNu9voLDIkNp5o9NXYMaIBtch5IfYJ46OpXT5VEFJRhnWBn42VYxcSIUsG9auOX hpw9PfoQnO2n/729WM8l1tFH1h+79ZhT5q8XTulTNXYXk79LJsGiH3tc/Oah X-Google-Smtp-Source: AGHT+IE5XUCSuHVVDMagGbiF8o/U1zOarBMIVGYFxMB07VQ6SArrPMMpgZuB4UE+b0bVMHzNNBLvMA== X-Received: by 2002:a7b:cc8f:0:b0:438:a214:52f4 with SMTP id 5b1f17b1804b1-438a2145332mr233337725e9.25.1737828857490; Sat, 25 Jan 2025 10:14:17 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd54c066sm67839795e9.29.2025.01.25.10.14.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 6/9] hw/i386: Have X86_IOMMU devices inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:40 +0100 Message-ID: <20250125181343.59151-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Do not explain why _X86_IOMMU devices are user_creatable, have them inherit TYPE_DYNAMIC_SYS_BUS_DEVICE, to explicit they can optionally be plugged on TYPE_PLATFORM_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Clément Mathieu--Drif --- hw/i386/amd_iommu.c | 2 -- hw/i386/intel_iommu.c | 2 -- hw/i386/x86-iommu.c | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c index 6b13ce894b1..e8e084c7cf8 100644 --- a/hw/i386/amd_iommu.c +++ b/hw/i386/amd_iommu.c @@ -1687,8 +1687,6 @@ static void amdvi_sysbus_class_init(ObjectClass *klass, void *data) dc->hotpluggable = false; dc_class->realize = amdvi_sysbus_realize; dc_class->int_remap = amdvi_int_remap; - /* Supported by the pc-q35-* machine types */ - dc->user_creatable = true; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc = "AMD IOMMU (AMD-Vi) DMA Remapping device"; device_class_set_props(dc, amdvi_properties); diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index f366c223d0e..7fde0603bfe 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -4871,8 +4871,6 @@ static void vtd_class_init(ObjectClass *klass, void *data) dc->hotpluggable = false; x86_class->realize = vtd_realize; x86_class->int_remap = vtd_int_remap; - /* Supported by the pc-q35-* machine types */ - dc->user_creatable = true; set_bit(DEVICE_CATEGORY_MISC, dc->categories); dc->desc = "Intel IOMMU (VT-d) DMA Remapping device"; } diff --git a/hw/i386/x86-iommu.c b/hw/i386/x86-iommu.c index fed34b2fcfa..5cdd165af0d 100644 --- a/hw/i386/x86-iommu.c +++ b/hw/i386/x86-iommu.c @@ -146,7 +146,7 @@ bool x86_iommu_ir_supported(X86IOMMUState *s) static const TypeInfo x86_iommu_info = { .name = TYPE_X86_IOMMU_DEVICE, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(X86IOMMUState), .class_init = x86_iommu_class_init, .class_size = sizeof(X86IOMMUClass), From patchwork Sat Jan 25 18:13:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04001C0218C for ; Sat, 25 Jan 2025 18:16:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkfv-0008Mw-V5; Sat, 25 Jan 2025 13:14:32 -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 1tbkfs-0008Js-94 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:29 -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 1tbkfq-0004HR-QD for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:28 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso20961315e9.0 for ; Sat, 25 Jan 2025 10:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828865; x=1738433665; 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=J6WqpNLLgPHFQ99I41LLhDNBlDQghx4mWgl59MS9KjI=; b=Vw1eS1UR/ixe6IVZ3f93cUh84KleEPEoYHy/09q+UTxHTrPu8GaqmLkTWIEzEdfcd3 KZ1uJ3GTCgIOS93c4T4ehsPzejz7XKmhtQz44/9gehDKkRq+ymDAXjq7hDUuMCWuvtZd ya8oKEx4q66kVgQaDAqH6g2/LbGaP0Og+HB+XZfEuKIBpGqwbw22z17iq3d3zWuOcPwB QJo/LXGF2EHNHla9wZW2JvdQKaKd+rbocNaaMbvOTBOefQp2pwYB7P/1TEaFoze9sn84 SzcvENoDWRpglxSyD45XDNIPdY3GbtbokaOcgJ9nII950Zum5w9iIGf5qiTIHPsFLZUq /p7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828865; x=1738433665; 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=J6WqpNLLgPHFQ99I41LLhDNBlDQghx4mWgl59MS9KjI=; b=pqgBATdfhVp4dWFAn+wOZOcbrbBXmSdMtxB+/jV3ugWhv8O9cKSv0ZzTo286VKeKGz BF0DrZ5S1xlwhMJLomJlUYaXcWp119Jk06ae+U632QRkj0Wuw5istnBv8EZJaeXX64TV w3tawkeGucrmpDFiq/4wkPIESZ4nMDrq9dfzfPRcuxoH3HJq+spQIxlGX+8NdB8md/V3 8ZH2h4AcLsAGi6MTJLjVKhUKYW/kqadkPxEJminnEsVvNlQsMTVAPNE1ebwl/nrZFOvF 2DoRydtRbaR5FQM8P32vciaShvviYIqlq9WLJstiN5g7Er/25+loHRLV1Pr18374pGDq fGaw== X-Gm-Message-State: AOJu0YwjsC44BkW/q4gnVQdYkzWYn6Ra6a44XxJ/PGMYrmVdxn04IKJq TFsgg3jcaLjaQehFxeIUx2n8xXvroM/ER1mH5fZskBMVEaisgx0iK8xQcK5AuovCwSTdoeGPa4m IWZE= X-Gm-Gg: ASbGncujwj8AZ3jzX715oHoyTDYlFK3xooDHYoqU9U4f402pL1uj+/KdLuKyiYjZQPq OPvOiAyYVwgqEGCiC4Bsc0vU4PvCGA8xF/FCIbN6ffCpXT/4mgS+Pp6pG0UMbO80cv76QeIFIL4 4ZzegV59eN3dm/phTU9JeF7R01ySaUalTm8SvU2o1r371HKJ/NDhlWo2eGjNfZ/o70aFh4YcQUC YBkm2F3u6smj/wyN6LYctogBIdfaTnK8rNv/vbd9Btab8f0o2bNILyVah40Y3SclDPEAK8JDTl9 qAV7wZwAmm2X7+iOCoJ5eTH3r82LUyft5g6Qbh8YQKpc/1RGFp/orYJZ1azT X-Google-Smtp-Source: AGHT+IHtukcUsuBgToag1rm73vPOv6PLwBxDIv19SmO8jk0VeznszQ2sl5L6woNkrDfICXUGMJC2jg== X-Received: by 2002:a05:600c:1f86:b0:436:faeb:2a1b with SMTP id 5b1f17b1804b1-438913db2cfmr312879235e9.13.1737828864896; Sat, 25 Jan 2025 10:14:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd4d29cesm69824895e9.35.2025.01.25.10.14.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 7/9] hw/net: Have eTSEC device inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:41 +0100 Message-ID: <20250125181343.59151-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Because the network eTSEC device can be optionally plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Clément Mathieu--Drif Tested-by: Bernhard Beschow Acked-by: Bernhard Beschow --- hw/net/fsl_etsec/etsec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 781b9003954..3ce4fa2662d 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -425,14 +425,12 @@ static void etsec_class_init(ObjectClass *klass, void *data) dc->realize = etsec_realize; device_class_set_legacy_reset(dc, etsec_reset); device_class_set_props(dc, etsec_properties); - /* Supported by ppce500 machine */ - dc->user_creatable = true; } static const TypeInfo etsec_types[] = { { .name = TYPE_ETSEC_COMMON, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(eTSEC), .class_init = etsec_class_init, .instance_init = etsec_instance_init, From patchwork Sat Jan 25 18:13:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 622EBC0218C for ; Sat, 25 Jan 2025 18:16:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkg0-0008Qy-22; Sat, 25 Jan 2025 13:14:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbkfx-0008Oz-ER for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14: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 1tbkfv-0004I9-VD for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:33 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso20247365e9.0 for ; Sat, 25 Jan 2025 10:14:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828870; x=1738433670; 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=OjNRCKPy/l7f95vUUTcVvrIiqVVOepFXrbHeokjkTeQ=; b=QEeGtKyTyaRXQyqMFPgl+hD7/VA2rBivdSHvJDNPW6gkOiJnBdoo7UvHJU6itwATKe pdPeP7vO47T7GSQZZjADcoHBGw20bmHfUxqf7pPgLs4rkS/RCK8b/TzGSiHA5muk8uDK R2YPCP3OXHO+hf1dNeygV1esnp/f273QLcMOWMz1TJ5KIfKMRWZWGc8DDjdO2csmcc5h GkIxlu+YgP2eeyQEWtuTbmCJqHeV3TLM7HHsRH2AVIhN4bYBDVwtJgAx2TiugvaILHnd 6UOLIfsS2inftG/DwMW5mR9p9PI717T6dcJMyitmwJjsowEq/Jr5tGJvTmIUaqnakYjD IBew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828870; x=1738433670; 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=OjNRCKPy/l7f95vUUTcVvrIiqVVOepFXrbHeokjkTeQ=; b=Z/ajJpte4xYBOYwzpzynMFHfLD+1FhxdWBF41ExxBpInkcslBESfyBCZct8xgP0Yme eXcV+Y05sPza+TdVj+00cv0O74ZDBBkqcEDFUCIW7Ku4qnJmUdX7KLRkXLgG39CSL+02 99Nlbe8MDXd8F/8Ia1oeyez6KGignLCXT8/Dj80oaNNOJnVdWaSP2oko8kt6RY3hoIqe qKmecJApu55V8v0G+A4+3+/FaTBSB4ejnOr+9ewNIw7IJlmvOr/7vw5HfPJMYLifiKPw deeLZC46ow3h3Ib1YtJIACWfBnkcYwtW1KyYRXUmyAmno0vS7btqtpBCh+EeFaJCAcuJ +GJw== X-Gm-Message-State: AOJu0YzsjVFuCAQy9VnjZ9JRukGmK8oV4PPO8Y5AoKKFStt7Lx1jSY+g HKBZsGocmvmxtTZVEAJRaq9yaPza2oJoGzsSfyDDVTqJR9FzSFCf4ho3dgEi9JJxIsHl4sx6HlG wvNI= X-Gm-Gg: ASbGncuFkhOfLOBdAKlcFgXyHbZAx50gEVeP1Bol9lXcELpR/UnpV5E3G9FgI676clX KPi7ZyEr7ZBF/Xj4ukihAEUrHAUgIegQfEgpheoIMAl6m/PoutIL6t/uhYfHKM2H3eCpiRyRHyj UkW5PcGC3r6HcwupuqRZ1+o4NLjYKOk9Rrb9sN91KimnSUSBRi7+mvYrKZcUkGgfvxpyDuF6jAg iAay2r/jqyPf77b9iJ5/RMfiM1bP1LW8w1GzB4ui8j5CwlqJtUChVwVncYe0tsXuGhPqKUcwxsq 380A2pKJmB9Ul6lWjY5RQNPBytqSd15nrYCKHtc7Ki7i/cPHEkXhbIVJavmL X-Google-Smtp-Source: AGHT+IGsW1rE0tr04FeKYA2KGXlK/mvTNA5dlL64lnJuwONXDJIce4w6YtcdzlGTbIKmz0lEq52uwg== X-Received: by 2002:a5d:4d83:0:b0:385:f195:2a8 with SMTP id ffacd0b85a97d-38bf566cd2emr22422454f8f.30.1737828870120; Sat, 25 Jan 2025 10:14:30 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176434sm6225313f8f.13.2025.01.25.10.14.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:29 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH 8/9] hw/tpm: Have TPM TIS sysbus device inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:42 +0100 Message-ID: <20250125181343.59151-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Because the TPM TIS sysbus device can be optionally plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Clément Mathieu--Drif Reviewed-by: Stefan Berger --- hw/tpm/tpm_tis_sysbus.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/tpm/tpm_tis_sysbus.c b/hw/tpm/tpm_tis_sysbus.c index ee0bfe9538e..4f187690a28 100644 --- a/hw/tpm/tpm_tis_sysbus.c +++ b/hw/tpm/tpm_tis_sysbus.c @@ -133,7 +133,6 @@ static void tpm_tis_sysbus_class_init(ObjectClass *klass, void *data) dc->vmsd = &vmstate_tpm_tis_sysbus; tc->model = TPM_MODEL_TPM_TIS; dc->realize = tpm_tis_sysbus_realizefn; - dc->user_creatable = true; device_class_set_legacy_reset(dc, tpm_tis_sysbus_reset); tc->request_completed = tpm_tis_sysbus_request_completed; tc->get_version = tpm_tis_sysbus_get_tpm_version; @@ -142,7 +141,7 @@ static void tpm_tis_sysbus_class_init(ObjectClass *klass, void *data) static const TypeInfo tpm_tis_sysbus_info = { .name = TYPE_TPM_TIS_SYSBUS, - .parent = TYPE_SYS_BUS_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .instance_size = sizeof(TPMStateSysBus), .instance_init = tpm_tis_sysbus_initfn, .class_init = tpm_tis_sysbus_class_init, From patchwork Sat Jan 25 18:13:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 177AAC0218D for ; Sat, 25 Jan 2025 18:16:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbkgK-0000HJ-3j; Sat, 25 Jan 2025 13:14:56 -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 1tbkg6-00006c-CG for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:46 -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 1tbkg1-0004Ip-DI for qemu-devel@nongnu.org; Sat, 25 Jan 2025 13:14:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so32105095e9.3 for ; Sat, 25 Jan 2025 10:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737828875; x=1738433675; 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=bl6x3NGb6owz3SHDZJmiiZ4r1za5TcxmylUs2G0w4SA=; b=ro4U20GmmVU2Vhqa43lZgUYnhXDQKpJxZ3nleuqP3lU6Aeh8c0AwatB1U9GEcH9NEC mswFz4j7kDRcVZxXDsTKl7qrjDkieop17+COSuDMIgTT7dO18zcz8hyUDLhPvvz1VPc9 raJX59mPtz2IsNjX4+pBABhfbANLPOQwrVBrd2x6B59/UYMdzw3g06Z6lLteVGiK/+HQ BlNIPnpJbfg2vhHVERz7tu5zH+at0eer76PqDQv9f3dVTO5I13l6kNLRpsMAEoUT0fPo yaJKwFRwUC3a5NqbRT0dA0IRg74YTG2JM0Xmfbe2SJ1BtH2d3n1BzCHNWkV4fy0zsS8n y6bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737828875; x=1738433675; 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=bl6x3NGb6owz3SHDZJmiiZ4r1za5TcxmylUs2G0w4SA=; b=kaL3SqoCnM+oiiXIVya3v5CGpQ8eoHc/1W67ShyOwx5t7xhPMgmdzL9Bwtgdwn61Gf RPihHQIVqA6GeV1mHTkDWxIgsLg6bhnjgneEf4wb37sW/Kz1l7wnkfuQUvrsKtNIUxWT r4rfWFTiHywmLMbXl2OKZivBKYFnC+AcmsEcVjPR3oge/FviS+GWOwcuT1gfO5SxhIs0 KKYVUajoTlUIXZCYDzIkdskQuorMV5Mmf6FsrgVSmgvOTRufKOv5UxcDBXnl6Moy3rPQ whpPMLjTnPWV1w86F5k33jiiKJWarGKsGwdLMZBcuKo5T20wi7j26TLQMY6ySTaMEX+x dXCg== X-Gm-Message-State: AOJu0Yz7bDND23DkFeM1ahbQxV/RyZNK5ptvokkjVu7LGA+iCHJJOPqM Sy/03infS9ZiI0IgnpRjIlNAfiIFUS4qcC0NilQQiybJERzM9gH5W+h2pDRXlbEpyrGzD6i7FWz US7w= X-Gm-Gg: ASbGncuYzY4u4JyCt2kR4ulqtWKoPVPmTL7SI1N3DTeDK6yx7oaJPeNvt+BesUFiV9N M+LPHgimKG5JhiVIj+WS9tga9A32NC7Xy3ctFm+aLtvhgOgpqwtjmIrFnIjDXLe377qgLIprAwl PZLxu71kqaYZgIvrtdUJEGyXplUYft/A7pN7idwuP945y0v4m1mS9E72htKqX8L6/qqJTfeQTLF EYU0CZi9HqbENmH+6C4nf3Sm6U+hHHqDVM5eCb2OhntOhujvrjIP6TXnCv/JpJVi3ddl0AE/7xM ZksjyJE/ZuPLiqeP4Ro0MOMERizYbfU62DcU2/mp3HxlYL2tmZdDGWzuJXnm X-Google-Smtp-Source: AGHT+IH6Im9WAFP62p+c65YcO9soXGrjbd4TGzQetbCmkepXX8mf8yxKvYvU59Qz1V1TA9WTvs42GQ== X-Received: by 2002:adf:f504:0:b0:385:ecdf:a30a with SMTP id ffacd0b85a97d-38bf57ab510mr28008868f8f.33.1737828875399; Sat, 25 Jan 2025 10:14:35 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176490sm6041968f8f.1.2025.01.25.10.14.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 10:14:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yi Liu , Markus Armbruster , Eduardo Habkost , Anthony PERARD , Gustavo Romero , Jason Wang , qemu-ppc@nongnu.org, "Michael S. Tsirkin" , Paolo Bonzini , Alexander Graf , Richard Henderson , Stefan Berger , Bernhard Beschow , Stefano Stabellini , Gerd Hoffmann , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , "Edgar E. Iglesias" , xen-devel@lists.xenproject.org, Marcel Apfelbaum , Alex Williamson , Paul Durrant , =?utf-8?q?Cl=C3=A9ment_Mathieu--Drif?= , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [RFC PATCH 9/9] hw/xen: Have legacy Xen backend inherit from DYNAMIC_SYS_BUS_DEVICE Date: Sat, 25 Jan 2025 19:13:43 +0100 Message-ID: <20250125181343.59151-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125181343.59151-1-philmd@linaro.org> References: <20250125181343.59151-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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Because the legacy Xen backend devices can optionally be plugged on the TYPE_PLATFORM_BUS_DEVICE, have it inherit TYPE_DYNAMIC_SYS_BUS_DEVICE. Remove the implicit TYPE_XENSYSDEV instance_size. Untested, but I'm surprised the legacy devices work because they had a broken instance size (QDev instead of Sysbus...), so accesses of XenLegacyDevice fields were overwritting sysbus ones. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/xen/xen_pvdev.h | 3 ++- hw/xen/xen-legacy-backend.c | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index 0c984440476..48950dc2b57 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -32,7 +32,8 @@ struct XenDevOps { }; struct XenLegacyDevice { - DeviceState qdev; + SysBusDevice parent_obj; + const char *type; int dom; int dev; diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 118c571b3a7..4d079e35d83 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -640,16 +640,14 @@ static void xendev_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); set_bit(DEVICE_CATEGORY_MISC, dc->categories); - /* xen-backend devices can be plugged/unplugged dynamically */ - dc->user_creatable = true; dc->bus_type = TYPE_XENSYSBUS; } static const TypeInfo xendev_type_info = { .name = TYPE_XENBACKEND, - .parent = TYPE_DEVICE, + .parent = TYPE_DYNAMIC_SYS_BUS_DEVICE, .class_init = xendev_class_init, - .instance_size = sizeof(struct XenLegacyDevice), + .instance_size = sizeof(XenLegacyDevice), }; static void xen_sysbus_class_init(ObjectClass *klass, void *data) @@ -672,7 +670,6 @@ static const TypeInfo xensysbus_info = { static const TypeInfo xensysdev_info = { .name = TYPE_XENSYSDEV, .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(SysBusDevice), }; static void xenbe_register_types(void)