From nobody Mon Feb 9 15:27:24 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1635792209; cv=none; d=zohomail.com; s=zohoarc; b=ghkjQAcQAajleSgwgmpCaNd458L8eOZT8s6PBMeB5csliFfw6L75SXuGU/BCTSvLGjO/4icTjXZYcRagMUEKxG10VxF0ptJ6t6pCxExDsQprpFHWdsIsrM25ydTqMHqajtTaJVjb79hbPjqmQbQSm0RFVQNf54HLaTLch1w+gbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635792209; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=OwFvWOuJyssO0Z6DL9B2iJO2pVnuKxsynrvNM6xKjqs=; b=PmuUMZwLPr38G1jJPf/9TIW86IpuvquLZFrQWB7RqnZUAC4eSMqe+D7c4st+P+Ui4+xbkcy8N0j+OsJAfdOFvx3UJUV/FKR2ynMOoD4TVOMLo10XT/L/x0IzZ7YH5gtgkoe822esHwuz6z19FzCgfgOfa/++FDLL15Gg8dqntD0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1635792209681791.1548675667599; Mon, 1 Nov 2021 11:43:29 -0700 (PDT) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-bOW3nr9HP-KzOBJZCjGCcA-1; Mon, 01 Nov 2021 14:43:27 -0400 Received: by mail-wm1-f70.google.com with SMTP id l187-20020a1c25c4000000b0030da46b76daso42844wml.9 for ; Mon, 01 Nov 2021 11:43:27 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.. (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id c15sm14428464wrs.19.2021.11.01.11.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 11:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635792208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OwFvWOuJyssO0Z6DL9B2iJO2pVnuKxsynrvNM6xKjqs=; b=dgd+GwNKSG9taVr7N2znWSxu3MVbVDguonErZnPDPdyhYUL8IdyoQrJkMAqdTfaXPBF1Jl oDPgrujthaQ/yNyNvZMzmlbSyLvWtUfrXPZqdbV2oEBx3GdWvL887VtHfmZV3x6mK9/HUs IpSYb4/kkCPa9PdTVB0M3vGZDFrsZB0= X-MC-Unique: bOW3nr9HP-KzOBJZCjGCcA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OwFvWOuJyssO0Z6DL9B2iJO2pVnuKxsynrvNM6xKjqs=; b=M+iQ3dP9898baFX4/GC+f+x1IUK5N1MRKAbW4DLgxgRz8AeNODrkIFXSRykIT5gmOs RHWphDdazgQA6Jvv1+n5AsQsy6OhC7Ky3cRGNl1pmdqXUgbB9qK26ua25kC8yYI6XEmN j4yWBX9GHfnvT65lJGjZ9cPckQuY0U35qv8YauDsehBbaXyb0rz9zg2whBFPgZWuLOHD eBvSQBvYSqB6AU0/rHd0+cY0ThI/pJQuKF8506fglqaic//1Hsxv/mVLehVELGMY4X5N rA03FX3Z3kY8dHEVJ6i9RvJKuKDn4WgjOCHGd8d69t/5rmRQqM+Z8N2D4iTJbah1nz6h xthw== X-Gm-Message-State: AOAM530lJraP89gO2wFft614nTysfO2BgQ+FJ1cUs/Km1XqFg83r7XWQ Ywzo9+Kp8RJ+oBFdjvHPcp2ezgwAwuoydPmguPHNuHHxjYkfZH+6yAays4xp0uqjwbv3vTvtRXX mrMXmpv7X/h226A== X-Received: by 2002:a5d:4e0b:: with SMTP id p11mr36822759wrt.88.1635792206512; Mon, 01 Nov 2021 11:43:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqaJuWFOc17DJo3kuVwUakNDeYQZXBzO2XBCIsQJunrj/QbH+w59C4EBPssg5T74gYfhFJRQ== X-Received: by 2002:a5d:4e0b:: with SMTP id p11mr36822733wrt.88.1635792206360; Mon, 01 Nov 2021 11:43:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eduardo Habkost , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Marcel Apfelbaum , Yanan Wang Subject: [PULL 05/10] hw/core: Restrict hotplug to system emulation Date: Mon, 1 Nov 2021 19:42:54 +0100 Message-Id: <20211101184259.2859090-6-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211101184259.2859090-1-philmd@redhat.com> References: <20211101184259.2859090-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1635792210219100001 Restrict hotplug to system emulation, add stubs for the other uses. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yanan Wang Acked-by: Eduardo Habkost Message-Id: <20211028150521.1973821-5-philmd@redhat.com> --- hw/core/hotplug-stubs.c | 34 ++++++++++++++++++++++++++++++++++ hw/core/meson.build | 12 ++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 hw/core/hotplug-stubs.c diff --git a/hw/core/hotplug-stubs.c b/hw/core/hotplug-stubs.c new file mode 100644 index 00000000000..7aadaa29bd5 --- /dev/null +++ b/hw/core/hotplug-stubs.c @@ -0,0 +1,34 @@ +/* + * Hotplug handler stubs + * + * Copyright (c) Red Hat + * + * Authors: + * Philippe Mathieu-Daud=C3=A9 , + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or late= r. + * See the COPYING file in the top-level directory. + */ +#include "qemu/osdep.h" +#include "hw/qdev-core.h" + +HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev) +{ + return NULL; +} + +void hotplug_handler_pre_plug(HotplugHandler *plug_handler, + DeviceState *plugged_dev, + Error **errp) +{ + g_assert_not_reached(); +} + +void hotplug_handler_plug(HotplugHandler *plug_handler, + DeviceState *plugged_dev, + Error **errp) +{ + g_assert_not_reached(); +} diff --git a/hw/core/meson.build b/hw/core/meson.build index c9fe6441d92..7ec7bb93d5f 100644 --- a/hw/core/meson.build +++ b/hw/core/meson.build @@ -1,7 +1,6 @@ # core qdev-related obj files, also used by *-user and unit tests hwcore_ss.add(files( 'bus.c', - 'hotplug.c', 'qdev-properties.c', 'qdev.c', 'reset.c', @@ -11,8 +10,17 @@ 'irq.c', 'clock.c', 'qdev-clock.c', - 'qdev-hotplug.c', )) +if have_system + hwcore_ss.add(files( + 'hotplug.c', + 'qdev-hotplug.c', + )) +else + hwcore_ss.add(files( + 'hotplug-stubs.c', + )) +endif =20 common_ss.add(files('cpu-common.c')) softmmu_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c')) --=20 2.31.1