From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWnxi-00064d-GD for qemu-devel@nongnu.org; Thu, 17 Oct 2013 09:50:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWnxc-0007YN-2x for qemu-devel@nongnu.org; Thu, 17 Oct 2013 09:50:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWnxb-0007YJ-RJ for qemu-devel@nongnu.org; Thu, 17 Oct 2013 09:49:56 -0400 Message-ID: <525FEAFE.3030603@redhat.com> Date: Thu, 17 Oct 2013 15:49:50 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <525E1E5C.4090002@ozlabs.ru> <525E33DA.8040106@redhat.com> <525E4759.10402@ozlabs.ru> <525FDA47.9050306@ozlabs.ru> <525FDE06.1000609@redhat.com> <525FE7E8.5050902@ozlabs.ru> In-Reply-To: <525FE7E8.5050902@ozlabs.ru> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] virtio-blk-pci: how to tell if it is CD or HDD? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Alexander Graf , Nikunj A Dadhania , "qemu-devel@nongnu.org" Il 17/10/2013 15:36, Alexey Kardashevskiy ha scritto: >> > But please make sure to not block the path for non-SLOF machines. -M mac99 should still be able to get different path names for PCI devices for example. > Ok. Then question for you. I need to change root PHB name from > spapr-pci-host-bridge (which is a class name) to something reasonable. For > example, PCIHostBridgeClass::root_bus_path does the job. > > But this part of OF path is made by sysbus_get_fw_dev_path() from > hw/core/sysbus.c which does not know about PCI. So it cannot call PCI > callbacks. > > I workarounded this by setting PHB's "id" to what sysbus_get_fw_dev_path() > returns but this is barely the proper fix. > > I could initialize my PHBs s->mmio[0].addr to BUID and > sysbus_get_fw_dev_path() would return what I need but it won't be MMIO by > any mean and I do not really want to be responsible for all side effect it > may have :) > > So how to fix it correctly? Set dc->fw_name for the spapr-pci-host-bridge class, and similarly for the vio bridge. Paolo