qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH V10 17/27] pc: split out pci device init from pc_ini


From: Isaku Yamahata
Subject: [Qemu-devel] [PATCH V10 17/27] pc: split out pci device init from pc_init1() into pc_pci_device_init()
Date: Thu, 24 Dec 2009 17:09:10 +0900

Split out pci device initialization from pc_init1() into pc_pci_device_init().
and removed unnecessary braces.

Signed-off-by: Isaku Yamahata <address@hidden>
---
 hw/pc.c |   35 +++++++++++++++++++----------------
 1 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 3c01df8..03cc8db 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1180,6 +1180,24 @@ static void pc_basic_device_init(qemu_irq *isa_irq,
     *floppy_controller = fdctrl_init_isa(fd);
 }
 
+static void pc_pci_device_init(PCIBus *pci_bus)
+{
+    int i;
+    int max_bus;
+
+    max_bus = drive_get_max_bus(IF_SCSI);
+    for (i = 0; i <= max_bus; i++) {
+        pci_create_simple(pci_bus, -1, "lsi53c895a");
+    }
+
+    /* Add virtio console devices */
+    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,
@@ -1299,22 +1317,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 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);
     }
 
     rom_load_fw(fw_cfg);
-- 
1.6.5.4





reply via email to

[Prev in Thread] Current Thread [Next in Thread]