On 25/07/18 14:03, Paolo Bonzini wrote:

It's possible as long as you don't add any members.  You can add a new
const char* argument to ide_bus_new, and call it from cmd646.

However, another possibility is to implement the FWPathProvider
interface in the sun4u machine type.  See hw/ppc/spapr.c for an example.

The FWPathProvider approach seems to be working much better, however I'm still a bit stuck trying to set the bootindex for the in-built IDE interface. Normally I would use -hda for the internal IDE hd and -cdrom for the CDROM, but to support bootindex then I need to use -drive.

On PPC macio has 2 IDE interfaces at 0x20000 and 0x21000 and from reading the manual I can see that the following works as expected for index between 0 and 2:

$ ./qemu-system-ppc -drive id=cd,file=MacOS921-macsbug.iso,if=ide,index=0 -nographic -prom-env 'auto-boot?=false'

Setting index=3 does something a little more strange compared to using plain -cdrom:

$ ./qemu-system-ppc -drive id=cd,file=MacOS921-macsbug.iso,if=ide,media=cdrom,index=3 -nographic -prom-env 'auto-boot?=false'

0 > show-devs

fff8990c /pci@80000000/mac-io@3/ata-3@20000 (ata)
fff89c98 /pci@80000000/mac-io@3/ata-3@21000 (ata)
fff8a024 /pci@80000000/mac-io@3/ata-3@21000/cdrom@0 (block)
fff8a4fc /pci@80000000/mac-io@3/ata-3@21000/cdrom@0/disk@1 (block)

The issue here seems to be that according to "info qtree" there is *always* an ide-cd device plugged into the location equivalent to that of -cdrom, and so with the above command QEMU ends up adding a second ide-cd device to the ide.1 bus which confuses OpenBIOS. Is this deliberate behaviour?

Finally it seems I can't set bootindex with if=ide:

$ ./qemu-system-ppc -drive id=cd,file=MacOS921-macsbug.iso,if=ide,index=0 -device ide-cd,drive=cd,bootindex=0 -nographic -prom-env 'auto-boot?=false'

qemu-system-ppc: -device ide-cd,drive=cd,bootindex=0: Drive 'cd' is already in use because it has been automatically connected to another device (did you need 'if=none' in the drive options?)

And if I try if=none as suggested then according to "info qtree" the drive never gets attached to the in-built ide.0 bus in the first place:

$ ./qemu-system-ppc -drive id=cd,file=MacOS921-macsbug.iso,if=none,index=0 -device ide-cd,drive=cd,bootindex=0 -nographic -prom-env 'auto-boot?=false'

I'm sure that I'm missing something really obvious here related to in-built devices but I can't quite see it at the moment...


ATB,

Mark.

Reply via email to