Patchwork [10/10] ahci: spawn controller on demand

login
register
mail settings
Submitter Alexander Graf
Date Nov. 18, 2010, 3:27 a.m.
Message ID <1290050875-23848-11-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/72037/
State New
Headers show

Comments

Alexander Graf - Nov. 18, 2010, 3:27 a.m.
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(-)

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");
+    }
 }