Paul Durrant
2013-Jun-17 12:36 UTC
[PATCH 2/2] Move hardcoded initialization of xen-platform device.
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 <paul.durrant@citrix.com> --- 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 6d3f161..38d98af 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -178,9 +178,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()); @@ -324,7 +321,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 -- 1.7.10.4
Paul Durrant
2013-Jun-18 09:59 UTC
[PATCH 2/2] Move hardcoded initialization of xen-platform device.
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 <paul.durrant@citrix.com> --- 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 -- 1.7.10.4
Paul Durrant
2013-Jun-18 11:17 UTC
[PATCH 2/2] Move hardcoded initialization of xen-platform device.
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 <paul.durrant@citrix.com> --- 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 -- 1.7.10.4
Stefano Stabellini
2013-Jun-20 14:44 UTC
Re: [PATCH 2/2] Move hardcoded initialization of xen-platform device.
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 <paul.durrant@citrix.com>Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>> 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