ahci: Don't allow creating slave drives

An IDE bus provided by AHCI can only take a single IDE drive. If you add
a drive as slave, qemu used to accept the command line but the device
wouldn't be actually usable. Catch the situation instead and error out.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2013-05-06 15:58:04 +02:00
parent 15d23fb966
commit 0ee20e6658
9 changed files with 18 additions and 9 deletions

View file

@ -1163,7 +1163,7 @@ void ahci_init(AHCIState *s, DeviceState *qdev, DMAContext *dma, int ports)
for (i = 0; i < s->ports; i++) {
AHCIDevice *ad = &s->dev[i];
ide_bus_new(&ad->port, qdev, i);
ide_bus_new(&ad->port, qdev, i, 1);
ide_init2(&ad->port, irqs[i]);
ad->hba = s;