diff options
author | Cai Huoqing <caihuoqing@baidu.com> | 2021-07-13 09:48:31 +0800 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2021-07-14 13:47:17 -0600 |
commit | 936555bc4f9efce1a9d35466845169c2c7566794 (patch) | |
tree | a743f4a3eb8aeb7436e5dcbf33a0c9f7ae819ce9 /hw/vfio | |
parent | a5dba9bc0552785b91315d457b9397ebd833224b (diff) | |
download | qemu-936555bc4f9efce1a9d35466845169c2c7566794.zip qemu-936555bc4f9efce1a9d35466845169c2c7566794.tar.gz qemu-936555bc4f9efce1a9d35466845169c2c7566794.tar.bz2 |
vfio/pci: Change to use vfio_pci_is()
Make use of vfio_pci_is() helper function.
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210713014831.742-1-caihuoqing@baidu.com
[aw: commit log wording]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'hw/vfio')
-rw-r--r-- | hw/vfio/pci.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index ab4077a..971273f 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3058,14 +3058,14 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) } } - if (vdev->vendor_id == PCI_VENDOR_ID_NVIDIA) { + if (vfio_pci_is(vdev, PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID)) { ret = vfio_pci_nvidia_v100_ram_init(vdev, errp); if (ret && ret != -ENODEV) { error_report("Failed to setup NVIDIA V100 GPU RAM"); } } - if (vdev->vendor_id == PCI_VENDOR_ID_IBM) { + if (vfio_pci_is(vdev, PCI_VENDOR_ID_IBM, PCI_ANY_ID)) { ret = vfio_pci_nvlink2_init(vdev, errp); if (ret && ret != -ENODEV) { error_report("Failed to setup NVlink2 bridge"); |