From patchwork Mon May 7 11:12:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 10383907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 79FED60159 for ; Mon, 7 May 2018 11:15:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E1E628A07 for ; Mon, 7 May 2018 11:15:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 601A228A0E; Mon, 7 May 2018 11:15:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C29DA28A07 for ; Mon, 7 May 2018 11:15:29 +0000 (UTC) Received: from localhost ([::1]:45231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFe76-0003m7-Pc for patchwork-qemu-devel@patchwork.kernel.org; Mon, 07 May 2018 07:15:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fFe4s-0002IR-NL for qemu-devel@nongnu.org; Mon, 07 May 2018 07:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fFe4r-0007Cv-NA for qemu-devel@nongnu.org; Mon, 07 May 2018 07:13:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36782 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fFe4k-00077K-Ff; Mon, 07 May 2018 07:13:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 27DE4401DEA9; Mon, 7 May 2018 11:13:02 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 831617C58; Mon, 7 May 2018 11:13:01 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 7 May 2018 13:12:04 +0200 Message-Id: <1525691524-32265-5-git-send-email-imammedo@redhat.com> In-Reply-To: <1525691524-32265-1-git-send-email-imammedo@redhat.com> References: <1525691524-32265-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 07 May 2018 11:13:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Mon, 07 May 2018 11:13:02 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'imammedo@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v4 4/4] make sure that we aren't overwriting mc->get_hotplug_handler by accident 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@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Suggested-by: Eduardo Habkost Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/virt.c | 1 + hw/i386/pc.c | 1 + hw/ppc/e500plat.c | 1 + hw/ppc/spapr.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + 5 files changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 71661c6..9b0a931 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1578,6 +1578,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) mc->cpu_index_to_instance_props = virt_cpu_index_to_props; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); mc->get_default_cpu_node_id = virt_get_default_cpu_node_id; + assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = virt_machine_get_hotplug_handler; hc->plug = virt_machine_device_plug_cb; } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 018fd8d..019be25 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2355,6 +2355,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->acpi_data_size = 0x20000 + 0x8000; pcmc->save_tsc_khz = true; pcmc->linuxboot_dma_enabled = true; + assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = pc_get_hotpug_handler; mc->cpu_index_to_instance_props = pc_cpu_index_to_props; mc->get_default_cpu_node_id = pc_get_default_cpu_node_id; diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c index 1a469ba..d8e3f20 100644 --- a/hw/ppc/e500plat.c +++ b/hw/ppc/e500plat.c @@ -74,6 +74,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, void *data) HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); MachineClass *mc = MACHINE_CLASS(oc); + assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = e500plat_machine_get_hotpug_handler; hc->plug = e500plat_machine_device_plug_cb; diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 32ab3c4..1a4cf42 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3977,6 +3977,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) mc->kvm_type = spapr_kvm_type; machine_class_allow_dynamic_sysbus_dev(mc, TYPE_SPAPR_PCI_HOST_BRIDGE); mc->pci_allow_0_address = true; + assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = spapr_get_hotplug_handler; hc->pre_plug = spapr_machine_device_pre_plug; hc->plug = spapr_machine_device_plug; diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 100dfdc..5796e24 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -491,6 +491,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data) mc->no_sdcard = 1; mc->max_cpus = S390_MAX_CPUS; mc->has_hotpluggable_cpus = true; + assert(!mc->get_hotplug_handler); mc->get_hotplug_handler = s390_get_hotplug_handler; mc->cpu_index_to_instance_props = s390_cpu_index_to_props; mc->possible_cpu_arch_ids = s390_possible_cpu_arch_ids;