]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
hw/ppc/prep: Fix implicit creation of "-drive if=scsi" devices
authorThomas Huth <thuth@redhat.com>
Wed, 7 Mar 2018 09:08:14 +0000 (10:08 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Sun, 18 Mar 2018 07:27:23 +0000 (18:27 +1100)
The global hack for creating SCSI devices has recently been removed,
but this apparently broke SCSI devices on some boards that were not
ready for this change yet. For the 40p machine you now get:

$ ppc64-softmmu/qemu-system-ppc64 -M 40p -cdrom x.iso
qemu-system-ppc64: -cdrom x.iso: machine type does not support if=scsi,bus=0,unit=2

Fix it by providing a lsi53c810_create() function that takes care
of calling scsi_bus_legacy_handle_cmdline() after creating the
corresponding SCSI controller.

Fixes: 1454509726719e0933c800fad00d6999752688ea
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/prep.c
hw/scsi/lsi53c895a.c
include/hw/pci/pci.h

index 5c78503069ca57998b3f867f41d0c3979093870e..a1e7219db64cfbb69269aa7619e78c2017b81ff9 100644 (file)
@@ -787,7 +787,7 @@ static void ibm_40p_init(MachineState *machine)
         qdev_prop_set_uint32(dev, "equipment", 0xc0);
         qdev_init_nofail(dev);
 
-        pci_create_simple(pci_bus, PCI_DEVFN(1, 0), "lsi53c810");
+        lsi53c810_create(pci_bus, PCI_DEVFN(1, 0));
 
         /* XXX: s3-trio at PCI_DEVFN(2, 0) */
         pci_vga_init(pci_bus);
index f3d4c4d2308db001309607f8a15bde291dea619a..160657f4b9d447c9333f29bd8038e3f6302b5075 100644 (file)
@@ -2279,3 +2279,10 @@ void lsi53c895a_create(PCIBus *bus)
 
     scsi_bus_legacy_handle_cmdline(&s->bus);
 }
+
+void lsi53c810_create(PCIBus *bus, int devfn)
+{
+    LSIState *s = LSI53C895A(pci_create_simple(bus, devfn, "lsi53c810"));
+
+    scsi_bus_legacy_handle_cmdline(&s->bus);
+}
index d8c18c7fa46fb1ed1bfeaa9e9bca508d33310c3e..e255941b5acf3a5df03a7b4c4b8d9b512e04ccad 100644 (file)
@@ -708,6 +708,7 @@ PCIDevice *pci_create(PCIBus *bus, int devfn, const char *name);
 PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name);
 
 void lsi53c895a_create(PCIBus *bus);
+void lsi53c810_create(PCIBus *bus, int devfn);
 
 qemu_irq pci_allocate_irq(PCIDevice *pci_dev);
 void pci_set_irq(PCIDevice *pci_dev, int level);