[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 17/18] pc.c: split out pci device init from pc_init1
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 17/18] pc.c: split out pci device init from pc_init1() into pc_pci_device_init() |
Date: |
Thu, 18 Jun 2009 19:57:16 +0900 |
Split out pci device initialization from pc_init1() into pc_pci_device_init().
Signed-off-by: Isaku Yamahata <address@hidden>
---
hw/pc.c | 72 +++++++++++++++++++++++++++++++++++----------------------------
1 files changed, 40 insertions(+), 32 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index 6886751..4885f25 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1077,6 +1077,45 @@ static void pc_basic_device_init(qemu_irq *i8259,
*floppy_controller = fdctrl_init(i8259[6], 2, 0, 0x3f0, fd);
}
+static void pc_pci_device_init(PCIBus *pci_bus)
+{
+ {
+ int max_bus;
+ int bus;
+
+ max_bus = drive_get_max_bus(IF_SCSI);
+ for (bus = 0; bus <= max_bus; bus++) {
+ pci_create_simple(pci_bus, -1, "lsi53c895a");
+ }
+ }
+
+ /* Add virtio block devices */
+ {
+ int index;
+ int unit_id = 0;
+
+ while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
+ pci_create_simple(pci_bus, -1, "virtio-blk-pci");
+ unit_id++;
+ }
+ }
+
+ /* Add virtio balloon device */
+ if (!no_virtio_balloon) {
+ pci_create_simple(pci_bus, -1, "virtio-balloon-pci");
+ }
+
+ /* Add virtio console devices */
+ {
+ int i;
+ for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
+ if (virtcon_hds[i]) {
+ pci_create_simple(pci_bus, -1, "virtio-console-pci");
+ }
+ }
+ }
+}
+
/* PC hardware initialisation */
static void pc_init1(ram_addr_t ram_size,
const char *boot_device,
@@ -1191,38 +1230,7 @@ static void pc_init1(ram_addr_t ram_size,
}
if (pci_enabled) {
- int max_bus;
- int bus;
-
- max_bus = drive_get_max_bus(IF_SCSI);
- for (bus = 0; bus <= max_bus; bus++) {
- pci_create_simple(pci_bus, -1, "lsi53c895a");
- }
- }
-
- /* Add virtio block devices */
- if (pci_enabled) {
- int index;
- int unit_id = 0;
-
- while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
- pci_create_simple(pci_bus, -1, "virtio-blk-pci");
- unit_id++;
- }
- }
-
- /* Add virtio balloon device */
- if (pci_enabled && !no_virtio_balloon) {
- pci_create_simple(pci_bus, -1, "virtio-balloon-pci");
- }
-
- /* Add virtio console devices */
- if (pci_enabled) {
- for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) {
- if (virtcon_hds[i]) {
- pci_create_simple(pci_bus, -1, "virtio-console-pci");
- }
- }
+ pc_pci_device_init(pci_bus);
}
}
--
1.6.0.2
- [Qemu-devel] [PATCH 05/18] acpi: add acpi constants from linux header files and use them., (continued)
- [Qemu-devel] [PATCH 05/18] acpi: add acpi constants from linux header files and use them., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 03/18] acpi.c: split out apm register emulation., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 09/18] pc.c: remove a global variable, floppy_controller., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 13/18] pc.c: split out cpu initialization from pc_init1() into pc_cpus_init()., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 11/18] pc.c: introduce a function to allocate cpu irq., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 14/18] pc.c: split out memory allocation from pc_init1() into pc_memory_init(), Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 06/18] acpi.c: split acpi.c into the common part and the piix4 part., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 10/18] pc.c: remove a global variable, RTCState *rtc_state., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 18/18] pc.c: split out piix specific part from pc.c into pc_piix.c, Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 17/18] pc.c: split out pci device init from pc_init1() into pc_pci_device_init(),
Isaku Yamahata <=
- [Qemu-devel] [PATCH 15/18] pc.c: split out vga initialization from pc_init1() into pc_vga_init()., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 12/18] pc.c: make pc_init1() not refer ferr_irq directly., Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH 16/18] pc.c: split out basic device init from pc_init1() into pc_basic_device_init(), Isaku Yamahata, 2009/06/18
- [Qemu-devel] [PATCH] q35 chipset based pc. wip., Isaku Yamahata, 2009/06/18