Skip to contentSkip to conversation

vfio/pci: Change to use "vfio_pci_is"

PATCH New Cai Huoqing 1 participant 1 message Jul 13, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfio/pci: Change to use "vfio_pci_is"

Since we don't have an encoding like the previous quirk, we can use vfio_pci_is().

---
 hw/vfio/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/vfio/pci.c +2 -2
index ab4077aad2..971273fd45 100644
@@ -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");
Signature · 1 line
2.25.1