From nobody Sat Sep 26 21:35:44 2026 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; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1788476637; cv=none; d=zohomail.com; s=zohoarc; b=jda7U7O427+nqQl7cVQlEW2WSkuI13feI0F4AMYqvDBAolHF/p4cz5Hp5kUvv45aQ+hQoFMjjNLgtVX897HtZpm60Xtk+QO1LhHy0neqCFcX8m/sON3z+0xe4RUObtKJ9XZPJBqcl2V9cUdOg2cVywTIEPFgB+z12I2xbk3bPWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788476637; h=Content-Type: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=r1OwSg1HRToBDVGhaiCArpI8Iu8ERKzy1a7FmRB4Y+Y=; b=BrKZ9zjm0P9RGrYS2zbr/MQWjqH7jpL1WM7jXcbjoGKE78a+OnZEN3sTlOHRRbS1gub5vSCG5SlIJIHGdFY6LLOdNd6yRl8KtJ62WUnZZWGXJj8vqkxAKRcHd302iuQNFTUE+SmhJsTF1Vk7czuoBK//Vl0V17EtfhC3vWGudW4= 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1788476637195310.12717738735; Thu, 3 Sep 2026 16:03:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2GSX-0006UF-Vt; Thu, 03 Sep 2026 19:03:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSW-0006Tw-9K for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:04 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSU-00035Z-MR for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:04 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 683JgUx11452484 for ; Thu, 3 Sep 2026 23:03:01 GMT Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gfdyxh48n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Sep 2026 23:03:01 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-92e4f946461so71750085a.2 for ; Thu, 03 Sep 2026 16:03:01 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cee6023edsm104238135e9.7.2026.09.03.16.02.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Sep 2026 16:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= r1OwSg1HRToBDVGhaiCArpI8Iu8ERKzy1a7FmRB4Y+Y=; b=ZeMfg3Bp3K03AIoK ODhWyezZwuQUrHLiN8nLAZQ8jMxldfTJir99SmS0V1bKknBnlpsW+p1wjbdgL7Vr mWL4RaEGk0PJzzpKl0CMMY0ECwlpe3BYAlgR1rcU6rIkqwwmoM3FBxmljHtB8vQp FO/8LUDNfWGibOkpVmMOFOVZ7VAI0uVGuJMTHy6o6/2fFUBG+Hhi9uExe+cguaCs SPJDP67x91oWpww9jIpS/fv0iQISiRXTLpJqm7q7hxUlJRHbQuajAgdhElLLxtoj gsT5NOOoAUwyBskin/C4p32mxflRmwzXiZPgPfgWi5WjeHimsSQI1/PZ1K6tk267 EkvoCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788476580; x=1789081380; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=r1OwSg1HRToBDVGhaiCArpI8Iu8ERKzy1a7FmRB4Y+Y=; b=BqISELurepMusBLGbNmjl3SErcdSNh1nIVedGbGp6BEWii3PgNVATDIaxwb0g3nDNL /stHSoG/NQDxHnAmMiQFWpN5ADafQ4cs4koyUiOdELdFnEiARrPBny6WXybGzG0S9wvQ ZjRVHVu8xH++BBUnAIb1PE/dSaKk1ZrhJneCKOAg0/+qibWAHmmcKIttxWI7fMBP33yQ vLsJj9f1nW9Ad/V0uKHiYBc0zN6uhY8U5xqzNqfbK6sB4jq55ZEyTY2UaOaNa/x67XiS 6WivHwtf9Gsy4dtWs6MXHcVaJ7tl9dxJF+AazfOOYxAt4yP3qZVGU/QJ606PAwadEfSe YNsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788476580; x=1789081380; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=r1OwSg1HRToBDVGhaiCArpI8Iu8ERKzy1a7FmRB4Y+Y=; b=Z43ix8p5QByvi2hdI2pvEN+jpjIX5AUwb2dC69skPLhZ+7YCFsvwgx/a2Bg8hU2JDk uGdvS0YK9xeNKTSdLIifqzB/7uBmiav/jfA4L8+LQK0ya0ff1K3jBSxYjmky0ltH4YTr r8lwU3GRn1AJ/dFP8uC7tSELq8jfATiP9ok4Hmsk2ku0IzkCtl9NJCcw141C146lXM6m Zu2cm/twLjbboDp/T7Nl5XDzCP/pOECRJQIISlzGym9GWcPjW4EIrP/WvRkJ8DxtSSW6 s8JW3wAGI/YPopGXmhwcHT7xQFScTAaWws27y8phfRkJpN18ebv8wjHnx0mkEBw7Us7o 4JJQ== X-Gm-Message-State: AFuF++k56mUcrl9Rmk6iLhi7f3J8BYx64nZARj1R5461ZW/l6knrlpr0 /jNTGvf03/x7THJOKNV4XG8Z61AR9c2BK59CTF6ddsTzBjzlzqIEiej0/8yygZ31IbHJJRSCK3L hdqQa+LZ6pIUaVyNvMtOGJ5jXJ6JEXCgY4tIlq0JM3uydY8Nz94RR+++z9cpQM8WsOQ== X-Gm-Gg: AYBFou07WcwbYCzjO+x9ryVP/D0GoSKkSf5dbd9TXexWYiYwCuO6eyNN1ZsfpjLN8iv rYPUrbixkW3a+5KHSBk2meGq9F6BNOKpGp2bykqo/e3ailva3JZ4K9/6iHXX+DIQXRlALs/YRsc 43UMWVShb/8UCjhcsDXlzXKBOyC5PYM2w9a4RMQr5FPrVwKzcydH0c7pmf32LWcHXpVKvusexZz YeGKRbHCe//4Ui7/K6uSHy6juTt76Lx4URF0vPEJ06/veGpc8+FPMKsByrFpD2SX2etyc8DFCPD BwSn/3lIlatITWQ694ITSn48PgADD9/khFR7NOzSblSeq/vFXSG40c02c92IQngwDTaSc61j+CE /l27D4PrLlzXuWvsTn7BIXaYmZEJCRUFu8WMzv2qP X-Received: by 2002:a05:620a:1371:b0:939:1c1e:b79c with SMTP id af79cd13be357-939804441cdmr193317485a.26.1788476580246; Thu, 03 Sep 2026 16:03:00 -0700 (PDT) X-Received: by 2002:a05:620a:1371:b0:939:1c1e:b79c with SMTP id af79cd13be357-939804441cdmr193261585a.26.1788476575027; Thu, 03 Sep 2026 16:02:55 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S . Tsirkin" , Ani Sinha , Igor Mammedov Subject: [PATCH 1/4] hw/acpi: Make AcpiGedState const in build_ged_aml() Date: Fri, 4 Sep 2026 01:02:42 +0200 Message-ID: <20260903230245.65601-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260903230245.65601-1-philmd@oss.qualcomm.com> References: <20260903230245.65601-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: fhIrDkx27rtw3-aPacH_xAlUvxkSOe7l X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfX5CBF63hNiQRo /GL4Mmd1cQiu1kw8gUgHfO96sEmMEoS0QQ4eFHHILE41wbuxriNnJ7wCveFnmPYyLpF89oUfNhF EdCIWBglGFkSgEJRkHj3b/OmbupnFrg= X-Proofpoint-GUID: fhIrDkx27rtw3-aPacH_xAlUvxkSOe7l X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfX2OfHN9mBAIWa fJgezXU9A1gDKeIUB/RClQ0So066H43Vevx5AYeGEBNOd3PusZDRqFyJkQFvklfups7svzVF28A GvJzoQkpU57SKtBTSP/IipYXKpWcpbSpAP7P7aIPPxAR3Jq1x1Hkcuvi6FJSXKe89c0VTcJTVXD YGFGGhtKbGFAxkxW3eaKJXTY4ffaeDQKeXl5/AUGqym2bhZgZCjcQM8KsKA50DGkz/2GAgKujtS CAQ38sLCqXRnIsPyzDZoZEkP1eLllDx+Uy/DTIwsCxijhpk8fvxhuTeN7QN55cL2rNC+RMeCIBu yDyOW3T+O0s5UQtCa4LpYyGAyddQ/d30Ssla5pRi7tsPI0XizSaen1z6cKy6H+nuv/dl8MvX35b rMRpJ/f6TkjofdQqawiggEHFZKij5NUjHgGbqFMGCbYeSur3PpIh+ObUbnY989ixM5zBjlzmmoZ SdyB5TzrzzwU6e7i03w== X-Authority-Analysis: v=2.4 cv=X9Zi7mTe c=1 sm=1 tr=0 ts=6a99fca5 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=AgXWHBCjbjcJ53z-AVsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-03_06,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030202 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1788476639249158500 build_ged_aml() do not modify the AcpiGedState structure. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/generic_event_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 67c9e9b3e82..5225e325132 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -48,7 +48,7 @@ static const uint32_t ged_supported_events[] =3D { void build_ged_aml(Aml *table, const char *name, HotplugHandler *hotplug_d= ev, uint32_t ged_irq, AmlRegionSpace rs, hwaddr ged_base) { - AcpiGedState *s =3D ACPI_GED(hotplug_dev); + const AcpiGedState *s =3D ACPI_GED(hotplug_dev); Aml *crs =3D aml_resource_template(); Aml *evt, *field; Aml *dev =3D aml_device("%s", name); --=20 2.53.0 From nobody Sat Sep 26 21:35:44 2026 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; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1788476623; cv=none; d=zohomail.com; s=zohoarc; b=elm9KTiIEUmsKlJ/A+kK8eCp6Mw9y4hytgZHacq+9oA5F+F6zSnqTSqTIi3IJhCaznUvc4KasMYIF4lckCBlw0ONtbvfdEh724TmwwUZM+GwWdgaW5pjDiKGhF45IThMZEWoeScaBaMJTpM4x0PuAdX5WWniBIA7m66uOoesYLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788476623; h=Content-Type: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=3MPFKXf4YignzYvD3Y/Ro//GDCgsEdMkXUvpHh7r+ps=; b=Dh3INuzJmqj7rV9RQz3y6Wodi9Kwo3sY5SuYmn4/ZndzXuQBu0NFZOHMRdcYI5fDOjzyWF/oergTRfvwGQ99JwhPV0x4ygZIqSCwGpb1DSBQfXKnBsqFQUHBx+FnHzLS8RJ+jqvbvGPvR+zqSuF1znNRkPkYr6toSSyMbGWND6g= 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178847662385375.77091716713846; Thu, 3 Sep 2026 16:03:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2GSb-0006VS-8N; Thu, 03 Sep 2026 19:03:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSZ-0006Uc-0u for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:07 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSX-00035q-9r for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:06 -0400 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 683Jgtce1692613 for ; Thu, 3 Sep 2026 23:03:04 GMT Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gf6p73ckf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Sep 2026 23:03:04 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-78350646d7eso1257017137.1 for ; Thu, 03 Sep 2026 16:03:04 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cee60d9c6sm108296875e9.11.2026.09.03.16.03.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Sep 2026 16:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 3MPFKXf4YignzYvD3Y/Ro//GDCgsEdMkXUvpHh7r+ps=; b=ezVJB0Hyd/ilybaI g7ewAKAganOK6ZH8ub5KCS9mNdolQwEIAPM85Z48MM2XSrp0Oh5Fl1XbJjzHJE0v MBUszwZPJVGYdM9AwOVlwTYDWjyrjCo3N1BJpPaV0KtoSlPIODkLWpReL+Gbr299 JjZvgeDgOs6zITtyvpwagv6Tm9SmnZJ5nbg7BIJi+zUE9LGygi+XBpPaVqGv5FcS NUFENTYOfb47QeErcX14QLNIS+ejihdm3+yjA0yRfnJ74nKXQ5wbG1Oo5/pHS54f ZgdwMZ+Hla2Vudc2AcKQTPsF60B2ZMVdaAOK8IuEN2RR3RpLWMwCNLfRV5WZ5M+6 sqsi0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788476583; x=1789081383; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3MPFKXf4YignzYvD3Y/Ro//GDCgsEdMkXUvpHh7r+ps=; b=b824s9PfyHNRP2y1tF188l/IdWr0XMmUapuUusXYrvwVkGmezSxwlzr2w1PImu3wnn PTTjet+/kBzk+NAtaOt1r/Px3+VnV0Ye0KBI/jmYuIneneR684p3CmVZkiBFaRYYhThb 8gUXdMNxeHELgiqufo2qK05JSlyV0CU7PcCCIDfAxWDP+DsaCG/wWtRR5rQGNOb9yesC hg0K9pPZdyVLTm9sVkODHKxgdOLvPAxtCZORmdgE0srUp1p7qTcSumFUFfpRVnx1/TSr hYsfom3zEJY2246lqgyQw+MrvYXFZ3UinQRB1M0pzOrhETAfFj7QarplK/JkBZQGcV9R T8kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788476583; x=1789081383; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3MPFKXf4YignzYvD3Y/Ro//GDCgsEdMkXUvpHh7r+ps=; b=clK7yg5udtBQoWNjEZeb3ZSxk8AQEyNC2BfjcBBVTA0xJG8GenSgwhVTN4UHGr2gu7 fAkVj4nBzit0ImbGPl6eEOVZdHU+UyxwTG1gAxgO2ue0MffhtU58qwpg3BlGF75JQxnH ClJQr3DWxCzSbOVsOPeQ0sR8oKJeooZRfXWtTkCiBGe11/0FaY+fggEstlO/zzJp4MY3 mm5zEU2ehhp6F759ri+CW/I1h3hK2lIqcPKteEptLgv158WbgXqmryqyz3zzYKOhLVqZ ydMPIKEvsLnVFh/5cPYPNy3/gddHHqbjO2bur1c08EfwqJKzAqYnehFmkm7QZwk6zqIf t/ZA== X-Gm-Message-State: AFuF++nNJeyWiB9QzugwTf+aU9lkP/pXVBua13QBCVLXfFav5RIjPMWs IxHFVIvxF8cxS6Stb3giqicmivEVJc8PQedrUypXvo+TkzzSUidO+FKrdDtosL0MSPriDeqEbMe tFsImSpuWs40vsFtEVVTh9mlmR4OhZ8bGSW4hgRguO81snoapbbZslHLS2EfW13BhgQ== X-Gm-Gg: AYBFou1BKzlL+noVcUXePSXHOXSs2Zyh2JLUDuqe/iL7srtytGtv/OvVxHLwWHjvbx6 Kk+HhU/9RpwbJZDeV7Q5CsktmurZi82mEaE8nU1OPBE1RW5+2gl6khC3SXma1q/Mdj4vbXHUyoK 7uilUX8Vov1v9cfJU3LIOwMOHydgrIYgnuG9Y2JrYuBmR16rMbp2cwIRyE7so3T8hhCLZekAmU4 UTAlJZdyM+qTSx1JFV4dchc/38t4MktKChCA1IR/326Jmf8MgpLZCf0qQMeZ1GVV5M3K6UyIRbg WJcZSI8dfGDNeYUb9GDQM8aEJbhkuhIYARnNDKHdpP3mbPxh1QEyyUDclDHEDSda+A/lnvvNFNb 8Or6LEtKqeeok2b/MPkq++p0t4j41O7hDaHuZ69vB X-Received: by 2002:a05:6102:cb:b0:784:a925:3f0c with SMTP id ada2fe7eead31-78a2ea9acfcmr1818162137.0.1788476583374; Thu, 03 Sep 2026 16:03:03 -0700 (PDT) X-Received: by 2002:a05:6102:cb:b0:784:a925:3f0c with SMTP id ada2fe7eead31-78a2ea9acfcmr1818152137.0.1788476582948; Thu, 03 Sep 2026 16:03:02 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S . Tsirkin" , Ani Sinha , Igor Mammedov Subject: [PATCH 2/4] hw/hotplug: Mark various HotplugHandlerClass variables as const Date: Fri, 4 Sep 2026 01:02:43 +0200 Message-ID: <20260903230245.65601-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260903230245.65601-1-philmd@oss.qualcomm.com> References: <20260903230245.65601-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: B_nRzovh1C6buK16LeOyQtOBGeLU-oiU X-Proofpoint-ORIG-GUID: B_nRzovh1C6buK16LeOyQtOBGeLU-oiU X-Authority-Analysis: v=2.4 cv=OZyoyBTY c=1 sm=1 tr=0 ts=6a99fca8 cx=c_pps a=P2rfLEam3zuxRRdjJWA2cw==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=kHeIkJ-FKRoZ7ECofzEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfX2ph0yv7CKEG9 RrXgmyY0jNklajGecTKlDp32GDmXtA4kYpmFMw+DJePTXG/U8xChwSDHTro9/CLE5IWdD/cCppD Pzj8iYN/Y5Z6rESIS6xs1wmDRZXAFok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfXwAGhbKmhrlcq bteiPJriqX4gM+gt9+8423xzgSMlL8Z48IFvamaAJ05DYoEdSUdb5dnQerinI1saY18j/6Fx63w QbluQ5feyUmUzRO8/6Kicv5B/0WUoXyG13iaNeth2VYCrmmMivpl5VR4TC+BLX2Ty/jxPMFecu/ LlYIYm7oGPIcgdNwRMEi3JXZvwdtqkCtEgDq6h8M6mwTooii6ZDO2+ESOcgYpnUeJ4x5fYAkI6U aKjnKOvn/lWvBvSt1fCwRizicpCgckiNS+PYR0t/UQlQYyIGMKgjRqwJ9aEGOP74owCopFeTChE ccYjaTe+QGJ4JnnxW9vUDG66TjukiJ7n4Cz/tc8uXtR1IL3aGrNO3LKgPuiqQtzSlptbOH3fwZ5 qrZcxvu3+T/wLlflifisoY4JmFWJSdpPPUp97xjOvb6QUjnikxkeZUDHnPyoW/7XezH/Qlvd65V VkUu9jrNI+/9G4N7e1A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-03_06,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 impostorscore=0 clxscore=1015 malwarescore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030202 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1788476625241158500 The HotplugHandlerClass pointers are only dereferenced, not updated. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/qdev.h | 2 +- hw/core/hotplug.c | 8 ++++---- hw/s390x/virtio-ccw-md.c | 2 +- hw/virtio/virtio-md-pci.c | 2 +- system/qdev-monitor.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index f054a214fc6..e4cb027ab3a 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -1069,7 +1069,7 @@ static inline bool qbus_is_hotpluggable(BusState *bus) bool ret =3D !!plug_handler; =20 if (plug_handler) { - HotplugHandlerClass *hdc; + const HotplugHandlerClass *hdc; =20 hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_handler); if (hdc->is_hotpluggable_bus) { diff --git a/hw/core/hotplug.c b/hw/core/hotplug.c index 68aabad8ae0..00e80a67c80 100644 --- a/hw/core/hotplug.c +++ b/hw/core/hotplug.c @@ -17,7 +17,7 @@ void hotplug_handler_pre_plug(HotplugHandler *plug_handle= r, DeviceState *plugged_dev, Error **errp) { - HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_handler); + const HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_hand= ler); =20 if (hdc->pre_plug) { hdc->pre_plug(plug_handler, plugged_dev, errp); @@ -28,7 +28,7 @@ void hotplug_handler_plug(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { - HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_handler); + const HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_hand= ler); =20 if (hdc->plug) { hdc->plug(plug_handler, plugged_dev, errp); @@ -39,7 +39,7 @@ void hotplug_handler_unplug_request(HotplugHandler *plug_= handler, DeviceState *plugged_dev, Error **errp) { - HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_handler); + const HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_hand= ler); =20 if (hdc->unplug_request) { hdc->unplug_request(plug_handler, plugged_dev, errp); @@ -50,7 +50,7 @@ void hotplug_handler_unplug(HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { - HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_handler); + const HotplugHandlerClass *hdc =3D HOTPLUG_HANDLER_GET_CLASS(plug_hand= ler); =20 if (hdc->unplug) { hdc->unplug(plug_handler, plugged_dev, errp); diff --git a/hw/s390x/virtio-ccw-md.c b/hw/s390x/virtio-ccw-md.c index 0370f584505..0b18b49bc48 100644 --- a/hw/s390x/virtio-ccw-md.c +++ b/hw/s390x/virtio-ccw-md.c @@ -73,7 +73,7 @@ void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, Machi= neState *ms, VirtIOMDCcwClass *vmdc =3D VIRTIO_MD_CCW_GET_CLASS(vmd); DeviceState *dev =3D DEVICE(vmd); HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); - HotplugHandlerClass *hdc; + const HotplugHandlerClass *hdc; Error *local_err =3D NULL; =20 if (!vmdc->unplug_request_check) { diff --git a/hw/virtio/virtio-md-pci.c b/hw/virtio/virtio-md-pci.c index 9278b32cf84..aa5b11c0f60 100644 --- a/hw/virtio/virtio-md-pci.c +++ b/hw/virtio/virtio-md-pci.c @@ -72,7 +72,7 @@ void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, Machi= neState *ms, VirtIOMDPCIClass *vmdc =3D VIRTIO_MD_PCI_GET_CLASS(vmd); DeviceState *dev =3D DEVICE(vmd); HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); - HotplugHandlerClass *hdc; + const HotplugHandlerClass *hdc; Error *local_err =3D NULL; =20 if (!vmdc->unplug_request_check) { diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 5c87fda5093..0c5502d45b6 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -918,7 +918,7 @@ static DeviceState *find_device_state(const char *id, b= ool use_generic_error, void qdev_unplug(DeviceState *dev, Error **errp) { HotplugHandler *hotplug_ctrl; - HotplugHandlerClass *hdc; + const HotplugHandlerClass *hdc; Error *local_err =3D NULL; =20 if (!qdev_hotunplug_allowed(dev, errp)) { --=20 2.53.0 From nobody Sat Sep 26 21:35:44 2026 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; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1788476638; cv=none; d=zohomail.com; s=zohoarc; b=NWm/KhveyULLarw8l+30a+Q8zn/hpg+DtKznBPs/Bf3cayjR2Ks3edVX1U4wzEsg4CgMFkawO24jy0ke86bnm70TVgnvFXdOCy0OC6ATCQMZESG8dGxECUhypYeBlWhJin1wqpJaEDiOz9ykUlAxdzWE92jHH0Y/TrH4Znk0SgE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788476638; h=Content-Type: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=LVlONWyZmSBVJCAo0Rf30qLhQUlyuXkPBBqtG7R9M3I=; b=XZsblEIUv1Yjj+Fd9g+GpCLg3pHgFNZO54dmi7a7XrXrzPeeMvaycAbDwrqqabHUyIP8OwlIi7mx0shB6H2Qq7fnXKNqiZQFhEx02Y/7nWx80lUelZ9HmiT8Kgi08Ll22DKM8zJjBtEBdi476D+03WUzqBtR5W7D1/hdQd1s7pg= 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 178847663835625.281759329181227; Thu, 3 Sep 2026 16:03:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2GSl-0006WR-AJ; Thu, 03 Sep 2026 19:03:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSh-0006W1-Bz for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:15 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSf-00036O-Gu for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:14 -0400 Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 683JgAK61451454 for ; Thu, 3 Sep 2026 23:03:12 GMT Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gfdyxh49n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Sep 2026 23:03:12 +0000 (GMT) Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-5c7a3b3c06bso109793e0c.2 for ; Thu, 03 Sep 2026 16:03:12 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cee6023edsm104256555e9.7.2026.09.03.16.03.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Sep 2026 16:03:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LVlONWyZmSBVJCAo0Rf30qLhQUlyuXkPBBqtG7R9M3I=; b=MvDDfSBSM5L7YYSJ 6TguggQKBddZxgTH5zPezFGf45uCABls5TL16BXQThW58a/uMVvYQaONYpcL2mF7 yZF5kVdl2dd+WgB+ZCBCcktbAtuGsQ5kjz/6SyXlXuB25Ouj9B2/2uBP/4rM2S2v dgk41lrv0/pMyQcsdoGfOF12dG99/GrzFr6z5JMvXBtgJnbII5aRIzzrzeEZvgbP iYB74yEtodBN4QSkJfcZRjpNIBU/pE2DsKv0VtXrOWIIFWzlt4XXVh0gFG2D+ytJ RQUkAcTq8bas0nu16ZWN960kzZ1hlw41ASlN2upX/9Sug1+WYmX6+qOxisHs71zA FLRQMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788476591; x=1789081391; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=LVlONWyZmSBVJCAo0Rf30qLhQUlyuXkPBBqtG7R9M3I=; b=DpOCn70Qe6kqYuef7sqYqzWbNX8Mgms8pUAt9+P5UkhaexmKdfZGFmWzWXoFTVwq0q Sb2vTGTAtWSbdULKQ+2pY+Q/X0wE1RY6e/Zv6uVOMzGLR3RHBjjjzIq/PX+In8lu4W9n hNlWIODgZ60WSZ5ieE6Yg0s1er+0Dtb72OqDpV53WKK/Uoj7j6S1qg8bYo+/xuuuVmKR Ygry1KOlEITLHdyhrARKnB8zqA47R3UDamesP8Xj2l1Ns7JYbEJQVHlEz1B5p8cQFzVa kCNEzJpD3Y0lipAOxEOHBSTBq8/qqlVO544FiD7nBU1Wwgx21RhqT+J6wfTJjWRcxdEJ k3dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788476591; x=1789081391; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=LVlONWyZmSBVJCAo0Rf30qLhQUlyuXkPBBqtG7R9M3I=; b=jUMq5RDCTmXYN09olLjjr0tahiDy7n1bTzg8mrp7FQT/LWDcJpsq6d0BD+498Sxxkv D3AllAYEbjOXkGfCquPVQAmSbffvgsJS9zk2T+cOPaEAI9VBISEMFS4kF0viEpE/Yl3q xYGrJU3YuwcyHBCYoVjfkv6mgZ03/iuPBibkd0ea6W9hW6I8bnOTOW877hXtMWOk8/F2 kvrCHJE/p22fbtI9lUsEkAQ6EXzIGDoJR05wvLJnAEIdO275nCd5KFRq3JRGFp2ebDpz PPqPQinFUbC7GM2CuM1DqvG47EDMoq0rMWrS4CPYvYydTgYtxsMhNnohIjToPOsT7fvx cnJA== X-Gm-Message-State: AFuF++kkkiMLKxJTxgq/wfWSNsSh4Jx4Mhl+gi/EQQrxk4LVjw3HQPsI FSj9vwPEZfJX3sXdicP3IkboGB6LzmveDe1R6jjSdTj5xzP7hZzwhkem0Er2tugfm3VIBukacyJ CjB1gTMobRcONn0PRGGsgQtk5a+WMbruzuWVc4Dxv7+DR4fvgwkz84rxygXqKqdPQ9g== X-Gm-Gg: AYBFou30uVZx9mo7CqNEt/FZvDsUmEAZzo3S1/M+wb8f0iHzLz8XCo5nIY+GqHb7O5c ZiVYdMQSiqhV00EzoI6FrrGzoiW0P1jjZtFc/QiXVlfR4U0p2YD3BsYrDElymUTxrxhcF30rjTF X2bLOi9aMDwjHlb12YHQqDESwQW33R9aDdgNpP3wbBbB4VtJStJOJquOAULk1VualW7aotOfSsY 94+cMHxk+74ZchogLVcJaftWUmwv79LVpkVDcASlBuLO8i7KDH6/CxSm0i/8cPnJCYbNfElRUZz wyHh9j9YSABiu2SRJVi4OMIwo3LOorxSnMLsgiEhI/a2xT0cU6PbWPtJ1KOfM10yWlV+IWKUKsE XcSu9Q2Kbz0CHQ2tFWQVzHFnvPyDrfPd4r3PvxYXi X-Received: by 2002:a05:6122:29cd:b0:5c5:ac11:9731 with SMTP id 71dfb90a1353d-5c7ed41c72bmr888144e0c.8.1788476591224; Thu, 03 Sep 2026 16:03:11 -0700 (PDT) X-Received: by 2002:a05:6122:29cd:b0:5c5:ac11:9731 with SMTP id 71dfb90a1353d-5c7ed41c72bmr888099e0c.8.1788476590830; Thu, 03 Sep 2026 16:03:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S . Tsirkin" , Ani Sinha , Igor Mammedov Subject: [PATCH 3/4] hw/hotplug: Reduce some HotplugHandler variables scope Date: Fri, 4 Sep 2026 01:02:44 +0200 Message-ID: <20260903230245.65601-4-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260903230245.65601-1-philmd@oss.qualcomm.com> References: <20260903230245.65601-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: kpVdJeNZIuuBt-gUygqxkxwbq-J_1th7 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfX9o2xyG6fJJjj LTYzf4dts9SUdAqgH1YHmV99oFGzqnE2na1yMkEIQ7TpbMMm6btm6Iooid3rFS1RmkZqbRY1FcP rDWXQIr+EAwN57BYDQ0USC6SUnTtU+w= X-Proofpoint-GUID: kpVdJeNZIuuBt-gUygqxkxwbq-J_1th7 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfX2rAHb9F9Xm4z oSyUzuMntfilzjS+ypm22+qW6QZNtFJocKzazSG/XCPpDbir+c43u6RsVAsyqswGwIbllAxpuR/ z7traOAs95qjnaklAMtPpCwgWpV1NFRCDFop+p8YYltIsuJKMe0kv1wQ2bYasN1OjeaWXdk9Uj+ Hu8mBbh6Vx5deP6GuznCuDXpMIWSyPSqwDpp6QWxFMqThYx2/YKhKq6mUN9kB0Y+CdskP9LE1MN 4BtPdUpwXHabkGC6s2wwK0IfpU0ECYwqEK3d3hC5cI2mdk0HbF6iGfs9Ph/w6deQ6KtyQKwYjTA 2S0k2MYFRKcdu2id9SxsIgAyAmDVlRVUM6lEk9NeNNU5JX+RfI43jxKUs7mIxZR1DXlbDFD3Ty5 iJfFH770lW/KJtIihCXDfQdKZfUXWmOVLCM1moj+J8ygIGrb1MmorTKOT2Es5A5CdWhpCkCMhtc 35AxE+ViNPC4Tad61YA== X-Authority-Analysis: v=2.4 cv=X9Zi7mTe c=1 sm=1 tr=0 ts=6a99fcb0 cx=c_pps a=wuOIiItHwq1biOnFUQQHKA==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=xzUfFDxNzoYzOMOmWCsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=XD7yVLdPMpWraOa8Un9W:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-03_06,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 suspectscore=0 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030202 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1788476639271158500 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/acpi/memory_hotplug.c | 3 ++- hw/acpi/pcihp.c | 3 ++- hw/pci/shpc.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index 1ddfdd17b75..f482c835a1c 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -119,7 +119,6 @@ static void acpi_memory_hotplug_write(void *opaque, hwa= ddr addr, uint64_t data, MemStatus *mdev; ACPIOSTInfo *info; DeviceState *dev =3D NULL; - HotplugHandler *hotplug_ctrl =3D NULL; Error *local_err =3D NULL; =20 if (!mem_st->dev_count) { @@ -167,6 +166,8 @@ static void acpi_memory_hotplug_write(void *opaque, hwa= ddr addr, uint64_t data, mdev->is_removing =3D false; trace_mhp_acpi_clear_remove_evt(mem_st->selector); } else if (data & 8) { + HotplugHandler *hotplug_ctrl; + if (!mdev->is_enabled) { trace_mhp_acpi_ejecting_invalid_slot(mem_st->selector); break; diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index b26ddf0a263..336ebe1a13e 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -173,7 +173,6 @@ static bool acpi_pcihp_pc_no_hotplug(AcpiPciHpState *s,= PCIDevice *dev) =20 static void acpi_pcihp_eject_slot(AcpiPciHpState *s, unsigned bsel, unsign= ed slots) { - HotplugHandler *hotplug_ctrl; BusChild *kid, *next; int slot =3D ctz32(slots); PCIBus *bus =3D acpi_pcihp_find_hotplug_bus(s, bsel); @@ -210,6 +209,8 @@ static void acpi_pcihp_eject_slot(AcpiPciHpState *s, un= signed bsel, unsigned slo */ qdev->pending_deleted_event =3D false; } else { + HotplugHandler *hotplug_ctrl; + hotplug_ctrl =3D qdev_get_hotplug_handler(qdev); hotplug_handler_unplug(hotplug_ctrl, qdev, &error_abor= t); object_unparent(OBJECT(qdev)); diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c index 938602866d7..1198e1ab8c0 100644 --- a/hw/pci/shpc.c +++ b/hw/pci/shpc.c @@ -271,7 +271,6 @@ static void shpc_invalid_command(SHPCDevice *shpc) =20 static void shpc_free_devices_in_slot(SHPCDevice *shpc, int slot) { - HotplugHandler *hotplug_ctrl; int devfn; int pci_slot =3D SHPC_IDX_TO_PCI(slot); for (devfn =3D PCI_DEVFN(pci_slot, 0); @@ -279,6 +278,8 @@ static void shpc_free_devices_in_slot(SHPCDevice *shpc,= int slot) ++devfn) { PCIDevice *affected_dev =3D shpc->sec_bus->devices[devfn]; if (affected_dev) { + HotplugHandler *hotplug_ctrl; + hotplug_ctrl =3D qdev_get_hotplug_handler(DEVICE(affected_dev)= ); hotplug_handler_unplug(hotplug_ctrl, DEVICE(affected_dev), &error_abort); --=20 2.53.0 From nobody Sat Sep 26 21:35:44 2026 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; dmarc=pass(p=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1788476639; cv=none; d=zohomail.com; s=zohoarc; b=fZzKBGhftAXOSbQ+NBbCg8IJLL1bIF6aN95+YSkdYaoSoscT/hPIbiV8LqAOY9/C8YzmKJskq5cOJ2bBS/yJSFUOns8tuFTQ/81pPetfLc3jx9rbTxtUlZMfveuaz6pWxQCRhNZg2F+E7Q7Pv+BkCTGdxdeNOzIE7O/7uA1d7T0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1788476639; h=Content-Type: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=nochKuzgVDPhq+MX0FmnI7ta8qahtAkAJ1SRf5bMYcw=; b=LqAoswe2WlJSo97v4kCUlNwaZiWCVRBl9r+j9T0wllzMwQH+Pr23T5GfKPVB+pD7oIljyWftcgtSrXgb6mNEUGbiR7rsM4XerXWwoX6Ii/WyJxJBCCUp+YLtYMtN221ES01bnOcc2XJqsmTzuC84pZQj7eIfVwTHWqGGiR+iXqM= 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; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1788476639661919.1149782411662; Thu, 3 Sep 2026 16:03:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x2GSw-0006Yb-Ag; Thu, 03 Sep 2026 19:03:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSv-0006YJ-6V for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:29 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x2GSq-00036f-AF for qemu-devel@nongnu.org; Thu, 03 Sep 2026 19:03:28 -0400 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 683JhDG2245598 for ; Thu, 3 Sep 2026 23:03:23 GMT Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gf5d13nsw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Sep 2026 23:03:22 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-939281526e1so33648185a.0 for ; Thu, 03 Sep 2026 16:03:22 -0700 (PDT) Received: from localhost.localdomain (pmd666.hd.free.fr. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-485883acd33sm1693676f8f.18.2026.09.03.16.03.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Sep 2026 16:03:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= nochKuzgVDPhq+MX0FmnI7ta8qahtAkAJ1SRf5bMYcw=; b=ap0pfn1rUw/2kISf 71pF6qHoCCJFvLZQVnYVXmFld2dCLYdHu5r+EGeTHjakxVd26mOiN3jTooEkQlpR 6KMwxTRgOdt5jQo9OJQ1Xmjkh+VU1HHrfg9adU1J944OrXVTUJEJt0akA9aZcco6 rUsOQGJYvZQ4OZPEexSPnxBoxlav0PxNxyeZAXyB3HP8FbvTIqqPlYPO1kKmQXjP nVGHmLA3rtbfCUTctKRaN5LC/hTJOVSEfjN2tupmL6wIdgA9uZhP9NME9ki/szLe cDO2VYsESjwqoMeLsLElV4Nx1ebnMy/MujgiQqo0EIar8250x/LeSyMLqRgsj5ok A9cqhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788476602; x=1789081402; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=nochKuzgVDPhq+MX0FmnI7ta8qahtAkAJ1SRf5bMYcw=; b=BT0wjD8fB9uMe+0OPvVjQ/9cdOnhSMXxgheWPRS0BldBMRpWGcKQjbfl2IWoFYqLx/ 7/GfsQsv8gZTb2fnS4AQO7u67RpLkiFs8EASdywyShSuYSNCNGmOZV66zeivvmyor/5H /LIEvlgoqlO42jfV6HXyaEfI61iF5oDyQJ9uoFEdVp3oSOa/w/yoKSEWbZiM2SGVZWC3 EyqLaVNvFD2XEnJKLFPuR4QNfp1zi4s87RPn2C1x4jhCYmVRc0aId7/cr7t2UndfCX9A W0zsRWy6OF6qfQ4aw7i5aIbsez56keTzC/xFOeM4px4/0JFwe+ZlY+AvKUpJfvGiddh4 UJUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788476602; x=1789081402; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=nochKuzgVDPhq+MX0FmnI7ta8qahtAkAJ1SRf5bMYcw=; b=lndYQROoZwpJ9D5TQmwZxplImxfJctSIfkUKwzWROHVe6dhqEqBmHLXtsUNUFJ51/1 XGog3XNXVZEOBbwZx42acHHCXPgNdkzG4ucMboWQ8hh0rnOWS6wnTVK7hizZgMzcO6Vc V+6vu2T9nN3cEbdOvMCu3lnP7pFffX+muqE2cl4JB6vW7xeldO7zbYdbRRCL4uJmt1CO K91QDb252erwdyOaiQAUXxbaV75MplUfieR0iSfkNzUwyw7ZxDoshFt1Gbat5FDjZdoS /ka+/nwHdA3B1lzw3hhG/02SRsdJUv9ZsAQ4noy0Aq0lPziagSMdsVpNxqyyea+qQ096 4lAw== X-Gm-Message-State: AFuF++kgxiPwPzeexyx/WxmAh9rLYnE4O2yhQLd/4CpqgSwgdB62W7/N P69Dki4dYE4xdC/qyO+D1pEwzvcL/mMX1yJDlEcptWz8qXIAE6Yca6rWXvhaYnaBQ/uH5R2a4ur vaaji+QTLgnlYUdgsUohfGgWLYHz3NjhsivZTAcgX/oWIxgFRO633cBtngjC71Q0VAA== X-Gm-Gg: AYBFou1yPPxfPOHY1AvI77lnzJfos7JrKN/QmfY/Hbv1kE8n77hgvznhMXe4M1BOWXJ nNMtj6MqXkSjE03Ygtv+PjZqwnvjoycj9oW4YNYHJ92ZgqCYR/NGU62zWx+1f/to1l9OEuDmbty 7XURp9/zV9qVJEZWdUozePXs1gXimQfnVBqy5SBo5Ky7N/Y7lYW3zP7izUvj2c1fdhVpIxpFm1B I7++KO0EjHXdI2dhrGL6z2IZMvuB3BkhLREU/C9aFC+dUTHD/ms0c2mq3+40uEgzRBgmu36jkmY gXG1Cnrq89MLV+kvQuar9CFFp6UPmWxQ69DuF+e9Kxp5I06zCCZhK49Ftl44gI3KNurBjnJL3+b B101Pk/+178brR+Igy+Jd6K5s7dYpoEQJED3GWWwT X-Received: by 2002:a05:620a:9d1:b0:939:5efe:d980 with SMTP id af79cd13be357-939804105c6mr169337885a.21.1788476600482; Thu, 03 Sep 2026 16:03:20 -0700 (PDT) X-Received: by 2002:a05:620a:9d1:b0:939:5efe:d980 with SMTP id af79cd13be357-939804105c6mr169317385a.21.1788476598931; Thu, 03 Sep 2026 16:03:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S . Tsirkin" , Ani Sinha , Igor Mammedov Subject: [PATCH 4/4] hw/hotplug: Constify HotplugHandler Date: Fri, 4 Sep 2026 01:02:45 +0200 Message-ID: <20260903230245.65601-5-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260903230245.65601-1-philmd@oss.qualcomm.com> References: <20260903230245.65601-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfX8ilKMkR2xBGL 66IYd/3I8p/nJe8PPi6W9uZ5ANOSQVfF3849BjnhImy6LadaSs9IOISEP7abkmSRNy/ZK2ITz9Q SiKQS/8dURXV6hYKxgsCXr7s2NcIji6/s8L5VfyW/mtaOGtxxt4bO9uvx9UvSvO5NvhILmx8+Y8 ou96ry9WXfDJDZj9jDllHfqD1o9zCk2BGctq7UThKC04HCIcz+ib6XcgCEAORRbtjul8KxWzE3P 7f8M9CeftiUFCOXJERK6vLBZ2C0O89TG6GjRSufVl8lfIYeEphQrFVGJ/RBQqYdsB5UbPqZ5UKF LFJFpDA1s7fXwCYA+jRWZnpHBiw6vb3SkXHLV5hkhogty68MhJ1P7iA6EK50OvT4Z+m/895D+w2 vQUIVH3t/dJX4O0D0xXI2A/Sg5/FqsAgHJgkNfkdzDFLhGZNGY3Zrru6w9nHjW6DA0iTOb3riod 9v73GywMYJaTuCp7hSA== X-Proofpoint-ORIG-GUID: cTFAimuGcoLIWkNTcUrlip8HUUWhwCeH X-Proofpoint-Spam-Info: AW1haW4tMjYwOTAzMDIwMiBTYWx0ZWRfX/DmDAOmeWt3M EXFfneokMy59sPSzqh0GjBHnUN06AdO9qTSmO6RwvLm4T0ebkyrvbe26QCdt2pnTB3oZWkhsqLh ms5iXkt+e3LloGrl5t3VOfVIHcDjKO0= X-Proofpoint-GUID: cTFAimuGcoLIWkNTcUrlip8HUUWhwCeH X-Authority-Analysis: v=2.4 cv=J4GaKgnS c=1 sm=1 tr=0 ts=6a99fcba cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=4s3hRJSeHn4rkQlkrse1kQ==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=TOdx9HqFMmWna6nZQ0cA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-03_06,2026-09-03_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609030202 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1788476641193158500 HotplugHandler value returned from qdev_get_hotplug_handler() points to the handler of and object implementing the TYPE_HOTPLUG_HANDLER interface. That handler mostly points to read-only section which shouldn't not be updated. Better protect it with the const qualifier. Mechanical change using 'sed' then manually adapted coding style. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/s390x/ccw-device.h | 2 +- include/hw/acpi/cpu.h | 4 +-- include/hw/acpi/cpu_hotplug.h | 2 +- include/hw/acpi/generic_event_device.h | 3 +- include/hw/acpi/ich9.h | 10 +++--- include/hw/acpi/memory_hotplug.h | 4 +-- include/hw/acpi/pcihp.h | 8 ++--- include/hw/core/boards.h | 4 +-- include/hw/core/hotplug.h | 13 +++---- include/hw/core/qdev.h | 12 +++---- include/hw/i386/microvm.h | 4 +-- include/hw/i386/x86.h | 10 +++--- include/hw/mem/nvdimm.h | 2 +- include/hw/pci/pci_bridge.h | 6 ++-- include/hw/pci/pcie.h | 8 ++--- include/hw/pci/shpc.h | 6 ++-- include/hw/ppc/spapr_nvdimm.h | 2 +- hw/acpi/acpi-cpu-hotplug-stub.c | 4 +-- hw/acpi/acpi-mem-hotplug-stub.c | 4 +-- hw/acpi/acpi-nvdimm-stub.c | 2 +- hw/acpi/acpi-pci-hotplug-stub.c | 8 ++--- hw/acpi/cpu.c | 6 ++-- hw/acpi/generic_event_device.c | 11 +++--- hw/acpi/ich9.c | 10 +++--- hw/acpi/memory_hotplug.c | 6 ++-- hw/acpi/nvdimm.c | 2 +- hw/acpi/pcihp.c | 10 +++--- hw/acpi/piix4.c | 12 +++---- hw/arm/virt.c | 23 ++++++------ hw/char/virtio-serial-bus.c | 2 +- hw/core/hotplug.c | 8 ++--- hw/core/qdev-hotplug.c | 10 +++--- hw/core/qdev.c | 2 +- hw/i386/microvm.c | 12 +++---- hw/i386/pc.c | 28 +++++++-------- hw/i386/x86-common.c | 8 ++--- hw/intc/loongarch_dintc.c | 8 ++--- hw/intc/loongarch_extioi_common.c | 4 +-- hw/intc/loongarch_ipi.c | 4 +-- hw/loongarch/virt.c | 44 +++++++++++------------ hw/net/virtio-net.c | 4 +-- hw/nvme/ctrl.c | 8 ++--- hw/pci-bridge/pci_bridge_dev.c | 6 ++-- hw/pci/pcie.c | 10 +++--- hw/pci/pcie_port.c | 2 +- hw/pci/shpc.c | 10 +++--- hw/ppc/e500plat.c | 4 +-- hw/ppc/spapr.c | 48 +++++++++++++------------- hw/ppc/spapr_nvdimm.c | 2 +- hw/ppc/spapr_pci.c | 12 +++---- hw/remote/machine.c | 2 +- hw/riscv/virt.c | 6 ++-- hw/s390x/css-bridge.c | 2 +- hw/s390x/s390-pci-bus.c | 12 +++---- hw/s390x/s390-virtio-ccw.c | 16 ++++----- hw/s390x/virtio-ccw-md.c | 8 ++--- hw/s390x/virtio-ccw.c | 2 +- hw/scsi/virtio-scsi.c | 6 ++-- hw/scsi/vmw_pvscsi.c | 4 +-- hw/virtio/virtio-md-pci.c | 8 ++--- hw/xen/xen-bus.c | 2 +- stubs/hotplug-stubs.c | 6 ++-- system/qdev-monitor.c | 2 +- 63 files changed, 257 insertions(+), 253 deletions(-) diff --git a/hw/s390x/ccw-device.h b/hw/s390x/ccw-device.h index 15f64cfb636..c303f1de42c 100644 --- a/hw/s390x/ccw-device.h +++ b/hw/s390x/ccw-device.h @@ -37,7 +37,7 @@ extern const VMStateDescription vmstate_ccw_dev; =20 struct CCWDeviceClass { DeviceClass parent_class; - void (*unplug)(HotplugHandler *, DeviceState *, Error **); + void (*unplug)(const HotplugHandler *, DeviceState *, Error **); bool (*realize)(CcwDevice *, Error **); void (*refill_ids)(CcwDevice *); }; diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h index 04c821d2b90..3664ac7a52f 100644 --- a/include/hw/acpi/cpu.h +++ b/include/hw/acpi/cpu.h @@ -39,10 +39,10 @@ typedef struct CPUHotplugState { AcpiCpuStatus *devs; } CPUHotplugState; =20 -void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, +void acpi_cpu_plug_cb(const HotplugHandler *hotplug_dev, CPUHotplugState *cpu_st, DeviceState *dev, Error **e= rrp); =20 -void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_cpu_unplug_request_cb(const HotplugHandler *hotplug_dev, CPUHotplugState *cpu_st, DeviceState *dev, Error **errp); =20 diff --git a/include/hw/acpi/cpu_hotplug.h b/include/hw/acpi/cpu_hotplug.h index 5b670b04eb6..bac40ccfa0e 100644 --- a/include/hw/acpi/cpu_hotplug.h +++ b/include/hw/acpi/cpu_hotplug.h @@ -25,7 +25,7 @@ typedef struct AcpiCpuHotplug { uint8_t sts[ACPI_GPE_PROC_LEN]; } AcpiCpuHotplug; =20 -void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, +void legacy_acpi_cpu_plug_cb(const HotplugHandler *hotplug_dev, AcpiCpuHotplug *g, DeviceState *dev, Error **= errp); =20 void legacy_acpi_cpu_hotplug_init(MemoryRegion *parent, Object *owner, diff --git a/include/hw/acpi/generic_event_device.h b/include/hw/acpi/gener= ic_event_device.h index 7cbfb5fe7d7..42a8033a23e 100644 --- a/include/hw/acpi/generic_event_device.h +++ b/include/hw/acpi/generic_event_device.h @@ -136,7 +136,8 @@ typedef struct AcpiGedClass { ResettablePhases parent_phases; } AcpiGedClass; =20 -void build_ged_aml(Aml *table, const char* name, HotplugHandler *hotplug_d= ev, +void build_ged_aml(Aml *table, const char *name, + const HotplugHandler *hotplug_dev, uint32_t ged_irq, AmlRegionSpace rs, hwaddr ged_base); void acpi_dsdt_add_power_button(Aml *scope); =20 diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index 6d145447518..6956b2b9c9a 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -85,15 +85,15 @@ void ich9_pm_reset_properties(ICH9LPCPMRegs *pm); =20 void ich9_pm_add_class_properties(ObjectClass *oc, ptrdiff_t pm_offset); =20 -void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *= dev, +void ich9_pm_device_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceS= tate *dev, Error **errp); -void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void ich9_pm_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState= *dev, Error **errp); -void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev, +void ich9_pm_device_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); -void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *de= v, +void ich9_pm_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceSta= te *dev, Error **errp); -bool ich9_pm_is_hotpluggable_bus(HotplugHandler *hotplug_dev, BusState *bu= s); +bool ich9_pm_is_hotpluggable_bus(const HotplugHandler *hotplug_dev, BusSta= te *bus); =20 void ich9_pm_ospm_status(AcpiDeviceIf *adev, ACPIOSTInfoList ***list); #endif /* HW_ACPI_ICH9_H */ diff --git a/include/hw/acpi/memory_hotplug.h b/include/hw/acpi/memory_hotp= lug.h index eb7f460afec..6e4f82bcf93 100644 --- a/include/hw/acpi/memory_hotplug.h +++ b/include/hw/acpi/memory_hotplug.h @@ -36,9 +36,9 @@ typedef struct MemHotplugState { void acpi_memory_hotplug_init(MemoryRegion *as, Object *owner, MemHotplugState *state, hwaddr io_base); =20 -void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem= _st, +void acpi_memory_plug_cb(const HotplugHandler *hotplug_dev, MemHotplugStat= e *mem_st, DeviceState *dev, Error **errp); -void acpi_memory_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_memory_unplug_request_cb(const HotplugHandler *hotplug_dev, MemHotplugState *mem_st, DeviceState *dev, Error **errp); void acpi_memory_unplug_cb(MemHotplugState *mem_st, diff --git a/include/hw/acpi/pcihp.h b/include/hw/acpi/pcihp.h index efce5fd2e10..21c0b72355d 100644 --- a/include/hw/acpi/pcihp.h +++ b/include/hw/acpi/pcihp.h @@ -66,13 +66,13 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *, MemoryRegion *io, uint16_t io_base); =20 bool acpi_pcihp_is_hotpluggable_bus(AcpiPciHpState *s, BusState *bus); -void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, +void acpi_pcihp_device_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); -void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState= *s, +void acpi_pcihp_device_plug_cb(const HotplugHandler *hotplug_dev, AcpiPciH= pState *s, DeviceState *dev, Error **errp); -void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpSta= te *s, +void acpi_pcihp_device_unplug_cb(const HotplugHandler *hotplug_dev, AcpiPc= iHpState *s, DeviceState *dev, Error **errp); -void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_pcihp_device_unplug_request_cb(const HotplugHandler *hotplug_dev, AcpiPciHpState *s, DeviceState *d= ev, Error **errp); =20 diff --git a/include/hw/core/boards.h b/include/hw/core/boards.h index a436d48c8e5..dba465efc2c 100644 --- a/include/hw/core/boards.h +++ b/include/hw/core/boards.h @@ -322,8 +322,8 @@ struct MachineClass { SMPCompatProps smp_props; const char *default_ram_id; =20 - HotplugHandler *(*get_hotplug_handler)(MachineState *machine, - DeviceState *dev); + const HotplugHandler *(*get_hotplug_handler)(MachineState *machine, + DeviceState *dev); bool (*hotplug_allowed)(MachineState *state, DeviceState *dev, Error **errp); CpuInstanceProperties (*cpu_index_to_instance_props)(MachineState *mac= hine, diff --git a/include/hw/core/hotplug.h b/include/hw/core/hotplug.h index a9840ed4854..0c69be60ee0 100644 --- a/include/hw/core/hotplug.h +++ b/include/hw/core/hotplug.h @@ -30,7 +30,7 @@ typedef struct HotplugHandler HotplugHandler; * @plugged_dev: a device that has been (un)plugged * @errp: returns an error if this function fails */ -typedef void (*hotplug_fn)(HotplugHandler *plug_handler, +typedef void (*hotplug_fn)(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp); =20 /** @@ -59,7 +59,8 @@ struct HotplugHandlerClass { hotplug_fn plug; hotplug_fn unplug_request; hotplug_fn unplug; - bool (*is_hotpluggable_bus)(HotplugHandler *plug_handler, BusState *bu= s); + bool (*is_hotpluggable_bus)(const HotplugHandler *plug_handler, + BusState *bus); }; =20 /** @@ -67,7 +68,7 @@ struct HotplugHandlerClass { * * Call #HotplugHandlerClass.plug callback of @plug_handler. */ -void hotplug_handler_plug(HotplugHandler *plug_handler, +void hotplug_handler_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp); =20 @@ -76,7 +77,7 @@ void hotplug_handler_plug(HotplugHandler *plug_handler, * * Call #HotplugHandlerClass.pre_plug callback of @plug_handler. */ -void hotplug_handler_pre_plug(HotplugHandler *plug_handler, +void hotplug_handler_pre_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp); =20 @@ -85,7 +86,7 @@ void hotplug_handler_pre_plug(HotplugHandler *plug_handle= r, * * Calls #HotplugHandlerClass.unplug_request callback of @plug_handler. */ -void hotplug_handler_unplug_request(HotplugHandler *plug_handler, +void hotplug_handler_unplug_request(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp); /** @@ -93,7 +94,7 @@ void hotplug_handler_unplug_request(HotplugHandler *plug_= handler, * * Calls #HotplugHandlerClass.unplug callback of @plug_handler. */ -void hotplug_handler_unplug(HotplugHandler *plug_handler, +void hotplug_handler_unplug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp); #endif diff --git a/include/hw/core/qdev.h b/include/hw/core/qdev.h index e4cb027ab3a..1f6bf3fc1ab 100644 --- a/include/hw/core/qdev.h +++ b/include/hw/core/qdev.h @@ -386,7 +386,7 @@ struct BusState { /* public: */ DeviceState *parent; char *name; - HotplugHandler *hotplug_handler; + const HotplugHandler *hotplug_handler; int max_index; bool realized; bool full; @@ -514,8 +514,8 @@ bool qdev_realize_and_unref(DeviceState *dev, BusState = *bus, Error **errp); void qdev_unrealize(DeviceState *dev); void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, int required_for_version); -HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev); -HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev); +const HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev); +const HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev); bool qdev_hotplug_allowed(DeviceState *dev, BusState *bus, Error **errp); bool qdev_hotunplug_allowed(DeviceState *dev, Error **errp); =20 @@ -529,10 +529,10 @@ bool qdev_hotunplug_allowed(DeviceState *dev, Error *= *errp); * Return: pointer to object that implements TYPE_HOTPLUG_HANDLER interface * or NULL if there aren't any. */ -HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev); +const HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev); void qdev_unplug(DeviceState *dev, Error **errp); int qdev_sync_config(DeviceState *dev, Error **errp); -void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev, +void qdev_simple_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); void qdev_machine_creation_done(void); bool qdev_machine_modified(void); @@ -1065,7 +1065,7 @@ void qbus_set_bus_hotplug_handler(BusState *bus); =20 static inline bool qbus_is_hotpluggable(BusState *bus) { - HotplugHandler *plug_handler =3D bus->hotplug_handler; + const HotplugHandler *plug_handler =3D bus->hotplug_handler; bool ret =3D !!plug_handler; =20 if (plug_handler) { diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h index 184b7a8c094..5d5eacd1c6d 100644 --- a/include/hw/i386/microvm.h +++ b/include/hw/i386/microvm.h @@ -76,8 +76,8 @@ =20 struct MicrovmMachineClass { X86MachineClass parent; - HotplugHandler *(*orig_hotplug_handler)(MachineState *machine, - DeviceState *dev); + const HotplugHandler *(*orig_hotplug_handler)(MachineState *machine, + DeviceState *dev); void (*x86_load_linux)(X86MachineState *x86ms, FWCfgState *fw_cfg, int acpi_data_size); }; diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 71fe6b5e122..abb073ca47d 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -46,7 +46,7 @@ struct X86MachineState { qemu_irq *gsi; DeviceState *ioapic2; GMappedFile *initrd_mapped_file; - HotplugHandler *acpi_dev; + const HotplugHandler *acpi_dev; =20 /* * Map the whole BIOS just underneath the 4 GiB address boundary. Only= used @@ -112,13 +112,13 @@ uint32_t x86_cpu_apic_id_from_index(X86MachineState *= x86ms, =20 void x86_cpus_init(X86MachineState *pcms, int default_cpu_version); void x86_rtc_set_cpus_count(ISADevice *rtc, uint16_t cpus_count); -void x86_cpu_pre_plug(HotplugHandler *hotplug_dev, +void x86_cpu_pre_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); -void x86_cpu_plug(HotplugHandler *hotplug_dev, +void x86_cpu_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); -void x86_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, +void x86_cpu_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); -void x86_cpu_unplug_cb(HotplugHandler *hotplug_dev, +void x86_cpu_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); =20 void x86_isa_bios_init(MemoryRegion *isa_bios, MemoryRegion *isa_memory, diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index d3b763453a5..169a943e3ce 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -157,5 +157,5 @@ void nvdimm_build_acpi(GArray *table_offsets, GArray *t= able_data, uint32_t ram_slots, const char *oem_id, const char *oem_table_id); void nvdimm_plug(NVDIMMState *state); -void nvdimm_acpi_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev); +void nvdimm_acpi_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *d= ev); #endif diff --git a/include/hw/pci/pci_bridge.h b/include/hw/pci/pci_bridge.h index b61360b9007..f114f0a6517 100644 --- a/include/hw/pci/pci_bridge.h +++ b/include/hw/pci/pci_bridge.h @@ -141,11 +141,11 @@ void pci_bridge_reset(DeviceState *qdev); void pci_bridge_initfn(PCIDevice *pci_dev, const char *typename); void pci_bridge_exitfn(PCIDevice *pci_dev); =20 -void pci_bridge_dev_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void pci_bridge_dev_plug_cb(const HotplugHandler *hotplug_dev, DeviceState= *dev, Error **errp); -void pci_bridge_dev_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *de= v, +void pci_bridge_dev_unplug_cb(const HotplugHandler *hotplug_dev, DeviceSta= te *dev, Error **errp); -void pci_bridge_dev_unplug_request_cb(HotplugHandler *hotplug_dev, +void pci_bridge_dev_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); =20 /* diff --git a/include/hw/pci/pcie.h b/include/hw/pci/pcie.h index 71ba94874b4..ec25e7a7de9 100644 --- a/include/hw/pci/pcie.h +++ b/include/hw/pci/pcie.h @@ -146,13 +146,13 @@ void pcie_ats_init(PCIDevice *dev, uint16_t offset, b= ool aligned); void pcie_cap_fill_link_ep_usp(PCIDevice *dev, PCIExpLinkWidth width, PCIExpLinkSpeed speed, bool flitmode); =20 -void pcie_cap_slot_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *d= ev, +void pcie_cap_slot_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceSt= ate *dev, Error **errp); -void pcie_cap_slot_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void pcie_cap_slot_plug_cb(const HotplugHandler *hotplug_dev, DeviceState = *dev, Error **errp); -void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void pcie_cap_slot_unplug_cb(const HotplugHandler *hotplug_dev, DeviceStat= e *dev, Error **errp); -void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev, +void pcie_cap_slot_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); =20 void pcie_pasid_common_init(PCIDevice *dev, uint16_t offset, diff --git a/include/hw/pci/shpc.h b/include/hw/pci/shpc.h index fce5bdd3bc7..67becb5c568 100644 --- a/include/hw/pci/shpc.h +++ b/include/hw/pci/shpc.h @@ -45,11 +45,11 @@ void shpc_free(PCIDevice *dev); void shpc_cap_write_config(PCIDevice *d, uint32_t addr, uint32_t val, int = len); =20 =20 -void shpc_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void shpc_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *d= ev, Error **errp); -void shpc_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void shpc_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState = *dev, Error **errp); -void shpc_device_unplug_request_cb(HotplugHandler *hotplug_dev, +void shpc_device_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp); =20 extern const VMStateInfo shpc_vmstate_info; diff --git a/include/hw/ppc/spapr_nvdimm.h b/include/hw/ppc/spapr_nvdimm.h index e9436cb6ef6..386da920422 100644 --- a/include/hw/ppc/spapr_nvdimm.h +++ b/include/hw/ppc/spapr_nvdimm.h @@ -18,7 +18,7 @@ typedef struct SpaprMachineState SpaprMachineState; int spapr_pmem_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr, void *fdt, int *fdt_start_offset, Error **errp); void spapr_dt_persistent_memory(SpaprMachineState *spapr, void *fdt); -bool spapr_nvdimm_validate(HotplugHandler *hotplug_dev, NVDIMMDevice *nvdi= mm, +bool spapr_nvdimm_validate(const HotplugHandler *hotplug_dev, NVDIMMDevice= *nvdimm, uint64_t size, Error **errp); void spapr_add_nvdimm(DeviceState *dev, uint64_t slot); void spapr_nvdimm_finish_flushes(void); diff --git a/hw/acpi/acpi-cpu-hotplug-stub.c b/hw/acpi/acpi-cpu-hotplug-stu= b.c index 72c5f05f5c4..2e05d7100b6 100644 --- a/hw/acpi/acpi-cpu-hotplug-stub.c +++ b/hw/acpi/acpi-cpu-hotplug-stub.c @@ -14,7 +14,7 @@ void acpi_cpu_ospm_status(CPUHotplugState *cpu_st, ACPIOS= TInfoList ***list) { } =20 -void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, +void acpi_cpu_plug_cb(const HotplugHandler *hotplug_dev, CPUHotplugState *cpu_st, DeviceState *dev, Error **e= rrp) { } @@ -24,7 +24,7 @@ void acpi_cpu_unplug_cb(CPUHotplugState *cpu_st, { } =20 -void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_cpu_unplug_request_cb(const HotplugHandler *hotplug_dev, CPUHotplugState *cpu_st, DeviceState *dev, Error **errp) { diff --git a/hw/acpi/acpi-mem-hotplug-stub.c b/hw/acpi/acpi-mem-hotplug-stu= b.c index 7ad0fdcdf26..c218813fd18 100644 --- a/hw/acpi/acpi-mem-hotplug-stub.c +++ b/hw/acpi/acpi-mem-hotplug-stub.c @@ -13,7 +13,7 @@ void acpi_memory_ospm_status(MemHotplugState *mem_st, ACP= IOSTInfoList ***list) { } =20 -void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem= _st, +void acpi_memory_plug_cb(const HotplugHandler *hotplug_dev, MemHotplugStat= e *mem_st, DeviceState *dev, Error **errp) { } @@ -23,7 +23,7 @@ void acpi_memory_unplug_cb(MemHotplugState *mem_st, { } =20 -void acpi_memory_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_memory_unplug_request_cb(const HotplugHandler *hotplug_dev, MemHotplugState *mem_st, DeviceState *dev, Error **errp) { diff --git a/hw/acpi/acpi-nvdimm-stub.c b/hw/acpi/acpi-nvdimm-stub.c index 22ba17f5118..0120bacaace 100644 --- a/hw/acpi/acpi-nvdimm-stub.c +++ b/hw/acpi/acpi-nvdimm-stub.c @@ -2,6 +2,6 @@ #include "hw/mem/nvdimm.h" #include "hw/core/hotplug.h" =20 -void nvdimm_acpi_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev) +void nvdimm_acpi_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *d= ev) { } diff --git a/hw/acpi/acpi-pci-hotplug-stub.c b/hw/acpi/acpi-pci-hotplug-stu= b.c index d58ea726a82..20625c7ed7d 100644 --- a/hw/acpi/acpi-pci-hotplug-stub.c +++ b/hw/acpi/acpi-pci-hotplug-stub.c @@ -9,22 +9,22 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, { } =20 -void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState= *s, +void acpi_pcihp_device_plug_cb(const HotplugHandler *hotplug_dev, AcpiPciH= pState *s, DeviceState *dev, Error **errp) { } =20 -void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, +void acpi_pcihp_device_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { } =20 -void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpSta= te *s, +void acpi_pcihp_device_unplug_cb(const HotplugHandler *hotplug_dev, AcpiPc= iHpState *s, DeviceState *dev, Error **errp) { } =20 -void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_pcihp_device_unplug_request_cb(const HotplugHandler *hotplug_dev, AcpiPciHpState *s, DeviceState *d= ev, Error **errp) { diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c index d63ca83c1bc..ef97ed779a5 100644 --- a/hw/acpi/cpu.c +++ b/hw/acpi/cpu.c @@ -132,7 +132,7 @@ static void cpu_hotplug_wr(void *opaque, hwaddr addr, u= int64_t data, trace_cpuhp_acpi_clear_remove_evt(cpu_st->selector); } else if (data & 8) { DeviceState *dev =3D NULL; - HotplugHandler *hotplug_ctrl =3D NULL; + const HotplugHandler *hotplug_ctrl; =20 if (!cdev->cpu || cdev->cpu =3D=3D first_cpu) { trace_cpuhp_acpi_ejecting_invalid_cpu(cpu_st->selector); @@ -247,7 +247,7 @@ static AcpiCpuStatus *get_cpu_status(CPUHotplugState *c= pu_st, DeviceState *dev) return NULL; } =20 -void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, +void acpi_cpu_plug_cb(const HotplugHandler *hotplug_dev, CPUHotplugState *cpu_st, DeviceState *dev, Error **e= rrp) { AcpiCpuStatus *cdev; @@ -264,7 +264,7 @@ void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, } } =20 -void acpi_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_cpu_unplug_request_cb(const HotplugHandler *hotplug_dev, CPUHotplugState *cpu_st, DeviceState *dev, Error **errp) { diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index 5225e325132..65a5d1612fa 100644 --- a/hw/acpi/generic_event_device.c +++ b/hw/acpi/generic_event_device.c @@ -45,7 +45,8 @@ static const uint32_t ged_supported_events[] =3D { * affected by the interrupt. This way, we can support up to 32 events * with a unique interrupt. */ -void build_ged_aml(Aml *table, const char *name, HotplugHandler *hotplug_d= ev, +void build_ged_aml(Aml *table, const char *name, + const HotplugHandler *hotplug_dev, uint32_t ged_irq, AmlRegionSpace rs, hwaddr ged_base) { const AcpiGedState *s =3D ACPI_GED(hotplug_dev); @@ -250,7 +251,7 @@ static const MemoryRegionOps ged_regs_ops =3D { }, }; =20 -static void acpi_ged_device_pre_plug_cb(HotplugHandler *hotplug_dev, +static void acpi_ged_device_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PCI_DEVICE)) { @@ -258,7 +259,7 @@ static void acpi_ged_device_pre_plug_cb(HotplugHandler = *hotplug_dev, } } =20 -static void acpi_ged_device_plug_cb(HotplugHandler *hotplug_dev, +static void acpi_ged_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { AcpiGedState *s =3D ACPI_GED(hotplug_dev); @@ -279,7 +280,7 @@ static void acpi_ged_device_plug_cb(HotplugHandler *hot= plug_dev, } } =20 -static void acpi_ged_unplug_request_cb(HotplugHandler *hotplug_dev, +static void acpi_ged_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { AcpiGedState *s =3D ACPI_GED(hotplug_dev); @@ -298,7 +299,7 @@ static void acpi_ged_unplug_request_cb(HotplugHandler *= hotplug_dev, } } =20 -static void acpi_ged_unplug_cb(HotplugHandler *hotplug_dev, +static void acpi_ged_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { AcpiGedState *s =3D ACPI_GED(hotplug_dev); diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c index 8082eae4282..6d421b990ce 100644 --- a/hw/acpi/ich9.c +++ b/hw/acpi/ich9.c @@ -410,7 +410,7 @@ void ich9_pm_add_class_properties(ObjectClass *oc, ptrd= iff_t pm_offset) =20 #undef PM_REG_FIELD =20 -void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *= dev, +void ich9_pm_device_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceS= tate *dev, Error **errp) { ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(hotplug_dev); @@ -432,7 +432,7 @@ void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug= _dev, DeviceState *dev, } } =20 -void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void ich9_pm_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState= *dev, Error **errp) { ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(hotplug_dev); @@ -455,7 +455,7 @@ void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev= , DeviceState *dev, } } =20 -void ich9_pm_device_unplug_request_cb(HotplugHandler *hotplug_dev, +void ich9_pm_device_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(hotplug_dev); @@ -489,7 +489,7 @@ void ich9_pm_device_unplug_request_cb(HotplugHandler *h= otplug_dev, } } =20 -void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *de= v, +void ich9_pm_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceSta= te *dev, Error **errp) { ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(hotplug_dev); @@ -507,7 +507,7 @@ void ich9_pm_device_unplug_cb(HotplugHandler *hotplug_d= ev, DeviceState *dev, } } =20 -bool ich9_pm_is_hotpluggable_bus(HotplugHandler *hotplug_dev, BusState *bu= s) +bool ich9_pm_is_hotpluggable_bus(const HotplugHandler *hotplug_dev, BusSta= te *bus) { ICH9LPCState *lpc =3D ICH9_LPC_DEVICE(hotplug_dev); return acpi_pcihp_is_hotpluggable_bus(&lpc->pm.acpi_pci_hotplug, bus); diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index f482c835a1c..b5b6d6ada63 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -166,7 +166,7 @@ static void acpi_memory_hotplug_write(void *opaque, hwa= ddr addr, uint64_t data, mdev->is_removing =3D false; trace_mhp_acpi_clear_remove_evt(mem_st->selector); } else if (data & 8) { - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; =20 if (!mdev->is_enabled) { trace_mhp_acpi_ejecting_invalid_slot(mem_st->selector); @@ -254,7 +254,7 @@ acpi_memory_slot_status(MemHotplugState *mem_st, return &mem_st->devs[slot]; } =20 -void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, MemHotplugState *mem= _st, +void acpi_memory_plug_cb(const HotplugHandler *hotplug_dev, MemHotplugStat= e *mem_st, DeviceState *dev, Error **errp) { MemStatus *mdev; @@ -277,7 +277,7 @@ void acpi_memory_plug_cb(HotplugHandler *hotplug_dev, M= emHotplugState *mem_st, } } =20 -void acpi_memory_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_memory_unplug_request_cb(const HotplugHandler *hotplug_dev, MemHotplugState *mem_st, DeviceState *dev, Error **errp) { diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index 703e854951e..5a7ff1ede8f 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -887,7 +887,7 @@ static const MemoryRegionOps nvdimm_dsm_ops =3D { }, }; =20 -void nvdimm_acpi_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev) +void nvdimm_acpi_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *d= ev) { if (dev->hotplugged) { acpi_send_event(DEVICE(hotplug_dev), ACPI_NVDIMM_HOTPLUG_STATUS); diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index 336ebe1a13e..b69379a18be 100644 --- a/hw/acpi/pcihp.c +++ b/hw/acpi/pcihp.c @@ -209,7 +209,7 @@ static void acpi_pcihp_eject_slot(AcpiPciHpState *s, un= signed bsel, unsigned slo */ qdev->pending_deleted_event =3D false; } else { - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; =20 hotplug_ctrl =3D qdev_get_hotplug_handler(qdev); hotplug_handler_unplug(hotplug_ctrl, qdev, &error_abor= t); @@ -261,7 +261,7 @@ void acpi_pcihp_reset(AcpiPciHpState *s) acpi_pcihp_update(s); } =20 -void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotplug_dev, +void acpi_pcihp_device_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCIDevice *pdev =3D PCI_DEVICE(dev); @@ -275,7 +275,7 @@ void acpi_pcihp_device_pre_plug_cb(HotplugHandler *hotp= lug_dev, } } =20 -void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState= *s, +void acpi_pcihp_device_plug_cb(const HotplugHandler *hotplug_dev, AcpiPciH= pState *s, DeviceState *dev, Error **errp) { PCIDevice *pdev =3D PCI_DEVICE(dev); @@ -317,7 +317,7 @@ void acpi_pcihp_device_plug_cb(HotplugHandler *hotplug_= dev, AcpiPciHpState *s, acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS); } =20 -void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpSta= te *s, +void acpi_pcihp_device_unplug_cb(const HotplugHandler *hotplug_dev, AcpiPc= iHpState *s, DeviceState *dev, Error **errp) { PCIDevice *pdev =3D PCI_DEVICE(dev); @@ -328,7 +328,7 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplu= g_dev, AcpiPciHpState *s, qdev_unrealize(dev); } =20 -void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev, +void acpi_pcihp_device_unplug_request_cb(const HotplugHandler *hotplug_dev, AcpiPciHpState *s, DeviceState *d= ev, Error **errp) { diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c index 52bd61667f9..a7d5356340b 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -303,8 +303,8 @@ static void piix4_pm_powerdown_req(Notifier *n, void *o= paque) acpi_pm1_evt_power_down(&s->ar); } =20 -static void piix4_device_pre_plug_cb(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void piix4_device_pre_plug_cb(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { PIIX4PMState *s =3D PIIX4_PM(hotplug_dev); =20 @@ -323,7 +323,7 @@ static void piix4_device_pre_plug_cb(HotplugHandler *ho= tplug_dev, } } =20 -static void piix4_device_plug_cb(HotplugHandler *hotplug_dev, +static void piix4_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PIIX4PMState *s =3D PIIX4_PM(hotplug_dev); @@ -344,7 +344,7 @@ static void piix4_device_plug_cb(HotplugHandler *hotplu= g_dev, } } =20 -static void piix4_device_unplug_request_cb(HotplugHandler *hotplug_dev, +static void piix4_device_unplug_request_cb(const HotplugHandler *hotplug_d= ev, DeviceState *dev, Error **errp) { PIIX4PMState *s =3D PIIX4_PM(hotplug_dev); @@ -364,7 +364,7 @@ static void piix4_device_unplug_request_cb(HotplugHandl= er *hotplug_dev, } } =20 -static void piix4_device_unplug_cb(HotplugHandler *hotplug_dev, +static void piix4_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PIIX4PMState *s =3D PIIX4_PM(hotplug_dev); @@ -383,7 +383,7 @@ static void piix4_device_unplug_cb(HotplugHandler *hotp= lug_dev, } } =20 -static bool piix4_is_hotpluggable_bus(HotplugHandler *hotplug_dev, +static bool piix4_is_hotpluggable_bus(const HotplugHandler *hotplug_dev, BusState *bus) { PIIX4PMState *s =3D PIIX4_PM(hotplug_dev); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0871a35e11f..3eecf094bcc 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -3753,7 +3753,7 @@ static const CPUArchIdList *virt_possible_cpu_arch_id= s(MachineState *ms) return ms->possible_cpus; } =20 -static void virt_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState = *dev, +static void virt_memory_pre_plug(const HotplugHandler *hotplug_dev, Device= State *dev, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(hotplug_dev); @@ -3779,7 +3779,7 @@ static void virt_memory_pre_plug(HotplugHandler *hotp= lug_dev, DeviceState *dev, pc_dimm_pre_plug(PC_DIMM(dev), MACHINE(hotplug_dev), errp); } =20 -static void virt_memory_plug(HotplugHandler *hotplug_dev, +static void virt_memory_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(hotplug_dev); @@ -3798,7 +3798,7 @@ static void virt_memory_plug(HotplugHandler *hotplug_= dev, } } =20 -static void virt_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, +static void virt_machine_device_pre_plug_cb(const HotplugHandler *hotplug_= dev, DeviceState *dev, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(hotplug_dev); @@ -3896,7 +3896,7 @@ static void virt_machine_device_pre_plug_cb(HotplugHa= ndler *hotplug_dev, } } =20 -static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev, +static void virt_machine_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(hotplug_dev); @@ -3957,7 +3957,7 @@ static void virt_machine_device_plug_cb(HotplugHandle= r *hotplug_dev, } } =20 -static void virt_dimm_unplug_request(HotplugHandler *hotplug_dev, +static void virt_dimm_unplug_request(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(hotplug_dev); @@ -3977,7 +3977,7 @@ static void virt_dimm_unplug_request(HotplugHandler *= hotplug_dev, errp); } =20 -static void virt_dimm_unplug(HotplugHandler *hotplug_dev, +static void virt_dimm_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtMachineState *vms =3D VIRT_MACHINE(hotplug_dev); @@ -3995,8 +3995,9 @@ out: error_propagate(errp, local_err); } =20 -static void virt_machine_device_unplug_request_cb(HotplugHandler *hotplug_= dev, - DeviceState *dev, Error **errp) +static void +virt_machine_device_unplug_request_cb(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { virt_dimm_unplug_request(hotplug_dev, dev, errp); @@ -4009,7 +4010,7 @@ static void virt_machine_device_unplug_request_cb(Hot= plugHandler *hotplug_dev, } } =20 -static void virt_machine_device_unplug_cb(HotplugHandler *hotplug_dev, +static void virt_machine_device_unplug_cb(const HotplugHandler *hotplug_de= v, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -4022,8 +4023,8 @@ static void virt_machine_device_unplug_cb(HotplugHand= ler *hotplug_dev, } } =20 -static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *mach= ine, - DeviceState *dev) +static const HotplugHandler * +virt_machine_get_hotplug_handler(MachineState *machine, DeviceState *dev) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); =20 diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c index 83a033ce855..109769227b2 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -975,7 +975,7 @@ static void virtser_port_device_realize(DeviceState *de= v, Error **errp) port->elem =3D NULL; } =20 -static void virtser_port_device_plug(HotplugHandler *hotplug_dev, +static void virtser_port_device_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtIOSerialPort *port =3D VIRTIO_SERIAL_PORT(dev); diff --git a/hw/core/hotplug.c b/hw/core/hotplug.c index 00e80a67c80..3aca0688406 100644 --- a/hw/core/hotplug.c +++ b/hw/core/hotplug.c @@ -13,7 +13,7 @@ #include "hw/core/hotplug.h" #include "qemu/module.h" =20 -void hotplug_handler_pre_plug(HotplugHandler *plug_handler, +void hotplug_handler_pre_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { @@ -24,7 +24,7 @@ void hotplug_handler_pre_plug(HotplugHandler *plug_handle= r, } } =20 -void hotplug_handler_plug(HotplugHandler *plug_handler, +void hotplug_handler_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { @@ -35,7 +35,7 @@ void hotplug_handler_plug(HotplugHandler *plug_handler, } } =20 -void hotplug_handler_unplug_request(HotplugHandler *plug_handler, +void hotplug_handler_unplug_request(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { @@ -46,7 +46,7 @@ void hotplug_handler_unplug_request(HotplugHandler *plug_= handler, } } =20 -void hotplug_handler_unplug(HotplugHandler *plug_handler, +void hotplug_handler_unplug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { diff --git a/hw/core/qdev-hotplug.c b/hw/core/qdev-hotplug.c index 1d547e0dbdf..d7fa8a5ed27 100644 --- a/hw/core/qdev-hotplug.c +++ b/hw/core/qdev-hotplug.c @@ -14,7 +14,7 @@ #include "hw/core/boards.h" #include "qapi/error.h" =20 -HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev) +const HotplugHandler *qdev_get_machine_hotplug_handler(DeviceState *dev) { MachineState *machine; MachineClass *mc; @@ -90,7 +90,7 @@ bool qdev_hotunplug_allowed(DeviceState *dev, Error **err= p) qdev_hotplug_unplug_allowed_common(dev, dev->parent_bus, errp); } =20 -HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev) +const HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev) { if (dev->parent_bus) { return dev->parent_bus->hotplug_handler; @@ -98,9 +98,9 @@ HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState = *dev) return NULL; } =20 -HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev) +const HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev) { - HotplugHandler *hotplug_ctrl =3D qdev_get_machine_hotplug_handler(dev); + const HotplugHandler *hotplug_ctrl =3D qdev_get_machine_hotplug_handle= r(dev); =20 if (hotplug_ctrl =3D=3D NULL && dev->parent_bus) { hotplug_ctrl =3D qdev_get_bus_hotplug_handler(dev); @@ -109,7 +109,7 @@ HotplugHandler *qdev_get_hotplug_handler(DeviceState *d= ev) } =20 /* can be used as ->unplug() callback for the simple cases */ -void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev, +void qdev_simple_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { qdev_unrealize(dev); diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 0b0f2f47fa7..c6540bec56a 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -501,7 +501,7 @@ static void device_set_realized(Object *obj, bool value= , Error **errp) { DeviceState *dev =3D DEVICE(obj); DeviceClass *dc =3D DEVICE_GET_CLASS(dev); - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; BusState *bus; NamedClockList *ncl; Error *local_err =3D NULL; diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index e7adab7d2ef..a49de337497 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -416,7 +416,7 @@ static void microvm_fix_kernel_cmdline(MachineState *ma= chine) g_free(cmdline); } =20 -static void microvm_device_pre_plug_cb(HotplugHandler *hotplug_dev, +static void microvm_device_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { X86CPU *cpu =3D X86_CPU(dev); @@ -425,26 +425,26 @@ static void microvm_device_pre_plug_cb(HotplugHandler= *hotplug_dev, x86_cpu_pre_plug(hotplug_dev, dev, errp); } =20 -static void microvm_device_plug_cb(HotplugHandler *hotplug_dev, +static void microvm_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { x86_cpu_plug(hotplug_dev, dev, errp); } =20 -static void microvm_device_unplug_request_cb(HotplugHandler *hotplug_dev, +static void microvm_device_unplug_request_cb(const HotplugHandler *hotplug= _dev, DeviceState *dev, Error **err= p) { error_setg(errp, "unplug not supported by microvm"); } =20 -static void microvm_device_unplug_cb(HotplugHandler *hotplug_dev, +static void microvm_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { error_setg(errp, "unplug not supported by microvm"); } =20 -static HotplugHandler *microvm_get_hotplug_handler(MachineState *machine, - DeviceState *dev) +static const HotplugHandler *microvm_get_hotplug_handler(MachineState *mac= hine, + DeviceState *dev) { if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { return HOTPLUG_HANDLER(machine); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e9e4fc262b8..9006e7c29e1 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1181,7 +1181,7 @@ void pc_i8259_create(ISABus *isa_bus, qemu_irq *i8259= _irqs) g_free(i8259); } =20 -static void pc_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *d= ev, +static void pc_memory_pre_plug(const HotplugHandler *hotplug_dev, DeviceSt= ate *dev, Error **errp) { const X86MachineState *x86ms =3D X86_MACHINE(hotplug_dev); @@ -1214,7 +1214,7 @@ static void pc_memory_pre_plug(HotplugHandler *hotplu= g_dev, DeviceState *dev, pc_dimm_pre_plug(PC_DIMM(dev), MACHINE(hotplug_dev), errp); } =20 -static void pc_memory_plug(HotplugHandler *hotplug_dev, +static void pc_memory_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(hotplug_dev); @@ -1231,7 +1231,7 @@ static void pc_memory_plug(HotplugHandler *hotplug_de= v, hotplug_handler_plug(x86ms->acpi_dev, dev, &error_abort); } =20 -static void pc_memory_unplug_request(HotplugHandler *hotplug_dev, +static void pc_memory_unplug_request(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { X86MachineState *x86ms =3D X86_MACHINE(hotplug_dev); @@ -1256,7 +1256,7 @@ static void pc_memory_unplug_request(HotplugHandler *= hotplug_dev, errp); } =20 -static void pc_memory_unplug(HotplugHandler *hotplug_dev, +static void pc_memory_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCMachineState *pcms =3D PC_MACHINE(hotplug_dev); @@ -1274,7 +1274,7 @@ static void pc_memory_unplug(HotplugHandler *hotplug_= dev, error_propagate(errp, local_err); } =20 -static void pc_hv_balloon_pre_plug(HotplugHandler *hotplug_dev, +static void pc_hv_balloon_pre_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { /* The vmbus handler has no hotplug handler; we should never end up he= re. */ @@ -1282,13 +1282,13 @@ static void pc_hv_balloon_pre_plug(HotplugHandler *= hotplug_dev, memory_device_pre_plug(MEMORY_DEVICE(dev), MACHINE(hotplug_dev), errp); } =20 -static void pc_hv_balloon_plug(HotplugHandler *hotplug_dev, +static void pc_hv_balloon_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { memory_device_plug(MEMORY_DEVICE(dev), MACHINE(hotplug_dev)); } =20 -static void pc_sp_mem_pre_plug(HotplugHandler *hotplug_dev, +static void pc_sp_mem_pre_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { MachineState *ms =3D MACHINE(hotplug_dev); @@ -1304,7 +1304,7 @@ static void pc_sp_mem_pre_plug(HotplugHandler *hotplu= g_dev, memory_device_pre_plug(MEMORY_DEVICE(dev), ms, errp); } =20 -static void pc_sp_mem_plug(HotplugHandler *hotplug_dev, +static void pc_sp_mem_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { SpMemDevice *spm =3D SP_MEM(dev); @@ -1318,7 +1318,7 @@ static void pc_sp_mem_plug(HotplugHandler *hotplug_de= v, e820_add_entry(addr, size, E820_SOFT_RESERVED); } =20 -static void pc_machine_device_pre_plug_cb(HotplugHandler *hotplug_dev, +static void pc_machine_device_pre_plug_cb(const HotplugHandler *hotplug_de= v, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -1356,7 +1356,7 @@ static void pc_machine_device_pre_plug_cb(HotplugHand= ler *hotplug_dev, } } =20 -static void pc_machine_device_plug_cb(HotplugHandler *hotplug_dev, +static void pc_machine_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -1372,7 +1372,7 @@ static void pc_machine_device_plug_cb(HotplugHandler = *hotplug_dev, } } =20 -static void pc_machine_device_unplug_request_cb(HotplugHandler *hotplug_de= v, +static void pc_machine_device_unplug_request_cb(const HotplugHandler *hotp= lug_dev, DeviceState *dev, Error **= errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -1388,7 +1388,7 @@ static void pc_machine_device_unplug_request_cb(Hotpl= ugHandler *hotplug_dev, } } =20 -static void pc_machine_device_unplug_cb(HotplugHandler *hotplug_dev, +static void pc_machine_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -1403,8 +1403,8 @@ static void pc_machine_device_unplug_cb(HotplugHandle= r *hotplug_dev, } } =20 -static HotplugHandler *pc_get_hotplug_handler(MachineState *machine, - DeviceState *dev) +static const HotplugHandler *pc_get_hotplug_handler(MachineState *machine, + DeviceState *dev) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) || object_dynamic_cast(OBJECT(dev), TYPE_SP_MEM) || diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index 8f9419e7d36..ae583527606 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -158,7 +158,7 @@ static CPUArchId *x86_find_cpu_slot(MachineState *ms, u= int32_t id, int *idx) return found_cpu; } =20 -void x86_cpu_plug(HotplugHandler *hotplug_dev, +void x86_cpu_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { CPUArchId *found_cpu; @@ -199,7 +199,7 @@ out: error_propagate(errp, local_err); } =20 -void x86_cpu_unplug_request_cb(HotplugHandler *hotplug_dev, +void x86_cpu_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { int idx =3D -1; @@ -222,7 +222,7 @@ void x86_cpu_unplug_request_cb(HotplugHandler *hotplug_= dev, errp); } =20 -void x86_cpu_unplug_cb(HotplugHandler *hotplug_dev, +void x86_cpu_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { CPUArchId *found_cpu; @@ -248,7 +248,7 @@ void x86_cpu_unplug_cb(HotplugHandler *hotplug_dev, error_propagate(errp, local_err); } =20 -void x86_cpu_pre_plug(HotplugHandler *hotplug_dev, +void x86_cpu_pre_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { int idx; diff --git a/hw/intc/loongarch_dintc.c b/hw/intc/loongarch_dintc.c index 94d418261c1..c27ab4d3935 100644 --- a/hw/intc/loongarch_dintc.c +++ b/hw/intc/loongarch_dintc.c @@ -159,8 +159,8 @@ static DINTCCore *loongarch_dintc_get_cpu(LoongArchDINT= CState *s, return NULL; } =20 -static void loongarch_dintc_cpu_plug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void loongarch_dintc_cpu_plug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { LoongArchDINTCState *s =3D LOONGARCH_DINTC(hotplug_dev); Object *obj =3D OBJECT(dev); @@ -185,8 +185,8 @@ static void loongarch_dintc_cpu_plug(HotplugHandler *ho= tplug_dev, return; } =20 -static void loongarch_dintc_cpu_unplug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void loongarch_dintc_cpu_unplug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { LoongArchDINTCState *s =3D LOONGARCH_DINTC(hotplug_dev); Object *obj =3D OBJECT(dev); diff --git a/hw/intc/loongarch_extioi_common.c b/hw/intc/loongarch_extioi_c= ommon.c index 5cb0d396c65..22cbb7a0977 100644 --- a/hw/intc/loongarch_extioi_common.c +++ b/hw/intc/loongarch_extioi_common.c @@ -28,7 +28,7 @@ static ExtIOICore *loongarch_extioi_get_cpu(LoongArchExtI= OICommonState *s, return NULL; } =20 -static void loongarch_extioi_cpu_plug(HotplugHandler *hotplug_dev, +static void loongarch_extioi_cpu_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { LoongArchExtIOICommonState *s =3D LOONGARCH_EXTIOI_COMMON(hotplug_dev); @@ -60,7 +60,7 @@ static void loongarch_extioi_cpu_plug(HotplugHandler *hot= plug_dev, } } =20 -static void loongarch_extioi_cpu_unplug(HotplugHandler *hotplug_dev, +static void loongarch_extioi_cpu_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { LoongArchExtIOICommonState *s =3D LOONGARCH_EXTIOI_COMMON(hotplug_dev); diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c index 5d8b8c96df7..227b72ef7c9 100644 --- a/hw/intc/loongarch_ipi.c +++ b/hw/intc/loongarch_ipi.c @@ -128,7 +128,7 @@ static void loongarch_ipi_reset_hold(Object *obj, Reset= Type type) } } =20 -static void loongarch_ipi_cpu_plug(HotplugHandler *hotplug_dev, +static void loongarch_ipi_cpu_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { LoongsonIPICommonState *lics =3D LOONGSON_IPI_COMMON(hotplug_dev); @@ -154,7 +154,7 @@ static void loongarch_ipi_cpu_plug(HotplugHandler *hotp= lug_dev, qdev_connect_gpio_out(DEVICE(lics), index, qdev_get_gpio_in(dev, IRQ_I= PI)); } =20 -static void loongarch_ipi_cpu_unplug(HotplugHandler *hotplug_dev, +static void loongarch_ipi_cpu_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { LoongsonIPICommonState *lics =3D LOONGSON_IPI_COMMON(hotplug_dev); diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c index 9cc79929a8a..9c5371af9de 100644 --- a/hw/loongarch/virt.c +++ b/hw/loongarch/virt.c @@ -1167,7 +1167,7 @@ static CPUArchId *virt_find_empty_cpu_slot(MachineSta= te *ms) return NULL; } =20 -static void virt_cpu_pre_plug(HotplugHandler *hotplug_dev, +static void virt_cpu_pre_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(hotplug_dev= ); @@ -1229,7 +1229,7 @@ static void virt_cpu_pre_plug(HotplugHandler *hotplug= _dev, numa_cpu_pre_plug(cpu_slot, dev, errp); } =20 -static void virt_cpu_unplug_request(HotplugHandler *hotplug_dev, +static void virt_cpu_unplug_request(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(hotplug_dev= ); @@ -1246,7 +1246,7 @@ static void virt_cpu_unplug_request(HotplugHandler *h= otplug_dev, hotplug_handler_unplug_request(HOTPLUG_HANDLER(lvms->acpi_ged), dev, e= rrp); } =20 -static void virt_cpu_unplug(HotplugHandler *hotplug_dev, +static void virt_cpu_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { CPUArchId *cpu_slot; @@ -1268,7 +1268,7 @@ static void virt_cpu_unplug(HotplugHandler *hotplug_d= ev, cpu_slot->cpu =3D NULL; } =20 -static void virt_cpu_plug(HotplugHandler *hotplug_dev, +static void virt_cpu_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { CPUArchId *cpu_slot; @@ -1304,14 +1304,14 @@ static bool memhp_type_supported(DeviceState *dev) !object_dynamic_cast(OBJECT(dev), TYPE_NVDIMM); } =20 -static void virt_mem_pre_plug(HotplugHandler *hotplug_dev, DeviceState *de= v, - Error **errp) +static void virt_mem_pre_plug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { pc_dimm_pre_plug(PC_DIMM(dev), MACHINE(hotplug_dev), errp); } =20 -static void virt_device_pre_plug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void virt_device_pre_plug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { if (memhp_type_supported(dev)) { virt_mem_pre_plug(hotplug_dev, dev, errp); @@ -1320,8 +1320,8 @@ static void virt_device_pre_plug(HotplugHandler *hotp= lug_dev, } } =20 -static void virt_mem_unplug_request(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void virt_mem_unplug_request(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(hotplug_dev= ); =20 @@ -1330,8 +1330,8 @@ static void virt_mem_unplug_request(HotplugHandler *h= otplug_dev, errp); } =20 -static void virt_device_unplug_request(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void virt_device_unplug_request(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { if (memhp_type_supported(dev)) { virt_mem_unplug_request(hotplug_dev, dev, errp); @@ -1340,8 +1340,8 @@ static void virt_device_unplug_request(HotplugHandler= *hotplug_dev, } } =20 -static void virt_mem_unplug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void virt_mem_unplug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(hotplug_dev= ); =20 @@ -1350,8 +1350,8 @@ static void virt_mem_unplug(HotplugHandler *hotplug_d= ev, qdev_unrealize(dev); } =20 -static void virt_device_unplug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void virt_device_unplug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { if (memhp_type_supported(dev)) { virt_mem_unplug(hotplug_dev, dev, errp); @@ -1360,8 +1360,8 @@ static void virt_device_unplug(HotplugHandler *hotplu= g_dev, } } =20 -static void virt_mem_plug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void virt_mem_plug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(hotplug_dev= ); =20 @@ -1370,8 +1370,8 @@ static void virt_mem_plug(HotplugHandler *hotplug_dev, dev, &error_abort); } =20 -static void virt_device_plug_cb(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void virt_device_plug_cb(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { LoongArchVirtMachineState *lvms =3D LOONGARCH_VIRT_MACHINE(hotplug_dev= ); MachineClass *mc =3D MACHINE_GET_CLASS(lvms); @@ -1389,8 +1389,8 @@ static void virt_device_plug_cb(HotplugHandler *hotpl= ug_dev, } } =20 -static HotplugHandler *virt_get_hotplug_handler(MachineState *machine, - DeviceState *dev) +static const HotplugHandler *virt_get_hotplug_handler(MachineState *machin= e, + DeviceState *dev) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); =20 diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 814b99a43d2..b9a3cddc533 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -3749,7 +3749,7 @@ void virtio_net_set_netclient_name(VirtIONet *n, cons= t char *name, =20 static bool failover_unplug_primary(VirtIONet *n, DeviceState *dev) { - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; PCIDevice *pci_dev; Error *err =3D NULL; =20 @@ -3772,7 +3772,7 @@ static bool failover_replug_primary(VirtIONet *n, Dev= iceState *dev, Error **errp) { Error *err =3D NULL; - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; PCIDevice *pdev =3D PCI_DEVICE(dev); BusState *primary_bus; =20 diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c index 4893cf7e741..4708909e0f0 100644 --- a/hw/nvme/ctrl.c +++ b/hw/nvme/ctrl.c @@ -10595,8 +10595,8 @@ static const TypeInfo nvme_info =3D { }, }; =20 -static void nvme_ns_hot_plug(HotplugHandler *hotplug_dev, DeviceState *dev, - Error **errp) +static void nvme_ns_hot_plug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { NvmeNamespace *ns =3D NVME_NS(dev); NvmeSubsystem *subsys =3D ns->subsys; @@ -10627,8 +10627,8 @@ static void nvme_ns_hot_plug(HotplugHandler *hotplu= g_dev, DeviceState *dev, } } =20 -static void nvme_ns_hot_unplug(HotplugHandler *hotplug_dev, DeviceState *d= ev, - Error **errp) +static void nvme_ns_hot_unplug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { NvmeNamespace *ns =3D NVME_NS(dev); NvmeSubsystem *subsys =3D ns->subsys; diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index 0c1383562d9..bc53bcb69d8 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -205,7 +205,7 @@ static const VMStateDescription pci_bridge_dev_vmstate = =3D { } }; =20 -void pci_bridge_dev_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void pci_bridge_dev_plug_cb(const HotplugHandler *hotplug_dev, DeviceState= *dev, Error **errp) { PCIDevice *pci_hotplug_dev =3D PCI_DEVICE(hotplug_dev); @@ -218,7 +218,7 @@ void pci_bridge_dev_plug_cb(HotplugHandler *hotplug_dev= , DeviceState *dev, shpc_device_plug_cb(hotplug_dev, dev, errp); } =20 -void pci_bridge_dev_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *de= v, +void pci_bridge_dev_unplug_cb(const HotplugHandler *hotplug_dev, DeviceSta= te *dev, Error **errp) { PCIDevice *pci_hotplug_dev =3D PCI_DEVICE(hotplug_dev); @@ -227,7 +227,7 @@ void pci_bridge_dev_unplug_cb(HotplugHandler *hotplug_d= ev, DeviceState *dev, shpc_device_unplug_cb(hotplug_dev, dev, errp); } =20 -void pci_bridge_dev_unplug_request_cb(HotplugHandler *hotplug_dev, +void pci_bridge_dev_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCIDevice *pci_hotplug_dev =3D PCI_DEVICE(hotplug_dev); diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index 4622c75e48c..42bcb9206d5 100644 --- a/hw/pci/pcie.c +++ b/hw/pci/pcie.c @@ -508,7 +508,7 @@ static void pcie_cap_slot_plug_common(PCIDevice *hotplu= g_dev, DeviceState *dev, } } =20 -void pcie_cap_slot_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *d= ev, +void pcie_cap_slot_pre_plug_cb(const HotplugHandler *hotplug_dev, DeviceSt= ate *dev, Error **errp) { PCIDevice *hotplug_pdev =3D PCI_DEVICE(hotplug_dev); @@ -525,7 +525,7 @@ void pcie_cap_slot_pre_plug_cb(HotplugHandler *hotplug_= dev, DeviceState *dev, pcie_cap_slot_plug_common(PCI_DEVICE(hotplug_dev), dev, errp); } =20 -void pcie_cap_slot_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void pcie_cap_slot_plug_cb(const HotplugHandler *hotplug_dev, DeviceState = *dev, Error **errp) { PCIDevice *hotplug_pdev =3D PCI_DEVICE(hotplug_dev); @@ -571,7 +571,7 @@ void pcie_cap_slot_plug_cb(HotplugHandler *hotplug_dev,= DeviceState *dev, } } =20 -void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void pcie_cap_slot_unplug_cb(const HotplugHandler *hotplug_dev, DeviceStat= e *dev, Error **errp) { qdev_unrealize(dev); @@ -579,7 +579,7 @@ void pcie_cap_slot_unplug_cb(HotplugHandler *hotplug_de= v, DeviceState *dev, =20 static void pcie_unplug_device(PCIBus *bus, PCIDevice *dev, void *opaque) { - HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(DEVICE(dev)); + const HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(DEVICE= (dev)); =20 if (dev->partially_hotplugged) { dev->qdev.pending_deleted_event =3D false; @@ -608,7 +608,7 @@ static void pcie_cap_slot_do_unplug(PCIDevice *dev) PCI_EXP_SLTSTA_PDC); } =20 -void pcie_cap_slot_unplug_request_cb(HotplugHandler *hotplug_dev, +void pcie_cap_slot_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { Error *local_err =3D NULL; diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c index dbb6032160e..57fcc9079a6 100644 --- a/hw/pci/pcie_port.c +++ b/hw/pci/pcie_port.c @@ -188,7 +188,7 @@ int pcie_count_ds_ports(PCIBus *bus) return dsp_count; } =20 -static bool pcie_slot_is_hotpluggable_bus(HotplugHandler *plug_handler, +static bool pcie_slot_is_hotpluggable_bus(const HotplugHandler *plug_handl= er, BusState *bus) { PCIESlot *s =3D PCIE_SLOT(bus->parent); diff --git a/hw/pci/shpc.c b/hw/pci/shpc.c index 1198e1ab8c0..3f24ca84f55 100644 --- a/hw/pci/shpc.c +++ b/hw/pci/shpc.c @@ -278,7 +278,7 @@ static void shpc_free_devices_in_slot(SHPCDevice *shpc,= int slot) ++devfn) { PCIDevice *affected_dev =3D shpc->sec_bus->devices[devfn]; if (affected_dev) { - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; =20 hotplug_ctrl =3D qdev_get_hotplug_handler(DEVICE(affected_dev)= ); hotplug_handler_unplug(hotplug_ctrl, DEVICE(affected_dev), @@ -561,8 +561,8 @@ static bool shpc_device_get_slot(PCIDevice *affected_de= v, int *slot, return true; } =20 -void shpc_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, - Error **errp) +void shpc_device_plug_cb(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { PCIDevice *pci_hotplug_dev =3D PCI_DEVICE(hotplug_dev); SHPCDevice *shpc =3D pci_hotplug_dev->shpc; @@ -601,13 +601,13 @@ void shpc_device_plug_cb(HotplugHandler *hotplug_dev,= DeviceState *dev, shpc_interrupt_update(pci_hotplug_dev); } =20 -void shpc_device_unplug_cb(HotplugHandler *hotplug_dev, DeviceState *dev, +void shpc_device_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState = *dev, Error **errp) { qdev_unrealize(dev); } =20 -void shpc_device_unplug_request_cb(HotplugHandler *hotplug_dev, +void shpc_device_unplug_request_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { PCIDevice *pci_hotplug_dev =3D PCI_DEVICE(hotplug_dev); diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index 85cec810d9a..4bc1426dc82 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -42,7 +42,7 @@ static void e500plat_init(MachineState *machine) ppce500_init(machine); } =20 -static void e500plat_machine_device_plug_cb(HotplugHandler *hotplug_dev, +static void e500plat_machine_device_plug_cb(const HotplugHandler *hotplug_= dev, DeviceState *dev, Error **errp) { PPCE500MachineState *pms =3D PPCE500_MACHINE(hotplug_dev); @@ -53,7 +53,7 @@ static void e500plat_machine_device_plug_cb(HotplugHandle= r *hotplug_dev, } } =20 -static +static const HotplugHandler *e500plat_machine_get_hotpug_handler(MachineState *machine, DeviceState *dev) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 20e024907b1..6d994644865 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3616,7 +3616,7 @@ static void spapr_add_lmbs(DeviceState *dev, uint64_t= addr_start, uint64_t size, } } =20 -static void spapr_memory_plug(HotplugHandler *hotplug_dev, DeviceState *de= v) +static void spapr_memory_plug(const HotplugHandler *hotplug_dev, DeviceSta= te *dev) { SpaprMachineState *ms =3D SPAPR_MACHINE(hotplug_dev); PCDIMMDevice *dimm =3D PC_DIMM(dev); @@ -3642,7 +3642,7 @@ static void spapr_memory_plug(HotplugHandler *hotplug= _dev, DeviceState *dev) } } =20 -static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState= *dev, +static void spapr_memory_pre_plug(const HotplugHandler *hotplug_dev, Devic= eState *dev, Error **errp) { SpaprMachineState *spapr =3D SPAPR_MACHINE(hotplug_dev); @@ -3807,7 +3807,7 @@ void spapr_memory_unplug_rollback(SpaprMachineState *= spapr, DeviceState *dev) /* Callback to be called during DRC release. */ void spapr_lmb_release(DeviceState *dev) { - HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); + const HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); SpaprMachineState *spapr =3D SPAPR_MACHINE(hotplug_ctrl); SpaprDimmState *ds =3D spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(= dev)); =20 @@ -3832,7 +3832,7 @@ void spapr_lmb_release(DeviceState *dev) object_unparent(OBJECT(dev)); } =20 -static void spapr_memory_unplug(HotplugHandler *hotplug_dev, DeviceState *= dev) +static void spapr_memory_unplug(const HotplugHandler *hotplug_dev, DeviceS= tate *dev) { SpaprMachineState *spapr =3D SPAPR_MACHINE(hotplug_dev); SpaprDimmState *ds =3D spapr_pending_dimm_unplugs_find(spapr, PC_DIMM(= dev)); @@ -3845,7 +3845,7 @@ static void spapr_memory_unplug(HotplugHandler *hotpl= ug_dev, DeviceState *dev) spapr_pending_dimm_unplugs_remove(spapr, ds); } =20 -static void spapr_memory_unplug_request(HotplugHandler *hotplug_dev, +static void spapr_memory_unplug_request(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { SpaprMachineState *spapr =3D SPAPR_MACHINE(hotplug_dev); @@ -3899,14 +3899,14 @@ static void spapr_memory_unplug_request(HotplugHand= ler *hotplug_dev, /* Callback to be called during DRC release. */ void spapr_core_release(DeviceState *dev) { - HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); + const HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); =20 /* Call the unplug handler chain. This can never fail. */ hotplug_handler_unplug(hotplug_ctrl, dev, &error_abort); object_unparent(OBJECT(dev)); } =20 -static void spapr_core_unplug(HotplugHandler *hotplug_dev, DeviceState *de= v) +static void spapr_core_unplug(const HotplugHandler *hotplug_dev, DeviceSta= te *dev) { MachineState *ms =3D MACHINE(hotplug_dev); CPUCore *cc =3D CPU_CORE(dev); @@ -3918,7 +3918,7 @@ static void spapr_core_unplug(HotplugHandler *hotplug= _dev, DeviceState *dev) } =20 static -void spapr_core_unplug_request(HotplugHandler *hotplug_dev, DeviceState *d= ev, +void spapr_core_unplug_request(const HotplugHandler *hotplug_dev, DeviceSt= ate *dev, Error **errp) { SpaprMachineState *spapr =3D SPAPR_MACHINE(OBJECT(hotplug_dev)); @@ -3988,7 +3988,7 @@ int spapr_core_dt_populate(SpaprDrc *drc, SpaprMachin= eState *spapr, return 0; } =20 -static void spapr_core_plug(HotplugHandler *hotplug_dev, DeviceState *dev) +static void spapr_core_plug(const HotplugHandler *hotplug_dev, DeviceState= *dev) { SpaprMachineState *spapr =3D SPAPR_MACHINE(OBJECT(hotplug_dev)); MachineClass *mc =3D MACHINE_GET_CLASS(spapr); @@ -4043,7 +4043,7 @@ static void spapr_core_plug(HotplugHandler *hotplug_d= ev, DeviceState *dev) =20 } =20 -static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *= dev, +static void spapr_core_pre_plug(const HotplugHandler *hotplug_dev, DeviceS= tate *dev, Error **errp) { MachineState *machine =3D MACHINE(OBJECT(hotplug_dev)); @@ -4169,7 +4169,7 @@ static bool spapr_phb_placement(SpaprMachineState *sp= apr, uint32_t index, return true; } =20 -static bool spapr_phb_pre_plug(HotplugHandler *hotplug_dev, DeviceState *d= ev, +static bool spapr_phb_pre_plug(const HotplugHandler *hotplug_dev, DeviceSt= ate *dev, Error **errp) { SpaprMachineState *spapr =3D SPAPR_MACHINE(OBJECT(hotplug_dev)); @@ -4198,7 +4198,7 @@ static bool spapr_phb_pre_plug(HotplugHandler *hotplu= g_dev, DeviceState *dev, windows_supported, sphb->dma_liobn, errp); } =20 -static void spapr_phb_plug(HotplugHandler *hotplug_dev, DeviceState *dev) +static void spapr_phb_plug(const HotplugHandler *hotplug_dev, DeviceState = *dev) { SpaprPhbState *sphb =3D SPAPR_PCI_HOST_BRIDGE(dev); SpaprDrc *drc; @@ -4220,18 +4220,18 @@ static void spapr_phb_plug(HotplugHandler *hotplug_= dev, DeviceState *dev) =20 void spapr_phb_release(DeviceState *dev) { - HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); + const HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); =20 hotplug_handler_unplug(hotplug_ctrl, dev, &error_abort); object_unparent(OBJECT(dev)); } =20 -static void spapr_phb_unplug(HotplugHandler *hotplug_dev, DeviceState *dev) +static void spapr_phb_unplug(const HotplugHandler *hotplug_dev, DeviceStat= e *dev) { qdev_unrealize(dev); } =20 -static void spapr_phb_unplug_request(HotplugHandler *hotplug_dev, +static void spapr_phb_unplug_request(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { SpaprPhbState *sphb =3D SPAPR_PCI_HOST_BRIDGE(dev); @@ -4251,7 +4251,7 @@ static void spapr_phb_unplug_request(HotplugHandler *= hotplug_dev, } =20 static -bool spapr_tpm_proxy_pre_plug(HotplugHandler *hotplug_dev, DeviceState *de= v, +bool spapr_tpm_proxy_pre_plug(const HotplugHandler *hotplug_dev, DeviceSta= te *dev, Error **errp) { SpaprMachineState *spapr =3D SPAPR_MACHINE(OBJECT(hotplug_dev)); @@ -4264,7 +4264,7 @@ bool spapr_tpm_proxy_pre_plug(HotplugHandler *hotplug= _dev, DeviceState *dev, return true; } =20 -static void spapr_tpm_proxy_plug(HotplugHandler *hotplug_dev, DeviceState = *dev) +static void spapr_tpm_proxy_plug(const HotplugHandler *hotplug_dev, Device= State *dev) { SpaprMachineState *spapr =3D SPAPR_MACHINE(OBJECT(hotplug_dev)); SpaprTpmProxy *tpm_proxy =3D SPAPR_TPM_PROXY(dev); @@ -4275,7 +4275,7 @@ static void spapr_tpm_proxy_plug(HotplugHandler *hotp= lug_dev, DeviceState *dev) spapr->tpm_proxy =3D tpm_proxy; } =20 -static void spapr_tpm_proxy_unplug(HotplugHandler *hotplug_dev, DeviceStat= e *dev) +static void spapr_tpm_proxy_unplug(const HotplugHandler *hotplug_dev, Devi= ceState *dev) { SpaprMachineState *spapr =3D SPAPR_MACHINE(OBJECT(hotplug_dev)); =20 @@ -4284,7 +4284,7 @@ static void spapr_tpm_proxy_unplug(HotplugHandler *ho= tplug_dev, DeviceState *dev spapr->tpm_proxy =3D NULL; } =20 -static void spapr_machine_device_plug(HotplugHandler *hotplug_dev, +static void spapr_machine_device_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -4298,7 +4298,7 @@ static void spapr_machine_device_plug(HotplugHandler = *hotplug_dev, } } =20 -static void spapr_machine_device_unplug(HotplugHandler *hotplug_dev, +static void spapr_machine_device_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -4324,7 +4324,7 @@ bool spapr_memory_hot_unplug_supported(SpaprMachineSt= ate *spapr) spapr_ovec_empty(spapr->ov5_cas); } =20 -static void spapr_machine_device_unplug_request(HotplugHandler *hotplug_de= v, +static void spapr_machine_device_unplug_request(const HotplugHandler *hotp= lug_dev, DeviceState *dev, Error **= errp) { SpaprMachineState *sms =3D SPAPR_MACHINE(OBJECT(hotplug_dev)); @@ -4349,7 +4349,7 @@ static void spapr_machine_device_unplug_request(Hotpl= ugHandler *hotplug_dev, } } =20 -static void spapr_machine_device_pre_plug(HotplugHandler *hotplug_dev, +static void spapr_machine_device_pre_plug(const HotplugHandler *hotplug_de= v, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) { @@ -4363,8 +4363,8 @@ static void spapr_machine_device_pre_plug(HotplugHand= ler *hotplug_dev, } } =20 -static HotplugHandler *spapr_get_hotplug_handler(MachineState *machine, - DeviceState *dev) +static const HotplugHandler *spapr_get_hotplug_handler(MachineState *machi= ne, + DeviceState *dev) { if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) || object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_CPU_CORE) || diff --git a/hw/ppc/spapr_nvdimm.c b/hw/ppc/spapr_nvdimm.c index 66474283915..542ed79497a 100644 --- a/hw/ppc/spapr_nvdimm.c +++ b/hw/ppc/spapr_nvdimm.c @@ -64,7 +64,7 @@ struct SPAPRNVDIMMClass { void (*unrealize)(NVDIMMDevice *dimm, Error **errp); }; =20 -bool spapr_nvdimm_validate(HotplugHandler *hotplug_dev, NVDIMMDevice *nvdi= mm, +bool spapr_nvdimm_validate(const HotplugHandler *hotplug_dev, NVDIMMDevice= *nvdimm, uint64_t size, Error **errp) { const MachineClass *mc =3D MACHINE_GET_CLASS(hotplug_dev); diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index c1d4b7806e4..f7fc544d35c 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1445,7 +1445,7 @@ static int spapr_dt_pci_device(SpaprPhbState *sphb, P= CIDevice *dev, /* Callback to be called during DRC release. */ void spapr_phb_remove_pci_device_cb(DeviceState *dev) { - HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); + const HotplugHandler *hotplug_ctrl =3D qdev_get_hotplug_handler(dev); =20 hotplug_handler_unplug(hotplug_ctrl, dev, &error_abort); object_unparent(OBJECT(dev)); @@ -1454,7 +1454,7 @@ void spapr_phb_remove_pci_device_cb(DeviceState *dev) int spapr_pci_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr, void *fdt, int *fdt_start_offset, Error **errp) { - HotplugHandler *plug_handler =3D qdev_get_hotplug_handler(drc->dev); + const HotplugHandler *plug_handler =3D qdev_get_hotplug_handler(drc->d= ev); SpaprPhbState *sphb =3D SPAPR_PCI_HOST_BRIDGE(plug_handler); PCIDevice *pdev =3D PCI_DEVICE(drc->dev); =20 @@ -1521,7 +1521,7 @@ static bool bridge_has_valid_chassis_nr(Object *bridg= e, Error **errp) return true; } =20 -static void spapr_pci_pre_plug(HotplugHandler *plug_handler, +static void spapr_pci_pre_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { SpaprPhbState *phb =3D SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler)); @@ -1556,7 +1556,7 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_h= andler, } } =20 -static void spapr_pci_plug(HotplugHandler *plug_handler, +static void spapr_pci_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { SpaprPhbState *phb =3D SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler)); @@ -1614,7 +1614,7 @@ static void spapr_pci_bridge_unplug(SpaprPhbState *ph= b, remove_drcs(phb, bus); } =20 -static void spapr_pci_unplug(HotplugHandler *plug_handler, +static void spapr_pci_unplug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { SpaprPhbState *phb =3D SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler)); @@ -1639,7 +1639,7 @@ static void spapr_pci_unplug(HotplugHandler *plug_han= dler, qdev_unrealize(plugged_dev); } =20 -static void spapr_pci_unplug_request(HotplugHandler *plug_handler, +static void spapr_pci_unplug_request(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **err= p) { SpaprPhbState *phb =3D SPAPR_PCI_HOST_BRIDGE(DEVICE(plug_handler)); diff --git a/hw/remote/machine.c b/hw/remote/machine.c index ced782f6a9c..f79f5a05657 100644 --- a/hw/remote/machine.c +++ b/hw/remote/machine.c @@ -111,7 +111,7 @@ static void remote_machine_instance_init(Object *obj) s->auto_shutdown =3D true; } =20 -static void remote_machine_dev_unplug_cb(HotplugHandler *hotplug_dev, +static void remote_machine_dev_unplug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { qdev_unrealize(dev); diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index dd396410178..f1538d63f86 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1693,8 +1693,8 @@ static void virt_set_acpi(Object *obj, Visitor *v, co= nst char *name, visit_type_OnOffAuto(v, name, &s->acpi, errp); } =20 -static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *mach= ine, - DeviceState *dev) +static const HotplugHandler * +virt_machine_get_hotplug_handler(MachineState *machine, DeviceState *dev) { MachineClass *mc =3D MACHINE_GET_CLASS(machine); RISCVVirtState *s =3D RISCV_VIRT_MACHINE(machine); @@ -1709,7 +1709,7 @@ static HotplugHandler *virt_machine_get_hotplug_handl= er(MachineState *machine, return NULL; } =20 -static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev, +static void virt_machine_device_plug_cb(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { RISCVVirtState *s =3D RISCV_VIRT_MACHINE(hotplug_dev); diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c index 440fefb7d0f..e7cd9ac7b60 100644 --- a/hw/s390x/css-bridge.c +++ b/hw/s390x/css-bridge.c @@ -26,7 +26,7 @@ * (including sending a channel report to the guest) and remove the * device from the virtual css bus. */ -static void ccw_device_unplug(HotplugHandler *hotplug_dev, +static void ccw_device_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { CcwDevice *ccw_dev =3D CCW_DEVICE(dev); diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index eff980fdfe9..2eb4e8cec42 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -158,7 +158,7 @@ static void s390_pci_shutdown_notifier(Notifier *n, voi= d *opaque) =20 static void s390_pci_perform_unplug(S390PCIBusDevice *pbdev) { - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; =20 if (pbdev->pft =3D=3D ZPCI_PFT_ISM) { notifier_remove(&pbdev->shutdown_notifier); @@ -1005,8 +1005,8 @@ static bool s390_pci_alloc_idx(S390pciState *s, S390P= CIBusDevice *pbdev) return true; } =20 -static void s390_pcihost_pre_plug(HotplugHandler *hotplug_dev, DeviceState= *dev, - Error **errp) +static void s390_pcihost_pre_plug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { S390pciState *s =3D S390_PCI_HOST_BRIDGE(hotplug_dev); =20 @@ -1079,7 +1079,7 @@ static int s390_pci_interp_plug(S390pciState *s, S390= PCIBusDevice *pbdev) return 0; } =20 -static void s390_pcihost_plug(HotplugHandler *hotplug_dev, DeviceState *de= v, +static void s390_pcihost_plug(const HotplugHandler *hotplug_dev, DeviceSta= te *dev, Error **errp) { S390pciState *s =3D S390_PCI_HOST_BRIDGE(hotplug_dev); @@ -1216,7 +1216,7 @@ static void s390_pcihost_plug(HotplugHandler *hotplug= _dev, DeviceState *dev, } } =20 -static void s390_pcihost_unplug(HotplugHandler *hotplug_dev, DeviceState *= dev, +static void s390_pcihost_unplug(const HotplugHandler *hotplug_dev, DeviceS= tate *dev, Error **errp) { S390pciState *s =3D S390_PCI_HOST_BRIDGE(hotplug_dev); @@ -1255,7 +1255,7 @@ static void s390_pcihost_unplug(HotplugHandler *hotpl= ug_dev, DeviceState *dev, } } =20 -static void s390_pcihost_unplug_request(HotplugHandler *hotplug_dev, +static void s390_pcihost_unplug_request(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 17266779a6c..7fb78d8fa1a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -343,8 +343,8 @@ static void ccw_init(MachineState *machine) =20 } =20 -static void s390_cpu_plug(HotplugHandler *hotplug_dev, - DeviceState *dev, Error **errp) +static void s390_cpu_plug(const HotplugHandler *hotplug_dev, + DeviceState *dev, Error **errp) { ERRP_GUARD(); MachineState *ms =3D MACHINE(hotplug_dev); @@ -608,7 +608,7 @@ out_lock: bql_lock(); } =20 -static void s390_machine_device_pre_plug(HotplugHandler *hotplug_dev, +static void s390_machine_device_pre_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW)) { @@ -618,7 +618,7 @@ static void s390_machine_device_pre_plug(HotplugHandler= *hotplug_dev, } } =20 -static void s390_machine_device_plug(HotplugHandler *hotplug_dev, +static void s390_machine_device_plug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { S390CcwMachineState *s390ms =3D S390_CCW_MACHINE(hotplug_dev); @@ -648,7 +648,7 @@ static void s390_machine_device_plug(HotplugHandler *ho= tplug_dev, } } =20 -static void s390_machine_device_unplug_request(HotplugHandler *hotplug_dev, +static void s390_machine_device_unplug_request(const HotplugHandler *hotpl= ug_dev, DeviceState *dev, Error **e= rrp) { if (object_dynamic_cast(OBJECT(dev), TYPE_CPU)) { @@ -662,7 +662,7 @@ static void s390_machine_device_unplug_request(HotplugH= andler *hotplug_dev, } } =20 -static void s390_machine_device_unplug(HotplugHandler *hotplug_dev, +static void s390_machine_device_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW)) { @@ -715,8 +715,8 @@ static const CPUArchIdList *s390_possible_cpu_arch_ids(= MachineState *ms) return ms->possible_cpus; } =20 -static HotplugHandler *s390_get_hotplug_handler(MachineState *machine, - DeviceState *dev) +static const HotplugHandler *s390_get_hotplug_handler(MachineState *machin= e, + DeviceState *dev) { if (object_dynamic_cast(OBJECT(dev), TYPE_CPU) || object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_MD_CCW) || diff --git a/hw/s390x/virtio-ccw-md.c b/hw/s390x/virtio-ccw-md.c index 0b18b49bc48..70dbea819ad 100644 --- a/hw/s390x/virtio-ccw-md.c +++ b/hw/s390x/virtio-ccw-md.c @@ -19,7 +19,7 @@ void virtio_ccw_md_pre_plug(VirtIOMDCcw *vmd, MachineState *ms, Error **er= rp) { DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); MemoryDeviceState *md =3D MEMORY_DEVICE(vmd); Error *local_err =3D NULL; =20 @@ -48,7 +48,7 @@ void virtio_ccw_md_pre_plug(VirtIOMDCcw *vmd, MachineStat= e *ms, Error **errp) void virtio_ccw_md_plug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp) { DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); MemoryDeviceState *md =3D MEMORY_DEVICE(vmd); Error *local_err =3D NULL; =20 @@ -72,7 +72,7 @@ void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, Machi= neState *ms, { VirtIOMDCcwClass *vmdc =3D VIRTIO_MD_CCW_GET_CLASS(vmd); DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); const HotplugHandlerClass *hdc; Error *local_err =3D NULL; =20 @@ -112,7 +112,7 @@ void virtio_ccw_md_unplug_request(VirtIOMDCcw *vmd, Mac= hineState *ms, void virtio_ccw_md_unplug(VirtIOMDCcw *vmd, MachineState *ms, Error **errp) { DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); MemoryDeviceState *md =3D MEMORY_DEVICE(vmd); Error *local_err =3D NULL; =20 diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index d82874ed27e..30fb2c0681f 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1235,7 +1235,7 @@ static void virtio_ccw_busdev_unrealize(DeviceState *= dev) virtio_ccw_device_unrealize(_dev); } =20 -static void virtio_ccw_busdev_unplug(HotplugHandler *hotplug_dev, +static void virtio_ccw_busdev_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { VirtioCcwDevice *_dev =3D to_virtio_ccw_dev_fast(dev); diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index bf64d1231a8..de6fc0d8316 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -1140,14 +1140,14 @@ static void virtio_scsi_change(SCSIBus *bus, SCSIDe= vice *dev, SCSISense sense) } } =20 -static void virtio_scsi_pre_hotplug(HotplugHandler *hotplug_dev, +static void virtio_scsi_pre_hotplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) { SCSIDevice *sd =3D SCSI_DEVICE(dev); sd->hba_supports_iothread =3D true; } =20 -static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *= dev, +static void virtio_scsi_hotplug(const HotplugHandler *hotplug_dev, DeviceS= tate *dev, Error **errp) { VirtIODevice *vdev =3D VIRTIO_DEVICE(hotplug_dev); @@ -1179,7 +1179,7 @@ static void virtio_scsi_hotplug(HotplugHandler *hotpl= ug_dev, DeviceState *dev, } } =20 -static void virtio_scsi_hotunplug(HotplugHandler *hotplug_dev, DeviceState= *dev, +static void virtio_scsi_hotunplug(const HotplugHandler *hotplug_dev, Devic= eState *dev, Error **errp) { VirtIODevice *vdev =3D VIRTIO_DEVICE(hotplug_dev); diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c index 05f93171cd7..77c9b843b43 100644 --- a/hw/scsi/vmw_pvscsi.c +++ b/hw/scsi/vmw_pvscsi.c @@ -612,7 +612,7 @@ pvscsi_send_msg(PVSCSIState *s, SCSIDevice *dev, uint32= _t msg_type) } =20 static void -pvscsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **errp) +pvscsi_hotplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Error = **errp) { PVSCSIState *s =3D PVSCSI(hotplug_dev); =20 @@ -620,7 +620,7 @@ pvscsi_hotplug(HotplugHandler *hotplug_dev, DeviceState= *dev, Error **errp) } =20 static void -pvscsi_hot_unplug(HotplugHandler *hotplug_dev, DeviceState *dev, Error **e= rrp) +pvscsi_hot_unplug(const HotplugHandler *hotplug_dev, DeviceState *dev, Err= or **errp) { PVSCSIState *s =3D PVSCSI(hotplug_dev); =20 diff --git a/hw/virtio/virtio-md-pci.c b/hw/virtio/virtio-md-pci.c index aa5b11c0f60..97ea0ec7b31 100644 --- a/hw/virtio/virtio-md-pci.c +++ b/hw/virtio/virtio-md-pci.c @@ -19,7 +19,7 @@ void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **er= rp) { DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); MemoryDeviceState *md =3D MEMORY_DEVICE(vmd); Error *local_err =3D NULL; =20 @@ -47,7 +47,7 @@ void virtio_md_pci_pre_plug(VirtIOMDPCI *vmd, MachineStat= e *ms, Error **errp) void virtio_md_pci_plug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp) { DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); MemoryDeviceState *md =3D MEMORY_DEVICE(vmd); Error *local_err =3D NULL; =20 @@ -71,7 +71,7 @@ void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, Machi= neState *ms, { VirtIOMDPCIClass *vmdc =3D VIRTIO_MD_PCI_GET_CLASS(vmd); DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); const HotplugHandlerClass *hdc; Error *local_err =3D NULL; =20 @@ -110,7 +110,7 @@ void virtio_md_pci_unplug_request(VirtIOMDPCI *vmd, Mac= hineState *ms, void virtio_md_pci_unplug(VirtIOMDPCI *vmd, MachineState *ms, Error **errp) { DeviceState *dev =3D DEVICE(vmd); - HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev); + const HotplugHandler *bus_handler =3D qdev_get_bus_hotplug_handler(dev= ); MemoryDeviceState *md =3D MEMORY_DEVICE(vmd); Error *local_err =3D NULL; =20 diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c index 1762816bf46..8def3bb68bc 100644 --- a/hw/xen/xen-bus.c +++ b/hw/xen/xen-bus.c @@ -374,7 +374,7 @@ fail: g_free(key); } =20 -static void xen_bus_unplug_request(HotplugHandler *hotplug, +static void xen_bus_unplug_request(const HotplugHandler *hotplug, DeviceState *dev, Error **errp) { diff --git a/stubs/hotplug-stubs.c b/stubs/hotplug-stubs.c index 0f592ee1391..32b4af79974 100644 --- a/stubs/hotplug-stubs.c +++ b/stubs/hotplug-stubs.c @@ -14,19 +14,19 @@ #include "qemu/osdep.h" #include "hw/core/qdev.h" =20 -HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev) +const HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev) { return NULL; } =20 -void hotplug_handler_pre_plug(HotplugHandler *plug_handler, +void hotplug_handler_pre_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { g_assert_not_reached(); } =20 -void hotplug_handler_plug(HotplugHandler *plug_handler, +void hotplug_handler_plug(const HotplugHandler *plug_handler, DeviceState *plugged_dev, Error **errp) { diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 0c5502d45b6..a62ad23ecf0 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -917,7 +917,7 @@ static DeviceState *find_device_state(const char *id, b= ool use_generic_error, =20 void qdev_unplug(DeviceState *dev, Error **errp) { - HotplugHandler *hotplug_ctrl; + const HotplugHandler *hotplug_ctrl; const HotplugHandlerClass *hdc; Error *local_err =3D NULL; =20 --=20 2.53.0