From patchwork Tue Jun 18 09:59:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 252213 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 060762C008A for ; Tue, 18 Jun 2013 20:00:28 +1000 (EST) Received: from localhost ([::1]:44335 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uosi9-0003L0-VP for incoming@patchwork.ozlabs.org; Tue, 18 Jun 2013 06:00:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uoshl-0003HV-PK for qemu-devel@nongnu.org; Tue, 18 Jun 2013 06:00:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uoshg-0002cO-Tl for qemu-devel@nongnu.org; Tue, 18 Jun 2013 06:00:01 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:54519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uoshg-0002bp-OY for qemu-devel@nongnu.org; Tue, 18 Jun 2013 05:59:56 -0400 X-IronPort-AV: E=Sophos;i="4.87,888,1363132800"; d="scan'208";a="30278081" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP/TLS/AES128-SHA; 18 Jun 2013 09:59:56 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Tue, 18 Jun 2013 05:59:55 -0400 Received: from york.uk.xensource.com ([10.80.228.45] helo=york.uk.xensource.com.) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1Uoshf-0000Sp-NN; Tue, 18 Jun 2013 10:59:55 +0100 From: Paul Durrant To: , Date: Tue, 18 Jun 2013 10:59:46 +0100 Message-ID: <1371549586-4672-3-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1371549586-4672-1-git-send-email-paul.durrant@citrix.com> References: <1371549586-4672-1-git-send-email-paul.durrant@citrix.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.63 Cc: Paul Durrant Subject: [Qemu-devel] [PATCH 2/2] Move hardcoded initialization of xen-platform device. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Creation of the xen-platform device is currently hardcoded into machine type pc's initialization code, guarded by a test for the whether the xen accelerator is enabled. This patch moves the creation of xen-platform into the initialization code of the xenfv machine type. This maintains backwards compatibility for that machine type but allows more flexibility if another machine type is used with Xen HVM domains. Signed-off-by: Paul Durrant --- hw/i386/pc_piix.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7bbb59a..8dd487e 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -179,9 +179,6 @@ static void pc_init1(MemoryRegion *system_memory, pc_register_ferr_irq(gsi[13]); pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL); - if (xen_enabled()) { - pci_create_simple(pci_bus, -1, "xen-platform"); - } /* init basic PC hardware */ pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled()); @@ -325,7 +322,13 @@ static void pc_init_isa(QEMUMachineInitArgs *args) #ifdef CONFIG_XEN static void pc_xen_hvm_init(QEMUMachineInitArgs *args) { + PCIBus *bus; + pc_init_pci(args); + + bus = pci_find_root_bus(0); + if (bus != NULL) + pci_create_simple(bus, -1, "xen-platform"); } #endif