diff mbox

[10/10] ahci: spawn controller on demand

Message ID 1290050875-23848-11-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf Nov. 18, 2010, 3:27 a.m. UTC
When we add a device using -drive to the guest, we also need to create a
new SATA bus to handle the device. This patch does it the same way SCSI
does it today.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 hw/pc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/hw/pc.c b/hw/pc.c
index 69b13bf..d0320c4 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1075,4 +1075,9 @@  void pc_pci_device_init(PCIBus *pci_bus)
     for (bus = 0; bus <= max_bus; bus++) {
         pci_create_simple(pci_bus, -1, "lsi53c895a");
     }
+
+    max_bus = drive_get_max_bus(IF_SATA);
+    for (bus = 0; bus <= max_bus; bus++) {
+        pci_create_simple(pci_bus, -1, "ahci");
+    }
 }