Received: from eggs.gnu.org ([2001:4830:134:3::10]:36828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Upg6L-0005UY-Jz for qemu-devel@nongnu.org; Thu, 20 Jun 2013 10:44:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Upg6H-0006lP-0W for qemu-devel@nongnu.org; Thu, 20 Jun 2013 10:44:41 -0400 Received: from smtp.citrix.com ([66.165.176.89]:58005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Upg6G-0006lJ-Su for qemu-devel@nongnu.org; Thu, 20 Jun 2013 10:44:36 -0400 Date: Thu, 20 Jun 2013 15:44:23 +0100 From: Stefano Stabellini In-Reply-To: <1371554221-5762-3-git-send-email-paul.durrant@citrix.com> Message-ID: References: <1371554221-5762-1-git-send-email-paul.durrant@citrix.com> <1371554221-5762-3-git-send-email-paul.durrant@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Subject: Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] Move hardcoded initialization of xen-platform device. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Durrant Cc: qemu-devel@nongnu.org, xen-devel@lists.xen.org On Tue, 18 Jun 2013, Paul Durrant wrote: > 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 Acked-by: Stefano Stabellini > hw/i386/pc_piix.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index f96e0c2..c294138 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,14 @@ 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