From nobody Sun Feb 8 15:46:53 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556222590; cv=none; d=zoho.com; s=zohoarc; b=LzDhVNGBYM4AtiZhsItxr6d2ifTsAaMSot4MKUyXF77Yks0EqrsqgfkxTzmuN/G3XQhB1rlQj+m6vjDOqp8grJbXBdAShVC4sgupt8S3/H7i+INSS07ExvmrfCeNlUcyV7DszlXN7bAiW7fvMtNgDAlnKHVEI7jzqS/8HyXOY1I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556222590; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=VnX/ZFiyk5Eni8901G5rJg7FIi8Q8tKVkQIYb1C5/Qc=; b=NnYEx189vQDvMg39DoTN0QelFk1IkqrkSw8iUnrPUF4JSLTV/5vci0slJ0Oob9yNMGyqNUNzCp7pvLUkb7ZSp07NnON1rmW87pyZ//5YelVNcwGi1Cq64blCKN5bPWb0PO/THBXG7JwaMQuNeb2AYMJ7qZK87mXbC4qm2KLB8Zs= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15562225903291015.7392026977666; Thu, 25 Apr 2019 13:03:10 -0700 (PDT) Received: from localhost ([127.0.0.1]:34452 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJkaH-0006yf-30 for importer@patchew.org; Thu, 25 Apr 2019 16:03:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJkYS-0005kx-D6 for qemu-devel@nongnu.org; Thu, 25 Apr 2019 16:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJkYP-0007F5-5K for qemu-devel@nongnu.org; Thu, 25 Apr 2019 16:01:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59892) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJkYM-0006HD-Ti for qemu-devel@nongnu.org; Thu, 25 Apr 2019 16:01:09 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0696B88E52; Thu, 25 Apr 2019 20:01:00 +0000 (UTC) Received: from localhost (ovpn-116-9.gru2.redhat.com [10.97.116.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8DE001948E; Thu, 25 Apr 2019 20:00:59 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 25 Apr 2019 17:00:50 -0300 Message-Id: <20190425200051.19906-4-ehabkost@redhat.com> In-Reply-To: <20190425200051.19906-1-ehabkost@redhat.com> References: <20190425200051.19906-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 25 Apr 2019 20:01:00 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] qdev: Don't compile hotplug code in user-mode emulation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Markus Armbruster , Like Xu , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Move qdev-hotplug.o and hotplug.o to CONFIG_SOFTMMU because the code is not necessary for *-user. Provide a few stubs in qdev-hotplug-stubs.c to replace initialization functions that are called from qdev.c. Signed-off-by: Eduardo Habkost --- hw/core/qdev-hotplug-stubs.c | 44 ++++++++++++++++++++++++++++++++++++ hw/core/Makefile.objs | 6 +++-- tests/Makefile.include | 3 ++- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 hw/core/qdev-hotplug-stubs.c diff --git a/hw/core/qdev-hotplug-stubs.c b/hw/core/qdev-hotplug-stubs.c new file mode 100644 index 0000000000..c710f23388 --- /dev/null +++ b/hw/core/qdev-hotplug-stubs.c @@ -0,0 +1,44 @@ +/* + * qdev hotplug handler stubs (for user-mode emulation and unit tests) + * + * Copyright (c) 2019 Red Hat Inc + * + * Authors: + * Eduardo Habkost + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ + +#include "qemu/osdep.h" +#include "hw/qdev-core.h" +#include "hw/hotplug.h" + +HotplugHandler *qdev_get_hotplug_handler(DeviceState *dev) +{ + return NULL; +} + +void hotplug_handler_pre_plug(HotplugHandler *plug_handler, + DeviceState *plugged_dev, + Error **errp) +{ + assert(plug_handler =3D=3D NULL); +} + +void hotplug_handler_plug(HotplugHandler *plug_handler, + DeviceState *plugged_dev, + Error **errp) +{ + assert(plug_handler =3D=3D NULL); +} diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index 9c4f953716..284fc306c5 100644 --- a/hw/core/Makefile.objs +++ b/hw/core/Makefile.objs @@ -1,11 +1,10 @@ # core qdev-related obj files, also used by *-user: common-obj-y +=3D qdev.o qdev-properties.o -common-obj-y +=3D bus.o reset.o qdev-hotplug.o +common-obj-y +=3D bus.o reset.o common-obj-$(CONFIG_SOFTMMU) +=3D qdev-fw.o common-obj-$(CONFIG_SOFTMMU) +=3D fw-path-provider.o # irq.o needed for qdev GPIO handling: common-obj-y +=3D irq.o -common-obj-y +=3D hotplug.o common-obj-$(CONFIG_SOFTMMU) +=3D nmi.o =20 common-obj-$(CONFIG_EMPTY_SLOT) +=3D empty_slot.o @@ -13,6 +12,7 @@ common-obj-$(CONFIG_XILINX_AXI) +=3D stream.o common-obj-$(CONFIG_PTIMER) +=3D ptimer.o common-obj-$(CONFIG_SOFTMMU) +=3D sysbus.o common-obj-$(CONFIG_SOFTMMU) +=3D machine.o +common-obj-$(CONFIG_SOFTMMU) +=3D hotplug.o qdev-hotplug.o common-obj-$(CONFIG_SOFTMMU) +=3D gpio.o common-obj-$(CONFIG_SOFTMMU) +=3D loader.o common-obj-$(CONFIG_FITLOADER) +=3D loader-fit.o @@ -23,3 +23,5 @@ common-obj-$(CONFIG_SOFTMMU) +=3D split-irq.o common-obj-$(CONFIG_PLATFORM_BUS) +=3D platform-bus.o common-obj-$(CONFIG_SOFTMMU) +=3D generic-loader.o common-obj-$(CONFIG_SOFTMMU) +=3D null-machine.o + +common-obj-$(CONFIG_USER_ONLY) +=3D qdev-hotplug-stubs.o diff --git a/tests/Makefile.include b/tests/Makefile.include index e2432d5e77..fd5e7e0c77 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -568,7 +568,8 @@ tests/fp/%: $(MAKE) -C $(dir $@) $(notdir $@) =20 tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \ - hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\ + hw/core/qdev.o hw/core/qdev-properties.o \ + hw/core/qdev-hotplug-stubs.o \ hw/core/bus.o \ hw/core/irq.o \ hw/core/fw-path-provider.o \ --=20 2.18.0.rc1.1.g3f1ff2140