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 <ag...@suse.de> --- hw/pc.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) 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"); + } } -- 1.6.0.2