From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbNuu-0002kU-3B for qemu-devel@nongnu.org; Fri, 27 Mar 2015 02:38:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbNuj-0007Ug-5e for qemu-devel@nongnu.org; Fri, 27 Mar 2015 02:38:52 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbNuj-0007UI-1Q for qemu-devel@nongnu.org; Fri, 27 Mar 2015 02:38:41 -0400 Received: by pacwe9 with SMTP id we9so86666898pac.1 for ; Thu, 26 Mar 2015 23:38:40 -0700 (PDT) Message-ID: <5514FAE9.1080105@ozlabs.ru> Date: Fri, 27 Mar 2015 17:38:33 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1427352132-1762-1-git-send-email-nikunj@linux.vnet.ibm.com> <1427352132-1762-2-git-send-email-nikunj@linux.vnet.ibm.com> <5514CB9C.4000701@ozlabs.ru> <877fu3m03d.fsf@linux.vnet.ibm.com> In-Reply-To: <877fu3m03d.fsf@linux.vnet.ibm.com> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] spapr: populate ibm,loc-code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikunj A Dadhania , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, agraf@suse.de, david@gibson.dropbear.id.au On 03/27/2015 05:21 PM, Nikunj A Dadhania wrote: > Alexey Kardashevskiy writes: > >>> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c >>> index 95d666e..dd97258 100644 >>> --- a/hw/vfio/pci.c >>> +++ b/hw/vfio/pci.c >>> @@ -3319,6 +3319,24 @@ static void vfio_unregister_req_notifier(VFIOPCIDevice *vdev) >>> vdev->req_enabled = false; >>> } >>> >>> +bool vfio_get_devspec(PCIDevice *pdev, char **value) >> >> >> This function can live in hw/ppc/spapr_pci_vfio.c. Something like >> object_property_get_str(OBJECT(pdev), "host", NULL) will return the host >> address, and this is all you really want from VFIO here. > > Looking more deeper, "host" is part of VFIOPCIDevice, which is not > available in hw/pci/spapr_pci_vfio.c "host" is also a QOM's property of an VFIO PCI device instance. You do not access it via VFIOPCIDevice::host directly but via object_property_get_str() indirectly (which will fail if the device does not have this property). > > This was the reason, I had to move this code to hw/vfio/pci.c > > Is there a way to get that? -- Alexey