Skip to contentSkip to conversation

hw/sparc/sun4m: Fix implicit creation of "-drive if=scsi" devices

PATCH Applied Thomas Huth 3 participants 5 messages Mar 7, 2018 – Mar 8, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/sparc/sun4m: Fix implicit creation of "-drive if=scsi" devices

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 sun4m machines you now get:

$ sparc-softmmu/qemu-system-sparc -boot d -cdrom x.iso
qemu-system-sparc: -cdrom x.iso: machine type does not support if=scsi,bus=0,unit=2

Fix it by calling scsi_bus_legacy_handle_cmdline() after creating the corresponding SCSI controller.

Fixes 1454509726719e0933c800fad00d6999752688ea
---
 hw/sparc/sun4m.c | 1 +
 1 file changed, 1 insertion(+)
hw/sparc/sun4m.c +1 -0
index 61eb424..0f5804b 100644
@@ -324,6 +324,7 @@ static void *sparc32_dma_init(hwaddr dma_base,
 
     esp = ESP_STATE(object_resolve_path_component(OBJECT(espdma), "esp"));
     sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base);
+    scsi_bus_legacy_handle_cmdline(&esp->esp.bus);
 
     ledma = SPARC32_LEDMA_DEVICE(object_resolve_path_component(
                                  OBJECT(dma), "ledma"));
Signature · 1 line
1.8.3.1
Tested-by on v1 1/1
#1 lore raw
Quoted 23 lines · Thomas Huth

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 sun4m machines you now get:

$ sparc-softmmu/qemu-system-sparc -boot d -cdrom x.iso
qemu-system-sparc: -cdrom x.iso: machine type does not support if=scsi,bus=0,unit=2

Fix it by calling scsi_bus_legacy_handle_cmdline() after creating the corresponding SCSI controller.

Fixes 1454509726719e0933c800fad00d6999752688ea
---
  hw/sparc/sun4m.c | 1 +
  1 file changed, 1 insertion(+)
hw/sparc/sun4m.c +0 -0
index 61eb424..0f5804b 100644

hw/sparc/sun4m.c static void *sparc32_dma_init(hwaddr dma_base, · line 330

Quoted 7 lines
hw/sparc/sun4m.c +1 -0
@@ -324,6 +324,7 @@ static void *sparc32_dma_init(hwaddr dma_base,
 
      esp = ESP_STATE(object_resolve_path_component(OBJECT(espdma), "esp"));
      sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base);
+    scsi_bus_legacy_handle_cmdline(&esp->esp.bus);
 
      ledma = SPARC32_LEDMA_DEVICE(object_resolve_path_component(
                                   OBJECT(dma), "ledma"));

Hi Thomas,

Thanks for the patch - I can confirm that it resolves the issue with qemu-system-sparc.

I presume it makes sense for this to go through a tree along with the other patches in the set rather than me taking this via my qemu-sparc branch?

ATB,

Mark.

#2 lore raw
Quoted 35 lines · Mark Cave-Ayland
Quoted 27 lines · Thomas Huth

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 sun4m machines you now get:

$ sparc-softmmu/qemu-system-sparc -boot d -cdrom x.iso
qemu-system-sparc: -cdrom x.iso: machine type does not support
if=scsi,bus=0,unit=2

Fix it by calling scsi_bus_legacy_handle_cmdline() after creating the corresponding SCSI controller.

Fixes 1454509726719e0933c800fad00d6999752688ea

---
  hw/sparc/sun4m.c | 1 +

  1 file changed, 1 insertion(+)
hw/sparc/sun4m.c +1 -0
index 61eb424..0f5804b 100644
@@ -324,6 +324,7 @@ static void *sparc32_dma_init(hwaddr dma_base,
         esp = ESP_STATE(object_resolve_path_component(OBJECT(espdma),
 "esp"));
       sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base);
+    scsi_bus_legacy_handle_cmdline(&esp->esp.bus);
Quoted 3 lines

        ledma = SPARC32_LEDMA_DEVICE(object_resolve_path_component( OBJECT(dma), "ledma"));

Hi Thomas,

Quoted 8 lines

Thanks for the patch - I can confirm that it resolves the issue with qemu-system-sparc.

I presume it makes sense for this to go through a tree along with the other patches in the set rather than me taking this via my qemu-sparc branch?

The patches are independent from each other, so it doesn't really matter. So if you're planning to send a PULL request before soft freeze next Tuesday, please include this patch. Otherwise I hope that Paolo can take this through his misc / scsi tree.

Thomas