[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [patch v5 08/12] vfio: add check aer functionality for hotp
From: |
Cao jin |
Subject: |
[Qemu-devel] [patch v5 08/12] vfio: add check aer functionality for hotplug device |
Date: |
Wed, 23 Mar 2016 18:12:03 +0800 |
From: Chen Fan <address@hidden>
when function 0 is hot-added, we can check the vfio device
whether support hot bus reset.
Signed-off-by: Chen Fan <address@hidden>
---
hw/vfio/pci.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 939b764..90447ac 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3084,6 +3084,19 @@ post_reset:
vfio_pci_post_reset(vdev);
}
+static void vfio_pci_is_valid(PCIDevice *dev, Error **errp)
+{
+ VFIOPCIDevice *vdev = DO_UPCAST(VFIOPCIDevice, pdev, dev);
+ Error *local_err = NULL;
+
+ if (vdev->features & VFIO_FEATURE_ENABLE_AER) {
+ vfio_check_hot_bus_reset(vdev, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
+ }
+ }
+}
+
static void vfio_instance_init(Object *obj)
{
PCIDevice *pci_dev = PCI_DEVICE(obj);
@@ -3138,6 +3151,7 @@ static void vfio_pci_dev_class_init(ObjectClass *klass,
void *data)
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
pdc->init = vfio_initfn;
pdc->exit = vfio_exitfn;
+ pdc->is_valid_func = vfio_pci_is_valid;
pdc->config_read = vfio_pci_read_config;
pdc->config_write = vfio_pci_write_config;
pdc->is_express = 1; /* We might be */
--
1.9.3
- [Qemu-devel] [patch v5 02/12] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset, (continued)
- [Qemu-devel] [patch v5 03/12] vfio: add pcie extended capability support, Cao jin, 2016/03/23
- [Qemu-devel] [patch v5 06/12] vfio: add check host bus reset is support or not, Cao jin, 2016/03/23
- [Qemu-devel] [patch v5 05/12] vfio: refine function vfio_pci_host_match, Cao jin, 2016/03/23
- [Qemu-devel] [patch v5 08/12] vfio: add check aer functionality for hotplug device,
Cao jin <=
- [Qemu-devel] [patch v5 10/12] vfio-pci: pass the aer error to guest, Cao jin, 2016/03/23
- [Qemu-devel] [patch v5 09/12] vfio: vote the function 0 to do host bus reset when aer occurred, Cao jin, 2016/03/23
- [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Cao jin, 2016/03/23
- Re: [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Alex Williamson, 2016/03/24
- Re: [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Chen Fan, 2016/03/24
- Re: [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Alex Williamson, 2016/03/24
- Re: [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Chen Fan, 2016/03/31
- Re: [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Alex Williamson, 2016/03/31
- Re: [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Chen Fan, 2016/03/31
- Re: [Qemu-devel] [patch v5 11/12] vfio: device may stuck in D3 when doing aer recovery, Chen Fan, 2016/03/31