Allow mdev devices to be created on the matrix device.
Signed-off-by: Shalini Chellathurai Saroja <shalini(a)linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk(a)linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
---
src/node_device/node_device_driver.c | 5 ++++-
src/node_device/node_device_udev.c | 4 +++-
2 files changed, 7 insertions(+), 2 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 9086493b..d244b53c 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1249,8 +1249,10 @@ udevProcessAPMatrix(struct udev_device *device,
virNodeDeviceDefPtr def)
{
size_t i;
+ virNodeDevCapDataPtr data = &def->caps->data;
- def->name = g_strdup_printf("ap_%s",
g_strdup(udev_device_get_sysname(device)));
+ data->ap_matrix.addr = g_strdup(udev_device_get_sysname(device));
+ def->name = g_strdup_printf("ap_%s", data->ap_matrix.addr);
for (i = 0; i < strlen(def->name); i++) {
if (!(g_ascii_isalnum(*(def->name + i))))
--
2.26.2