From nobody Tue Feb 10 04:16:34 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=1635433546; cv=none; d=zohomail.com; s=zohoarc; b=S7yaC6YX8EdSyRKabp0FOwzkPrYnIB+HQMopG7GaF2bVhHRpoIzXKR3ivbDN+XsftlxIzN1teq2o8HNMC/oxyQuOQ7jk9OIJogPRN53BzKzWkYb3DwMiq2T509kcyl2vkWyJ4Bh28I65K0ALqVz/zhOTp9L47Ps4pp3qgEUHPO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1635433546; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=8q5NxY4tZqQ6nhyl14l1qak+/GhyQMQefx1CQ7dFSew=; b=kSY45CAIG0fCJ1gZ3M2PtSYLdleeAh4NPuqvWOTaMu+VXp1lSDzW27S2fXMk6FncpUGVUlfvKkWTd8K/lvaGqY2GuIS+QRknzNm4CNGKfsaL30O5rk2U+nG8CmawjFJ/3rJ2tDXn0Ug2AQlXvJQodAhv4/E1oLFao9mpQ0MJRlI= 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 1635433546430476.2726629478076; Thu, 28 Oct 2021 08:05:46 -0700 (PDT) Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-UEUtt0GLPQ2WMUcU8Xv-Qw-1; Thu, 28 Oct 2021 11:05:44 -0400 Received: by mail-wr1-f70.google.com with SMTP id m5-20020a5d56c5000000b00168861c65f9so2252921wrw.0 for ; Thu, 28 Oct 2021 08:05:44 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id e8sm3468827wrp.58.2021.10.28.08.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 08:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635433545; 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=8q5NxY4tZqQ6nhyl14l1qak+/GhyQMQefx1CQ7dFSew=; b=GM5y7XINaRg+762D80/TVUxV9ISNZzWYkIFZvIw7jGwoLEd9pWigX0jyWuXhlbQM7lYoRs 9nM1qDfAk3bRh5jay2dyvrab3hP+B3LylZyLlxIlu1NeIJuLk6w0/gdi0LK7qvvi43zBz5 SbKubCXI5CWXCg1dc18ZTFHd72tAx1s= X-MC-Unique: UEUtt0GLPQ2WMUcU8Xv-Qw-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=8q5NxY4tZqQ6nhyl14l1qak+/GhyQMQefx1CQ7dFSew=; b=SLR1XH4tCD0GErtnRE2tSDhhSsVnpKbWk4WsoqS8AdHfz8vWjT0xOv65U8c7A8OX51 xcFVkTAz69+qksJ+WRj+ydDMezGuJgox+T1L7VvEKO0/JCHjzbhBFeL3SfNbhiExqtxL 44Gm7PV1waV+Wz7+DxZvpGIXo3+UjkH40zdmpOV9Ef/8yIwXE7FiuvBio7NE7EZks5TC Efd0VfxKR6PjUE1kvjSaDR86T20kktAWL/YBsIu8teULDzRY448+5reFETlCees5qRvP WhbEGZdAfKZ4xaLp9PIiEtansNJ1qeY35oSEK0mara22aj9zVhwq408i5wiJ844o7Kvk +O3A== X-Gm-Message-State: AOAM532JnQij+rkQ7lbO7g8MK6AQamjRBQweHU9XGO3vEjGjKS/YnNvg w451k4GmyDKS1TSeBZhrqCWjgyZ+5bhXoLeEGmyBltDawHyPVwOvCb8w9ZVUPMgMODIXQghpn0o AVPpF9wnE4w01iA== X-Received: by 2002:a5d:40c9:: with SMTP id b9mr6434983wrq.409.1635433542817; Thu, 28 Oct 2021 08:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzd1kqs1by55shHybx9lNYM5phs/FDWTGPd6saDF/V6Wo9O75N5Gwy7mKGDkWq7aS/rAzA+QQ== X-Received: by 2002:a5d:40c9:: with SMTP id b9mr6434964wrq.409.1635433542668; Thu, 28 Oct 2021 08:05:42 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Yanan Wang , Eduardo Habkost , Igor Mammedov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/4] hw/core: Restrict hotplug to system emulation Date: Thu, 28 Oct 2021 17:05:21 +0200 Message-Id: <20211028150521.1973821-5-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211028150521.1973821-1-philmd@redhat.com> References: <20211028150521.1973821-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: 1635433547306100001 Restrict hotplug to system emulation, add stubs for the other uses. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yanan Wang --- 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 85f2ad1374b..afc5ed2c906 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