Blame SOURCES/0001-linux-Fix-platform-device-PCI-detection-for-complex-.patch

877270
From b6e18eb57f3dd104704d0a5ec3d2f051645b9068 Mon Sep 17 00:00:00 2001
877270
From: Adam Jackson <ajax@redhat.com>
877270
Date: Wed, 19 Jun 2019 14:23:56 -0400
877270
Subject: [PATCH xserver] linux: Fix platform device PCI detection for complex
877270
 bus topologies
877270
877270
Suppose you're in a Hyper-V guest and are trying to use PCI passthrough.
877270
The ID_PATH that udev will construct for that looks something like
877270
"acpi-VMBUS:00-pci-b8c8:00:00.0", and obviously looking for "pci-" in
877270
the first four characters of that is going to not work.
877270
877270
Instead, strstr. I suppose it's possible you could have _multiple_ PCI
877270
buses in the path, in which case you'd want strrstr, if that were a
877270
thing.
877270
---
877270
 config/udev.c | 6 +++---
877270
 1 file changed, 3 insertions(+), 3 deletions(-)
877270
877270
diff --git a/config/udev.c b/config/udev.c
877270
index 314acba6ce..6e11aa3b88 100644
877270
--- a/config/udev.c
877270
+++ b/config/udev.c
877270
@@ -474,7 +474,7 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path
877270
                                config_odev_probe_proc_ptr probe_callback)
877270
 {
877270
     struct OdevAttributes *attribs = config_odev_allocate_attributes();
877270
-    const char *value;
877270
+    const char *value, *str;
877270
 
877270
     attribs->path = XNFstrdup(path);
877270
     attribs->syspath = XNFstrdup(syspath);
877270
@@ -482,8 +482,8 @@ config_udev_odev_setup_attribs(struct udev_device *udev_device, const char *path
877270
     attribs->minor = minor;
877270
 
877270
     value = udev_device_get_property_value(udev_device, "ID_PATH");
877270
-    if (value && !strncmp(value, "pci-", 4)) {
877270
-        attribs->busid = XNFstrdup(value);
877270
+    if (value && (str = strstr(value, "pci-"))) {
877270
+        attribs->busid = XNFstrdup(str);
877270
         attribs->busid[3] = ':';
877270
     }
877270
 
877270
-- 
877270
2.21.0
877270