From patchwork Mon Nov 1 18:42:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 12597155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39C4DC433EF for ; Mon, 1 Nov 2021 20:02:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF6B760D07 for ; Mon, 1 Nov 2021 20:02:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EF6B760D07 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:45940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mhdVs-0005wm-2w for qemu-devel@archiver.kernel.org; Mon, 01 Nov 2021 16:02:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhcHP-0000Sl-T4 for qemu-devel@nongnu.org; Mon, 01 Nov 2021 14:43:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56956) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mhcHL-0008QN-Ps for qemu-devel@nongnu.org; Mon, 01 Nov 2021 14:43:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635792210; 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=aiounzSsRk56Dq/Our0QB7nMUzsp+CATVJfdU//4DAd8XQgG+EOhABRgfFahdf07WR1vwz mZxR0THA9rWy8vS7vXZpwVFwPi6MkY37EyHTLg3Lt838E/bmDDAqsETgjrgw4+pLIu9Fl/ 8QGPvggecJRnHkl51GqccB9BX3g+/Mg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-488-UdaL_GSKMgelG3k7p652hg-1; Mon, 01 Nov 2021 14:43:27 -0400 X-MC-Unique: UdaL_GSKMgelG3k7p652hg-1 Received: by mail-wm1-f72.google.com with SMTP id 145-20020a1c0197000000b0032efc3eb9bcso73976wmb.0 for ; Mon, 01 Nov 2021 11:43:27 -0700 (PDT) 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=4e9neKj0AiwKSmmMd/r6245D2dGSORlip+QesQg9Ibyr0q2ruAAMvyvG7ggygj4UIs rRLQ28Hef7QaZYrGXq8IOV0WxcxvhXEpyfavZmNgT7GUGnlKwHrwYfdkP1S+oW04xAXG JNAy2n3ywXP/a0ZtCuDaG3j/7QGgSlveATp17NL/5C9wXiS++Sj5PQWbbQm3GPjLImJ7 MoXB88SENW50a3CO24CpZGW/TEsjgD63KB1V3e2fMLoBW46Fqh01SPCMZ5dZWKZHVXp4 3yltDHj6pHlzN8uFMPm53P5NoA0SHVZhBdwiBuic7KSoHLMXipHAQAB7tpqUS0BRCHc8 pajA== X-Gm-Message-State: AOAM531nxEzo0vJuC0V/bAmE3ZuAtSg0Ygo0BtC/QT5AOf39EXicrAKt R6NXQCQ5KdOkjGUpy2eq9xsNDZwaYBo9In0V34C9QHbHdxMHdvbx0EbM288p/kEZx2wBTlc5unB NaFLjSIj9HRMvSb4L0BMMbQH37HRBjS3S1An5qLSiZ2MjzbvayKTLrQda4GdbwiS1 X-Received: by 2002:a5d:4e0b:: with SMTP id p11mr36822770wrt.88.1635792206553; 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) 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) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org 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 Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.734, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Yanan Wang , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Restrict hotplug to system emulation, add stubs for the other uses. Signed-off-by: Philippe Mathieu-Daudé 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é , + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * 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 common_ss.add(files('cpu-common.c')) softmmu_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c'))