Allow mdev devices to be created on the matrix device.

Signed-off-by: Shalini Chellathurai Saroja <shal...@linux.ibm.com>
Reviewed-by: Bjoern Walk <bw...@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiu...@linux.ibm.com>
---
 src/node_device/node_device_driver.c | 5 ++++-
 src/node_device/node_device_udev.c   | 8 ++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/node_device/node_device_driver.c 
b/src/node_device/node_device_driver.c
index 65c647f5..e254b492 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -662,6 +662,10 @@ nodeDeviceFindAddressByName(const char *name)
             break;
             }
 
+        case VIR_NODE_DEV_CAP_AP_MATRIX:
+            addr = g_strdup(caps->data.ap_matrix.addr);
+            break;
+
         case VIR_NODE_DEV_CAP_SYSTEM:
         case VIR_NODE_DEV_CAP_USB_DEV:
         case VIR_NODE_DEV_CAP_USB_INTERFACE:
@@ -680,7 +684,6 @@ nodeDeviceFindAddressByName(const char *name)
         case VIR_NODE_DEV_CAP_VDPA:
         case VIR_NODE_DEV_CAP_AP_CARD:
         case VIR_NODE_DEV_CAP_AP_QUEUE:
-        case VIR_NODE_DEV_CAP_AP_MATRIX:
         case VIR_NODE_DEV_CAP_LAST:
             break;
         }
diff --git a/src/node_device/node_device_udev.c 
b/src/node_device/node_device_udev.c
index 179793d8..3f425a6f 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1235,8 +1235,12 @@ udevProcessAPQueue(struct udev_device *device,
 
 
 static int
-udevProcessAPMatrix(virNodeDeviceDefPtr def)
+udevProcessAPMatrix(struct udev_device *device,
+                    virNodeDeviceDefPtr def)
 {
+    virNodeDevCapDataPtr data = &def->caps->data;
+
+    data->ap_matrix.addr =  g_strdup(udev_device_get_sysname(device));
     def->name = g_strdup("ap_matrix");
 
     return 0;
@@ -1383,7 +1387,7 @@ udevGetDeviceDetails(struct udev_device *device,
     case VIR_NODE_DEV_CAP_AP_QUEUE:
         return udevProcessAPQueue(device, def);
     case VIR_NODE_DEV_CAP_AP_MATRIX:
-        return udevProcessAPMatrix(def);
+        return udevProcessAPMatrix(device, def);
     case VIR_NODE_DEV_CAP_MDEV_TYPES:
     case VIR_NODE_DEV_CAP_SYSTEM:
     case VIR_NODE_DEV_CAP_FC_HOST:
-- 
2.26.2

Reply via email to