From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgC4c-0000vP-4C for qemu-devel@nongnu.org; Thu, 19 Jul 2018 12:46:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgC4b-00071B-4B for qemu-devel@nongnu.org; Thu, 19 Jul 2018 12:46:38 -0400 References: <3390c4bf-ffac-3744-fd85-84f4ee8193bf@ilande.co.uk> <85e11e69-84fd-1dc7-28cf-d4c0820c4f05@redhat.com> From: Mark Cave-Ayland Message-ID: Date: Thu, 19 Jul 2018 17:46:17 +0100 MIME-Version: 1.0 In-Reply-To: <85e11e69-84fd-1dc7-28cf-d4c0820c4f05@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] How to generate custom fw paths for IDE devices? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , qemu-devel Cc: Kevin Wolf , qemu-block@nongnu.org, Laszlo Ersek , armbru@redhat.com, "qemu-ppc@nongnu.org" , marcel@redhat.com, jsnow@redhat.com On 19/07/18 09:10, Thomas Huth wrote: > On 18.07.2018 23:13, Mark Cave-Ayland wrote: >> Hi all, >> >> Following on from a couple of patches I've previously posted to the >> mailing list at >> https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg08836.html I've >> made some good progress with trying to add bootindex support to OpenBIOS >> but I'm stuck with generating the IDE device paths from QEMU. >> >> According to OpenBIOS the device path for a cdrom on a sun4u machine >> should be: >> >>   /pci@1fe,0/pci@1,1/ide@3/ide1@8100/cdrom@0 >> >> whereas with my working patchset I'm currently generating: >> >>   /pci@1fe,0/pci@1,1/ide@3/drive@1 >> >> The issue is that the drive@1 part is being generated by the IDE drive >> device attached to the IDE bus in hw/ide/qdev.c, and so I think I need >> to override idebus_get_fw_dev_path() to manually generate the remainder >> of the path including both the controller and the correctly named drive >> node. >> >> One option may be to consider subclassing IDEBus and overriding >> idebus_get_fw_dev_path() there, but the cmd646 device is a child of >> TYPE_PCI_IDE which has its own internal IDEBus and so it seems >> overriding it is impossible. >> >> Can anyone point me in the right direction as to how to generate the >> correct fw path for IDE devices in the above format for sun4u machines? > > Not sure if it is of any help, but the pseries machine is also rewriting > the device paths for the device tree: See function spapr_get_fw_dev_path > in hw/ppc/spapr.c. Ah I see - this is very useful indeed, as it seemingly allows all the fw paths to be managed in a single place without having to add Bus support. Thanks for the reference! ATB, Mark.