From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb1Vd-0001ou-3H for qemu-devel@nongnu.org; Thu, 26 Mar 2015 02:43:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yb1VZ-0007Cp-Su for qemu-devel@nongnu.org; Thu, 26 Mar 2015 02:43:17 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:40594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yb1VZ-0007By-93 for qemu-devel@nongnu.org; Thu, 26 Mar 2015 02:43:13 -0400 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Mar 2015 12:13:06 +0530 From: Nikunj A Dadhania Date: Thu, 26 Mar 2015 12:12:11 +0530 Message-Id: <1427352132-1762-1-git-send-email-nikunj@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/2] vfio-pci: add flag to identify vfio pci device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: nikunj@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, Alex Williamson , qemu-ppc@nongnu.org, david@gibson.dropbear.id.au >>From PCIDevice there is no way to know if the device has a backing vfio device. sPAPR guests inherits the "ibm,loc-code" from the pci pass through device in hypervisor. This helps in identifying the device if there is any failures using this "ibm,loc-code" for RAS capabilities. CC: Alex Williamson CC: Alexander Graf Signed-off-by: Nikunj A Dadhania --- hw/vfio/pci.c | 2 ++ include/hw/pci/pci.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 6b80539..95d666e 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3483,6 +3483,7 @@ static void vfio_instance_finalize(Object *obj) VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, pci_dev); VFIOGroup *group = vdev->vbasedev.group; + pci_dev->is_vfio = false; vfio_unmap_bars(vdev); g_free(vdev->emulated_config_bits); g_free(vdev->rom); @@ -3542,6 +3543,7 @@ static void vfio_instance_init(Object *obj) PCIDevice *pci_dev = PCI_DEVICE(obj); VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, PCI_DEVICE(obj)); + pci_dev->is_vfio = true; device_add_bootindex_property(obj, &vdev->bootindex, "bootindex", NULL, &pci_dev->qdev, NULL); diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index b97c295..0ddc830 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -291,6 +291,8 @@ struct PCIDevice { /* SHPC */ SHPCDevice *shpc; + bool is_vfio; + /* Location of option rom */ char *romfile; bool has_rom; -- 1.8.3.1