From patchwork Thu Jun 2 20:15:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 9151177 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 C3C5860221 for ; Thu, 2 Jun 2016 20:33:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4A1F28309 for ; Thu, 2 Jun 2016 20:33:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A96BC28328; Thu, 2 Jun 2016 20:33:32 +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=-6.9 required=2.0 tests=BAYES_00,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 4C43428309 for ; Thu, 2 Jun 2016 20:33:32 +0000 (UTC) Received: from localhost ([::1]:50243 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8ZJ4-0004MH-QW for patchwork-qemu-devel@patchwork.kernel.org; Thu, 02 Jun 2016 16:33:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Z2Q-0006A7-Rg for qemu-devel@nongnu.org; Thu, 02 Jun 2016 16:16:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8Z2J-00060L-L6 for qemu-devel@nongnu.org; Thu, 02 Jun 2016 16:16:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8Z2J-00060F-Et for qemu-devel@nongnu.org; Thu, 02 Jun 2016 16:16:11 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A31629AE4; Thu, 2 Jun 2016 20:16:11 +0000 (UTC) Received: from work.redhat.com (vpn-200-100.tlv.redhat.com [10.35.200.100]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u52KFusu005219; Thu, 2 Jun 2016 16:16:07 -0400 From: Marcel Apfelbaum To: qemu-devel@nongnu.org Date: Thu, 2 Jun 2016 23:15:55 +0300 Message-Id: <1464898555-14914-4-git-send-email-marcel@redhat.com> In-Reply-To: <1464898555-14914-1-git-send-email-marcel@redhat.com> References: <1464898555-14914-1-git-send-email-marcel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 02 Jun 2016 20:16:11 +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 v2 3/3] q35: allow dynamic sysbus 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: ehabkost@redhat.com, mst@redhat.com, bd.aviv@gmail.com, peterx@redhat.com, alex.williamson@redhat.com, jan.kiszka@web.de, marcel@redhat.com, pbonzini@redhat.com, davidkiarie4@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Allow adding sysbus devices with -device on Q35. At first Q35 will support only intel-iommu to be added this way, however the command line will support all sysbus devices. Mark with 'cannot_instantiate_with_device_add_yet' the ones causing immediate problems (e.g. crashes). Signed-off-by: Marcel Apfelbaum --- hw/i386/pc_q35.c | 1 + hw/pci-bridge/pci_expander_bridge.c | 1 + hw/pci-host/piix.c | 1 + hw/pci-host/q35.c | 1 + 4 files changed, 4 insertions(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 04aae89..431eaed 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -281,6 +281,7 @@ static void pc_q35_machine_options(MachineClass *m) m->default_machine_opts = "firmware=bios-256k.bin"; m->default_display = "std"; m->no_floppy = 1; + m->has_dynamic_sysbus = true; } static void pc_q35_2_6_machine_options(MachineClass *m) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index ba320bd..40518a2 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -149,6 +149,7 @@ static void pxb_host_class_init(ObjectClass *class, void *data) PCIHostBridgeClass *hc = PCI_HOST_BRIDGE_CLASS(class); dc->fw_name = "pci"; + dc->cannot_instantiate_with_device_add_yet = true; sbc->explicit_ofw_unit_address = pxb_host_ofw_unit_address; hc->root_bus_path = pxb_host_root_bus_path; } diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index df2b0e2..fea7f59 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -865,6 +865,7 @@ static void i440fx_pcihost_class_init(ObjectClass *klass, void *data) dc->realize = i440fx_pcihost_realize; dc->fw_name = "pci"; dc->props = i440fx_props; + dc->cannot_instantiate_with_device_add_yet = true; } static const TypeInfo i440fx_pcihost_info = { diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index ea684c7..9d82d30 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -138,6 +138,7 @@ static void q35_host_class_init(ObjectClass *klass, void *data) hc->root_bus_path = q35_host_root_bus_path; dc->realize = q35_host_realize; dc->props = mch_props; + dc->cannot_instantiate_with_device_add_yet = true; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->fw_name = "pci"; }