From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: nikunj@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de,
Alex Williamson <alex.williamson@redhat.com>,
qemu-ppc@nongnu.org, david@gibson.dropbear.id.au
Subject: [Qemu-devel] [PATCH 1/2] vfio-pci: add flag to identify vfio pci device
Date: Thu, 26 Mar 2015 12:12:11 +0530 [thread overview]
Message-ID: <1427352132-1762-1-git-send-email-nikunj@linux.vnet.ibm.com> (raw)
>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 <alex.williamson@redhat.com>
CC: Alexander Graf <agraf@suse.de>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
---
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
next reply other threads:[~2015-03-26 6:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-26 6:42 Nikunj A Dadhania [this message]
2015-03-26 6:42 ` [Qemu-devel] [PATCH 2/2] spapr: populate ibm,loc-code Nikunj A Dadhania
2015-03-27 3:16 ` Alexey Kardashevskiy
2015-03-27 4:29 ` Nikunj A Dadhania
2015-03-27 6:21 ` Nikunj A Dadhania
2015-03-27 6:38 ` Alexey Kardashevskiy
2015-03-27 3:28 ` David Gibson
2015-03-27 3:58 ` Alexey Kardashevskiy
2015-03-27 4:34 ` Nikunj A Dadhania
2015-03-27 4:57 ` David Gibson
2015-03-27 6:24 ` Nikunj A Dadhania
2015-03-27 3:05 ` [Qemu-devel] [PATCH 1/2] vfio-pci: add flag to identify vfio pci device Alexey Kardashevskiy
2015-03-31 18:17 ` Alex Williamson
2015-04-01 5:05 ` Nikunj A Dadhania
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=1427352132-1762-1-git-send-email-nikunj@linux.vnet.ibm.com \
--to=nikunj@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).