From nobody Sun Nov 24 21:24:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1720000053; cv=none; d=zohomail.com; s=zohoarc; b=Doj7ZEx+LV+uQNCRP7aWsd1YsM5zUU/VspRyGqdNUAkBqn6pL1i/YeaQM0lAmGbtBLFl4lKZqNCgEVyRWdfURIEkdus7VgPK7LZKl4VEwzG69bKCyS3dVDVm2OxchzTb7L87d23oKhGiPo/ev+9Lp2cMpA4016ENWE0X8LvBscs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720000053; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OMzjbrD5jj50KPQ4550DmY4pJFHnqB7zUHTL7YZsoEU=; b=fu8XfO3rumVzlOilvtOFu5MCn6t/3JgCkR52cagt80/ctTfDziDaN8gIe4vwjE08graEmS3RZhGvCDhbqWUAX712GgjHXHOWIlA5GU9ovirCe0mE/AI2Q90MXYiOo1NWrllvbW57UdpB7+XHuwsFpq1+TcvKwPUlYIX/ob+aWSw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1720000053493766.126296435681; Wed, 3 Jul 2024 02:47:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOwZW-0004H2-4z; Wed, 03 Jul 2024 05:46:42 -0400 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 1sOwZU-0004GO-41 for qemu-devel@nongnu.org; Wed, 03 Jul 2024 05:46:40 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOwZS-0003el-Hm for qemu-devel@nongnu.org; Wed, 03 Jul 2024 05:46:39 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1fb1c918860so1766425ad.1 for ; Wed, 03 Jul 2024 02:46:36 -0700 (PDT) Received: from grind.dc1.ventanamicro.com ([179.193.8.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91d3bc5a1sm10278621a91.36.2024.07.03.02.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 02:46:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1719999995; x=1720604795; 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=OMzjbrD5jj50KPQ4550DmY4pJFHnqB7zUHTL7YZsoEU=; b=ATJyiv3oJNP7KCY3Q5uMtImbqw+4XGPoOc/PM8fQErQ+M9S+90qDuRA+tMvUK1BVoE 5QEJqbu+qt4n4HFx8ZWmRuKip0/bvA3YfSrD6+F93OFQi2gWhss5TqZSCt3stUYyt10F Vn0eoEDqaIZfYvDYsmsvb9w/+ZXQByW3okSA+bghMIXLNX0v8teFkd481eT8+2Uwaz5N 8fyvU3009iWdRO/uyxJRXStYV0C8amEMm6/x4uXt1vT4HnIQ4bW7lkJvnlx87Jp69rpb boxuCtBNvhYFkg7INhBXyA9MslXb/OHasiJMt0FHB8xylwtSl5g8ZVedZDowhziE+9Jq 4aIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719999995; x=1720604795; 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=OMzjbrD5jj50KPQ4550DmY4pJFHnqB7zUHTL7YZsoEU=; b=xPQnioAowXAf5OsM2U+GCaC28U31n6Rt0PEm5GJ9PCsIhr2UNljOyGqdliLF5w577q 9JjDqrGEv7CFeCQzloXXthILkvCBn9YoP2+ByNf/KLylOzz7QFQUojMJGstmq7J8WnHQ NWAH0AA9BHubso5o5yUSgeSbJy4/wVTUgmv5nBBbEPq6TqZyA67YAOBqg3w0gVKONEgv NvACrkfYLJBROtAZ9tXbhOHDVIdRW6PNnWAkaKlUMbWkHoUaB452JKVOHp7c11toqpQu YWIwsO7V1cNwnGYot90idVAtoAP+aU0sLAdYoAiMHSfIDG9pVjLqZw9VyKRk/1+pSsBn kvQw== X-Gm-Message-State: AOJu0YwkjeZBQhLLkDvbZDSMKbLXwxx9QTSCovhHhehN5eAk/EqVPKos 3vLRaQgNW/S6Y0PYlF5cU0kh1ZqJ09Vdbn/3JdLcEdT/ac5HQrWmB5qQe1SJzUTbZBCZLALjNlY / X-Google-Smtp-Source: AGHT+IHu5Iwcx1rpzty0nDjAWyHgVTVwFD1hM4n7HM8stpVecr/stO77C8njUl0q2qWf4OzFUErAEQ== X-Received: by 2002:a17:90b:1992:b0:2c8:2236:e2c3 with SMTP id 98e67ed59e1d1-2c97ad5d94dmr1981622a91.17.1719999995165; Wed, 03 Jul 2024 02:46:35 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, richard.henderson@linaro.org, berrange@redhat.com, eduardo@habkost.net, Daniel Henrique Barboza Subject: [PATCH 1/2] qdev: change qdev_prop_set_globals() to use Object* Date: Wed, 3 Jul 2024 06:46:25 -0300 Message-ID: <20240703094626.1704990-2-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703094626.1704990-1-dbarboza@ventanamicro.com> References: <20240703094626.1704990-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=dbarboza@ventanamicro.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1720000055104100005 Content-Type: text/plain; charset="utf-8" Next patch will add Accel globals support and will use qdev_prop_set_globals(). At this moment this function is hardwired to be used with DeviceState. dev->hotplugged is checked to determine if object_apply_global_props() will receive a NULL or an &error_fatal errp. Change qdev_prop_set_globals() to receive an Object and an errp. The logic using dev->hotplugged is moved to the caller, device_post_init(). Signed-off-by: Daniel Henrique Barboza --- hw/core/qdev-properties.c | 5 ++--- hw/core/qdev.c | 2 +- include/hw/qdev-properties.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 86a583574d..4867d7dd9e 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -920,10 +920,9 @@ int qdev_prop_check_globals(void) return ret; } =20 -void qdev_prop_set_globals(DeviceState *dev) +void qdev_prop_set_globals(Object *obj, Error **errp) { - object_apply_global_props(OBJECT(dev), global_props(), - dev->hotplugged ? NULL : &error_fatal); + object_apply_global_props(obj, global_props(), errp); } =20 /* --- 64bit unsigned int 'size' type --- */ diff --git a/hw/core/qdev.c b/hw/core/qdev.c index f3a996f57d..923f9ca74c 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -673,7 +673,7 @@ static void device_post_init(Object *obj) * precedence. */ object_apply_compat_props(obj); - qdev_prop_set_globals(DEVICE(obj)); + qdev_prop_set_globals(obj, DEVICE(obj)->hotplugged ? NULL : &error_fat= al); } =20 /* Unlink device from bus and free the structure. */ diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index 09aa04ca1e..a1737bf4d8 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -210,7 +210,7 @@ void qdev_prop_register_global(GlobalProperty *prop); const GlobalProperty *qdev_find_global_prop(Object *obj, const char *name); int qdev_prop_check_globals(void); -void qdev_prop_set_globals(DeviceState *dev); +void qdev_prop_set_globals(Object *obj, Error **errp); void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj, const char *name, const char *value); =20 --=20 2.45.2 From nobody Sun Nov 24 21:24:33 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1720000053; cv=none; d=zohomail.com; s=zohoarc; b=H/ftWE/3tZX92LtCSDncH/EfBl29EKIlFCDCtqVe2bx/4wxRcMI3o8rGCQt4m2pSI90XUZ6DeuiFXaYuw28/OgPAwHSb52IEiVmR8SUgssDeSGvSo3QblPxIpWvxYb6GCHv0BB3tOC+gA9IIQBxlTbkSZM+cbfMu8LB2i9xwAM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1720000053; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T0cvegh9dJHLx7AZgX8kwOuw/aZvQuYKLzTnaKSvZwM=; b=IkcX2jmKmEmSz+9zygVYJeL5Iow7I/Q8ERlZAgInHXmPatxRjDfyVDgHS6qhv6cBWm4vkLSyZRi+P8ZxDsrT987wrqbTcvjkgDhTH3oPAy6tt8eyuMhYEFT7b7bQQYxUYlcSVWYkudu8tXT4cEWnKr9XmwBllX+N6Ol+4bEzU3I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172000005333054.79369338274421; Wed, 3 Jul 2024 02:47:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOwZY-0004Hz-EU; Wed, 03 Jul 2024 05:46:44 -0400 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 1sOwZW-0004HB-5n for qemu-devel@nongnu.org; Wed, 03 Jul 2024 05:46:42 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sOwZU-0003fB-3g for qemu-devel@nongnu.org; Wed, 03 Jul 2024 05:46:41 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2c98660fc91so34116a91.1 for ; Wed, 03 Jul 2024 02:46:39 -0700 (PDT) Received: from grind.dc1.ventanamicro.com ([179.193.8.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91d3bc5a1sm10278621a91.36.2024.07.03.02.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jul 2024 02:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1719999998; x=1720604798; 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=T0cvegh9dJHLx7AZgX8kwOuw/aZvQuYKLzTnaKSvZwM=; b=kOrx2kfPWde9ANQOJNVx9gkcYM0yrS6pS2v8ZLOG7LtTHPlMeC19sAa4G8wo4rfUlr fvKHKoasK8wSZOnH/mjTJ/QBzrVTava5g8j6av+o+1cZA8cygtrUTtnAQdZLTIT2jzGQ DlmQTWu09euo6x+D4Cll2Jrnj41O4rQg3ug4v/4OdWz1cjoMGZT5AFQYckGLbG0tnK5K YA+86eikhOUwqtqdjF36WamuCI82INXTGcRivTWeQFR9UtvBp3gxzqj2EC7QTLHuwfC5 IMC/EPzQ9HxMM67/XklcMAAMDKuG+Zk+Az5A0YW0kOllFdXwi4jB9irR7C9vVo6Y0ufl hpyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719999998; x=1720604798; 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=T0cvegh9dJHLx7AZgX8kwOuw/aZvQuYKLzTnaKSvZwM=; b=Uls24beaFYv1goBkvQVFElTm0/FSxaCzVizKYi5Vc1X/KsS5c6TYGrCv0WI97km7Cn s+Kd99wxlpJIoRI/4lRZtioqWQ78dx/kDJwBa0pwZgOb4Www7yE2L4Vqbrhxpvs8rwSq yxHSw44/O+pJk2xp8OPZHcvn9t9vD44Yp+wmSmWdX5rzAKI44xefAoXr+lhmzOzexXSf j2qptAY/UaBmRJ0mmG0vuV0zeImdPel1+sjRryB740wtACe6n3p/h2Vgt8FKy/TdDwrJ myeEXlU+1OIWkhJdgZnzrUtK67e67tPIcNZgBrjAUz8tXWkSc1bSLHM5kNJpssUs6juw 9T8w== X-Gm-Message-State: AOJu0YyLMMrWuV7gWrLs+L7aesMXhIbgN8ZTUWK0vx80W8+1fdCzViaG abXCaDiM9qlvWXHlSGhgNfql1bRfGFeC8yuKKDWIM8M5aGjQnCujC5F/iOL/Alfo6tBgKF8Xd2D k X-Google-Smtp-Source: AGHT+IE3Hkwyh7IHQSR/56ceTw6IWQ8MUUwpxAvahjzBiGrJF3h/E7CD1jO63XIATv6xAu9TkuHytQ== X-Received: by 2002:a17:90b:1fcf:b0:2c8:b576:2b7e with SMTP id 98e67ed59e1d1-2c93d771fa4mr6266340a91.46.1719999997903; Wed, 03 Jul 2024 02:46:37 -0700 (PDT) From: Daniel Henrique Barboza To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, richard.henderson@linaro.org, berrange@redhat.com, eduardo@habkost.net, Daniel Henrique Barboza , Andrew Jones Subject: [PATCH 2/2] qdev, accel-system: add support to Accel globals Date: Wed, 3 Jul 2024 06:46:26 -0300 Message-ID: <20240703094626.1704990-3-dbarboza@ventanamicro.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703094626.1704990-1-dbarboza@ventanamicro.com> References: <20240703094626.1704990-1-dbarboza@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=dbarboza@ventanamicro.com; helo=mail-pj1-x1036.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @ventanamicro.com) X-ZM-MESSAGEID: 1720000055066100003 Content-Type: text/plain; charset="utf-8" We're not honouring KVM options that are provided by any -accel option aside from the first. In this example: qemu-system-riscv64 -accel kvm,riscv-aia=3Demul (...) \ -accel kvm,riscv-aia=3Dhwaccel 'riscv-aia' will be set to 'emul', ignoring the last occurrence of the option that set 'riscv-aia' to 'hwaccel'. A failed attempt to solve this issue by setting 'merge_lists' can be found in [1]. A different approach was suggested in [2]: enable global properties for accelerators. This allows an user to override any accel setting by using '-global' and we won't need to change how '-accel' opts are handled. This is done by calling qdev_prop_set_globals() in accel_init_machine(). As done in device_post_init(), user's global props take precedence over compat props so qdev_prop_set_globals() is called after object_set_accelerator_compat_props(). qdev_prop_check_globals() is then changed to recognize TYPE_ACCEL globals as valid. Re-using the fore-mentioned example we'll be able to set riscv-aia=3Dhwaccel by doing the following: qemu-system-riscv64 -accel kvm,riscv-aia=3Demul (...) \ -global kvm-accel.riscv-aia=3Dhwaccel [1] https://lore.kernel.org/qemu-devel/20240701133038.1489043-1-dbarboza@ve= ntanamicro.com/ [2] https://lore.kernel.org/qemu-devel/CABgObfbVJkCdpHV2uA7LGTbYEaoaizrbeG0= vNo_T1ua5b=3Djq7Q@mail.gmail.com/ Reported-by: Andrew Jones Suggested-by: Paolo Bonzini Signed-off-by: Daniel Henrique Barboza --- accel/accel-system.c | 3 +++ hw/core/qdev-properties.c | 34 +++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/accel/accel-system.c b/accel/accel-system.c index f6c947dd82..40c73ec62f 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -29,6 +29,8 @@ #include "sysemu/cpus.h" #include "qemu/error-report.h" #include "accel-system.h" +#include "qapi/error.h" +#include "hw/qdev-properties.h" =20 int accel_init_machine(AccelState *accel, MachineState *ms) { @@ -43,6 +45,7 @@ int accel_init_machine(AccelState *accel, MachineState *m= s) object_unref(OBJECT(accel)); } else { object_set_accelerator_compat_props(acc->compat_props); + qdev_prop_set_globals(OBJECT(accel), &error_fatal); } return ret; } diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index 4867d7dd9e..462a8f96e0 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -10,6 +10,7 @@ #include "qemu/cutils.h" #include "qdev-prop-internal.h" #include "qom/qom-qobject.h" +#include "qemu/accel.h" =20 void qdev_prop_set_after_realize(DeviceState *dev, const char *name, Error **errp) @@ -894,27 +895,38 @@ int qdev_prop_check_globals(void) =20 for (i =3D 0; i < global_props()->len; i++) { GlobalProperty *prop; - ObjectClass *oc; + ObjectClass *globalc, *oc; DeviceClass *dc; =20 prop =3D g_ptr_array_index(global_props(), i); if (prop->used) { continue; } - oc =3D object_class_by_name(prop->driver); - oc =3D object_class_dynamic_cast(oc, TYPE_DEVICE); - if (!oc) { - warn_report("global %s.%s has invalid class name", - prop->driver, prop->property); - ret =3D 1; + globalc =3D object_class_by_name(prop->driver); + oc =3D object_class_dynamic_cast(globalc, TYPE_DEVICE); + if (oc) { + dc =3D DEVICE_CLASS(oc); + if (!dc->hotpluggable && !prop->used) { + warn_report("global %s.%s=3D%s not used", + prop->driver, prop->property, prop->value); + ret =3D 1; + } continue; } - dc =3D DEVICE_CLASS(oc); - if (!dc->hotpluggable && !prop->used) { + + /* + * At this point is either an accelerator global that is + * unused or an invalid global. Both set ret =3D 1. + */ + ret =3D 1; + + oc =3D object_class_dynamic_cast(globalc, TYPE_ACCEL); + if (oc) { warn_report("global %s.%s=3D%s not used", prop->driver, prop->property, prop->value); - ret =3D 1; - continue; + } else { + warn_report("global %s.%s has invalid class name", + prop->driver, prop->property); } } return ret; --=20 2.45.2