All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel <qemu-devel@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	marcel@redhat.com, Laszlo Ersek <lersek@redhat.com>,
	armbru@redhat.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] How to generate custom fw paths for IDE devices?
Date: Fri, 27 Jul 2018 11:43:09 +0100	[thread overview]
Message-ID: <16432a45-ad8b-6c09-b50d-ab7101214912@ilande.co.uk> (raw)
In-Reply-To: <9c285bce-478f-b786-76e0-f0810336ec23@redhat.com>

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	other threads:[~2018-07-27 10:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18 21:13 [Qemu-devel] How to generate custom fw paths for IDE devices? Mark Cave-Ayland
2018-07-19  8:10 ` Thomas Huth
2018-07-19 16:46   ` Mark Cave-Ayland
2018-07-19  8:29 ` Laszlo Ersek
2018-07-19 17:19   ` Mark Cave-Ayland
2018-07-19 19:03     ` Laszlo Ersek
2018-07-25 13:03 ` [Qemu-devel] [Qemu-block] " Paolo Bonzini
2018-07-27 10:43   ` Mark Cave-Ayland [this message]
2018-07-27 10:47     ` Paolo Bonzini
2018-07-27 11:00       ` Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16432a45-ad8b-6c09-b50d-ab7101214912@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lersek@redhat.com \
    --cc=marcel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.